Question by
corentindedu · Oct 16, 2019 at 12:55 PM ·
crashvideoscene-loadingapplication
Android app crash when video running.
Hi, everyone !
I have a video problem with my android application. When I develop on the console everything works fine unfortunately when I use the apk on my phone, the crash application.
Here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;
public class VideoStream : MonoBehaviour{
public RawImage rawImage;
public VideoPlayer videoPlayer;
public AudioSource audioSource;
void Start(){
StartCoroutine(PlayVideo());
}
IEnumerator PlayVideo()
{
videoPlayer.Prepare();
WaitForSeconds waitForSeconds = new WaitForSeconds(1);
while (!videoPlayer.isPrepared)
{
yield return waitForSeconds;
break;
}
rawImage.texture = videoPlayer.texture;
videoPlayer.Play();
audioSource.Play();
}
}
I would like to point out that these videos are inside different scenes. (connected to each other).
Can you help me? Thank you.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612213517im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Laptop crashed; Unity scene 'broken' 0 Answers
Unity Crash When Changing Scene frequently 0 Answers
ARcore "Session.CheckAvailablity().result" getting "Unknown Error" and App Crashes immediately 0 Answers
Unity Player crashes on a scene with Video Player. 1 Answer
Multiple Instances of the client 1 Answer