Handheld.PlayFullScreenMovie with url is fired with delay of 15 secunds on Android

Hi,

When I click a button the MainButtonClick evenHandler is being invoked. If the path is:

a) local path => spinnerPanel is dispayed immediately and after that PlayFullScreenMovie
b) url => spinnerPanel is displayed after 15 secunds and after that immediately PlayFullScreenMovie

c) When I remove PlayFullScreenMovie, the spinnerPanel is displayed immediately.
d) When I remove spinnerPanel, the PlayFullScreenMovie with url is is displayed after 15 secunds

I need to get rid of those 15 secund, because in the meantime user can click the button twice and those cause other issue in the application. Could You please explain this behaviour and how to fix it?

private void MainButtonClick() {
var spinnerPanel = SpinnerPanel.Instance(); //this is my custom image with loading icon
spinnerPanel.Show();
var path = localPath != null? localPath: url;
Handheld.PlayFullScreenMovie(
path,
Color.black,
FullScreenMovieControlMode.Minimal,
FullScreenMovieScalingMode.AspectFit);
}

Put all of that in a coroutine and yield a frame between Show and Play so that Unity gets a chance to display the icon.

THANK YOU A LOT for Your help. I wrote as You said and it works :slight_smile:

private IEnumerator PlayVideoCoroutine(string videoPath)
{
var spinnerPanel = SpinnerPanel .Instance();
spinnerPanel .Show();
yield return null;

Handheld.PlayFullScreenMovie(
videoPath,
Color.black,
FullScreenMovieControlMode.Minimal,
FullScreenMovieScalingMode.AspectFit);
}