- Home /
Question by
Emancipate · Oct 15, 2021 at 01:28 PM ·
videovideos
Why does the Video Player play in the Unity editor, but not in the standalone build on an Android device? I've made sure to enable the transcode option. The video file is about 8mb in size.
// code snippet
using UnityEngine.Video;
public class Canvas : MonoBehaviour {
// this function is called when the button is clicked
public void play_hint_one() {
switch(SceneManager.GetActiveScene().buildIndex) {
case 9:
hint_one_video = Instantiate(
Resources.Load<VideoPlayer>("Hint_Videos/Level_9/Hint_1/R_2/L9_H1_R_2_VP"),
new Vector3(0, 0, 0),
Quaternion.identity);
break;
}
if (hint_one_video != null) {
hint_one_video.targetCamera =
GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
hint_one_video.Play();
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Extract audio clip from VideoPlayer for real-time processing 0 Answers
Why import will work only with some .mov files? 0 Answers
Play, seek a video 1 Answer
Video editing in mobile game 1 Answer
Unity 360 Recorder pausing on rendering a 360 video? 0 Answers