Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - MediaPlayer video not showing

MediaPlayer video not showing

All your problems with Audio, Video and Images.

MediaPlayer video not showing

Postby davidemo89 » Tue Nov 20, 2012 11:18 pm

I have this big problem with playing video on my app.
I have this game and wanted to show some videos somewhere but, in the best case I can hear the sound but not see the video.

this is the holder

Code: Select all
     public void surfaceCreated(SurfaceHolder holder) {
          level.playerholder = holder;            
          gameLoopThread.setRunning(true);
          renderLoopThread.setRunning(true);
           gameLoopThread.start();
        renderLoopThread.start();            
     }


this is the creation of the mediaplayer and should show the video

Code: Select all
    while(!playerholder.isCreating());         
    MediaPlayer mediaPlayer = new MediaPlayer();
    mediaPlayer.setDisplay(playerholder);
         
         
    switch(startVideo){
   case 1:
   try {   
    mediaPlayer.setDataSource(context,Uri.parse("android.resource://com.getfun.treevolve/raw/getfunvideo"));
               mediaPlayer.prepare();
            } catch (IllegalArgumentException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
            } catch (SecurityException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
            } catch (IllegalStateException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
            } catch (IOException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
            }
            break;
         }
         
         
         
         
         Log.d("player", "Sec: " + Integer.toString(mediaPlayer.getDuration()));
               
         
         
         Log.d("player", "Video width: " + Integer.toString(mediaPlayer.getVideoWidth()));
         mediaPlayer.start();


With this settings my log shows only 0. Like the video is wrong.
If in the second line I delete the holder

Code: Select all
mediaPlayer.setDisplay(playerholder);


is working, all the info in the log are showing correctly but, I hear the audio but don't see anything.

Thank you for the help, I really need this. =)
davidemo89
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 20, 2012 11:13 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 2 guests