/// <summary> /// Will show native play activity and open video that avaliable by the <see cref="url"/> param. /// </summary> /// <param name="url">Remove video url.</param> public static void ShowRemoteVideo(string url, Action onClose) { if (Application.isEditor) { Application.OpenURL(url); onClose.Invoke(); return; } switch (Application.platform) { case RuntimePlatform.Android: AN_MediaPlayer.ShowRemoteVideo(url, onClose); break; case RuntimePlatform.IPhonePlayer: var isn_uri = ISN_NSURL.URLWithString(url); var player = new ISN_AVPlayer(isn_uri); var viewController = new ISN_AVPlayerViewController(); viewController.Player = player; viewController.Show(); onClose.Invoke(); break; } }
void Start() { m_playButton.onClick.AddListener(() => { AN_MediaPlayer.ShowRemoteVideo(movieURL, () => { Debug.Log("Video closed"); }); }); }