Log in or register to post comments

Cloud recognition and videoplayback problem

May 29, 2014 - 10:53am #1

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 video VideoPlaybackBehaviour video = AugmentationObject.GetComponentInChildren<VideoPlaybackBehaviour>(); // Limpiar string parseado (this comes from JSON server and I parse it cuz it comes with some "") ContentData = 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 found if (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 one PauseOtherVideos(video); // Play this video on texture where it left off video.VideoPlayer.Play(false, video.VideoPlayer.GetCurrentPosition()); } else if (state == VideoPlayerHelper.MediaState.REACHED_END) { // Pause other videos before playing this one PauseOtherVideos(video); // Play this video from the beginning video.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

February 20, 2016 - 3:51am #2

Please help me in achieving this. 

Log in or register to post comments