Yannis Assael
Yannis Assael

Reputation: 1119

Wowza and Android streaming

I am trying to stream video from Wowza to Android. I tried setting a MediaPlayer() and path "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov", but with no success. I get this:

ARTSPConnection: Server unexpectedly closed the connection.

Any suggestions on how I could solve this?

Upvotes: 2

Views: 2899

Answers (2)

Userseekinganswer
Userseekinganswer

Reputation: 75

This is how we need to stream from wowza:

String SrcPath ="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
    myVideoView.setVideoURI(Uri.parse(SrcPath));
    Log.i("parse path",Uri.parse(SrcPath)+"");
    myVideoView.setMediaController(new MediaController(this));
    myVideoView.requestFocus();
    myVideoView.start();}

But before you do this, copy 'bigbuckbunny' video file to 'vod' folder in your wowza setup.

Upvotes: 3

Yannis Assael
Yannis Assael

Reputation: 1119

Well my soltuion was to create a HTML page that would take as a parameter the RTMP url and using Flash Media Playback would play the stream through flash...

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=1;" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
        <title>#############</title>
        <script type="text/javascript">
            function resizeHandler()
            {
                var flash = document.getElementById("FlashMovie");
                window.scrollTo(0, 1);
                flash.focus();
                flash.focus();
            }

            window.onresize = resizeHandler;
            window.onload = resizeHandler;

        </script>
    </head>

    <body style="margin:0; padding:0; background: #000;">
        <div style="margin:0; padding:0; width:100%; height:100%">
            <embed id="FlashMovie" style="width:100%; height:100%" src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" fullScreenOnSelection="true" scale="showall" flashvars="src=rtmp%3A%2F%2F########%2Flive%2FmyStream.sdp&playButtonOverlay=true&loop=true&autoPlay=true&streamType=live&initialBufferTime=2" pluginspage="https://play.google.com/store/apps/details?id=com.adobe.flashplayer"></embed>
        </div>
        <br /><br /><br />
    </body>
</html>

Upvotes: 1

Related Questions