0

I am developing a Google TV application, and I have downloaded a mp4 format video from the server and stored in app data. I am trying to play that video inside the Google TV from video view, but it showing the alert like "Can not play the Video".

The same application working properly in Tablet and mobiles but not working in Google TV emulator and TV device.

Video I am downloading from this link and storing in application cache memory as secondvideo.mp4.

                File clip=new File(getCacheDir(),"secondvideo.mp4");
                if(clip.exists()){
                    video.setVideoPath(clip.getAbsolutePath());


                      video.setMediaController(null);
                      video.requestFocus();
                      video.postInvalidateDelayed(100);
                      video.start();
                      flag=true;
                }
            }else{


            }
halfer
  • 19,824
  • 17
  • 99
  • 186
Ganesh
  • 924
  • 2
  • 12
  • 34
  • mp4 does work on Google TV. please add test url for the mp4 file that you are using and sample code to help debug further. – Megha Joshi - GoogleTV DevRel Feb 17 '12 at 19:48
  • also add the Google TV device type and build version. – Megha Joshi - GoogleTV DevRel Feb 17 '12 at 19:49
  • Hi Iam using the following code File clip=new File(getCacheDir(),"secondvideo.mp4"); if(clip.exists()){ //ideo.setVideoPath(clip.getAbsolutePath()); video.setVideoURI(Uri.parse("http://podcast.20min-tv.ch/podcast/20min/199733.mp4")); video.setMediaController(null); video.requestFocus(); video.postInvalidateDelayed(100); video.start(); flag=true; } }else{ showImage();} – Ganesh Feb 21 '12 at 06:16
  • could you provide the test link? the one you pasted in code gives a 404. Also, the code does not seem right. Please follow VideoView or MediaPlayer sample from APIDemos in Android SDK samples. – Megha Joshi - GoogleTV DevRel Feb 21 '12 at 18:47
  • You might also want to look at the video player demo for Google TV: https://code.google.com/p/googletv-video-player/ – dar Mar 01 '12 at 04:05

1 Answers1

0

Video doesn't work well in the emulator. Megha and Dar have given you the right advice. But in case there is still a question you'll find https://developers.google.com/tv/android/docs/gtv_media_formats helpful.

Dar's mention of the sample code I wrote is also a good place to look: https://code.google.com/p/googletv-video-player/

Your video URL has gone dead (404 as Megha pointed out), so I'm not able to review it.