By nextperu
on Thu, 05/29/2014 - 18:34
Hello everybody,
I've managed to merge both examples (Cloud reco, I used the "Book" example as base & Video playback). The app I made allows you to play a Youtube video when you target an image (like if it was a normal mp4 hosted on a remote server).
But I wasn't able to fix some things. I'm using the same VideoPlayback prefab and the same VideoPlaybackBehaviour.cs and I just modify the video path, but when I change the VideoPath using this code:
private void ShowContentData(string ContentData){// Obtener videoVideoPlaybackBehaviour video = AugmentationObject.GetComponentInChildren<VideoPlaybackBehaviour>(); // Limpiar string parseadoContentData = ContentData.Replace(@"\", "");ContentData = ContentData.Remove(0,1);var index = ContentData.Length;ContentData = ContentData.Remove(index-1,1); video.VideoPlayer.Unload ();video.VideoPlayer.SetFilename(ContentData);video.VideoPlayer.Load (ContentData, VideoPlayerHelper.MediaType.ON_TEXTURE, true, 0.0f); //Optionally play the video automatically when the target is foundif (video != null && video.AutoPlay){ShowObject (); if (video.VideoPlayer.IsPlayableOnTexture()){VideoPlayerHelper.MediaState state = video.VideoPlayer.GetStatus();if (state == VideoPlayerHelper.MediaState.PAUSED || state == VideoPlayerHelper.MediaState.READY || state == VideoPlayerHelper.MediaState.STOPPED){// Pause other videos before playing this onePauseOtherVideos(video); // Play this video on texture where it left offvideo.VideoPlayer.Play(false, video.VideoPlayer.GetCurrentPosition());}else if (state == VideoPlayerHelper.MediaState.REACHED_END){// Pause other videos before playing this onePauseOtherVideos(video); // Play this video from the beginningvideo.VideoPlayer.Play(false, 0);}}} mHasBeenFound = true;mLostTracking = false;}
It shows the last frame seen from the previous video (that got paused) behind the loading icon before playing the new video. How can I clear completely the VideoPlayback object so it won't show that last frame as background for the busy icon of the new one?.
Any help would be appreciated.
Cloud recognition and videoplayback problem
You posted the same here:
https://developer.vuforia.com/forum/cloud-recognition/cloud-recognition-and-videoplayback-problem