Google Groups

Re: Video Streaming Using Darwin Streaming Server(DSS) through Ethernet LAN


Ricardo Silva @ Lyncode Apr 27, 2012 4:00 AM
Posted in group: android-platform
Hi,

Did you found a way to play RTSP on Android-x86 using VideoView?

Thanks

Segunda-feira, 11 de Abril de 2011 12:16:39 UTC+1, saha escreveu:
 I have my Blaze board running Gingerbread, Connected to my Desktop 
and i am able to ping from PC to Board. Installed DSS on Desktop and i am successful in testing with VLC ( by playing  rtsp://"+DSS-IP +"/"+"sample_50kbit.3gp").

How do i connect DSS with android through Ethernet LAN? 

I tried the following code but its not working. Whats the problem with 
following code? 

try 

  for (Enumeration<NetworkInterface> en = NetworkInterface 
                    .getNetworkInterfaces(); en.hasMoreElements();) 
  { 
                NetworkInterface intf = en.nextElement(); 

                if (intf.getName().startsWith("eth")) 
                { 

                    try 
                    { 
                    mMediaPlayer = new MediaPlayer(); 
                    mMediaPlayer.setDataSource("rtsp://"+DSS-IP 
+"/"+"sample_50kbit.3gp"); 
                    mMediaPlayer.setDisplay(holder); 
                    mMediaPlayer.prepare(); 
                    mMediaPlayer.setOnBufferingUpdateListener(this); 
                    mMediaPlayer.setOnCompletionListener(this); 
                    mMediaPlayer.setOnPreparedListener(this); 
                    mMediaPlayer.setOnVideoSizeChangedListener(this); 

mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
                    mMediaPlayer.setLooping(true); 
                   } 
                    catch (Exception e) 
                  { 
                     Log.e(TAG, "error: " + e.getMessage(), e); 
                  } 

          } 
  } 



catch (SocketException ex) 
 {      }