Log in or register to post comments

Video play on texture problem in android 4.4

February 19, 2014 - 11:13am #1

Hi , I'm experimenting on playing videos in AR and I have this problem where my app sometimes can play on texture and sometimes it can't . I have a video prefab which I'm trying to play three different videos on it , and change the videos with a GUI button . but sometimes it doesn't show the video and it only plays the sound of the video and I only want the app to play video on texture. I'm testing on a Nexus 5 with android 4.4. here's my code , I'll appreciate if someone can help me with this.

if(GUI.Button(new Rect(0,0,100,100),"nextVid")){ 

 var currVid = nextVid(currVid); //a function which goes to the next index of videos and loops 

 video.m_path = path[currVid]; //an array which holds the string paths of videos 

 if(video.VideoPlayer.IsPlayableOnTexture()){ 

  video.VideoPlayer.Unload(); 

  if(video.VideoPlayer.Load(path[currVid],VideoPlayerHelper.MediaType.ON_Texture,true,0)) { 

   video.Videoplayer.Play(false,0);

  }

 } 

} 

if(GUI.Button(new Rect(0,0,100,100),"prevVid")){ 

 var currVid = prevVid(currVid); //a function which goes to the next index of videos and loops 

 video.m_path = path[currVid]; //an array which holds the string paths of videos 

 if(video.VideoPlayer.IsPlayableOnTexture()){ //video is a public variable of VideoPlaybackBehaviour type 

  video.VideoPlayer.Unload(); 

  if(video.VideoPlayer.Load(path[currVid],VideoPlayerHelper.MediaType.ON_Texture,true,0)) { 

   video.Videoplayer.Play(false,0); 

  } 

 } 

} 

thanks

Video play on texture problem in android 4.4

February 21, 2014 - 12:01pm #3

It could be the delay in loading the videos, especially if the video files are large, indeed.

However, the code per se does not show any obvious issue; so I would suggest to debug the issue in the contaxt of your application.

 

Video play on texture problem in android 4.4

February 20, 2014 - 12:10pm #2

I just wanted to know if I'm doing something wrong with my code or is it just the delay of loading videos that causes the problem or my phone hardware and OS . I'll appreciate if you can help me with this .

thanks

Log in or register to post comments