Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Wowza rtmp livestream and vod for ios example?


I have my own wowza server setup and I am having a horrible time trying to come up with a snippet of code that will work across all browsers including iphone/ipad.

For some reason, the code I am trying to use works in browsers and the iphone, but not the ipad. The ipad shows no video player at all.

(on the iphone, when the player is clicked the phone switches over to the built in player and works that way).

Here is one example snippet I am using:

bc.. <div id="player">You need Flash or iOS to play this stream</div>
<script type="text/javascript">
jwplayer("player").setup({
height: 270,
players: [{
config: {
file:'livestream',
streamer:'rtmp://server-ip:1935/jgm-liverecord'
},
type: 'flash',
src: '/jw/player-5-5.swf'
},{
config: {
file: 'http://server-ip:1935/jgm-liverecord/livestream/playlist.m3u8'
},
type: 'html5'
}],
plugins: {
'livestream': {
end: 1314921600,
start: 1314907200,
title: 'Live broadcast test'
}
},
width: 480
});
</script>




Here is another example that I have tried but does not work on the ipad:

bc.. <div id="videoframe"></div>

<SCRIPT type="text/javascript">
// Browser-aware video player for JW Player and Wowza
// V0.2 - June 2, 2010
// (c)2010 Ian Beyer
// Released under the GPL

var agent=navigator.userAgent.toLowerCase();
var is_iphone = (agent.indexOf('iphone')!=-1);
var is_ipad = (agent.indexOf('ipad')!=-1);
var is_playstation = (agent.indexOf('playstation')!=-1);
var is_safari = (agent.indexOf('safari')!=-1);
var is_iemobile = (agent.indexOf('iemobile')!=-1);
var is_blackberry = (agent.indexOf('blackberry')!=-1);
var is_android = (agent.indexOf('android')!=-1);
var is_webos = (agent.indexOf('webos')!=-1);

if (is_iphone) { html5Player();}
else if (is_ipad) { html5Player(); }
else if (is_android) { rtspPlayer(); }
else if (is_webos) { rtspPlayer(); }
else if (is_blackberry) { rtspPlayer(); }
else if (is_iemobile) { windowsPlayer(); }
else if (is_playstation) { oldJWPlayer(); }
else { newJWPlayer(); }


function html5Player()
{
var player=document.getElementById("videoframe")
player.innerHTML='<video '+
'HEIGHT="338" '+
'WIDTH="600" '+
'poster="http://website.com/image.jpg" '+
'title="Live Stream">'+
'<source src="http://server-ip:1935/jgm-liverecord/livestream/playlist.m3u8" type="video/mp4"/> '+
'</video>';
}

function rtspPlayer()
{
var player=document.getElementById("videoframe")
player.innerHTML='<A HREF="rtmp://server-ip:1935/jgm-liverecord/livestream">'+
'<IMG SRC="http://website.com/image.jpg" '+
'ALT="Start Mobile Video" '+
'BORDER="0" '+
'HEIGHT="480" '+
'WIDTH="640">'+
'</A>';
}

function windowsPlayer()
{
var player=document.getElementById("videoframe")
player.innerHTML='<A HREF="mms://windows/pubpoint">'+
'<IMG SRC="http://website.com/image.jpg" '+
'ALT="Start Windows Mobile Video" '+
'BORDER="0" '+
'HEIGHT="480" '+
'WIDTH="640">'+
'</A>';
}

function oldJWPlayer()
{
var so = new SWFObject('/jw/player-45.swf','mpl','640','480','8');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('autostart', 'false');
so.addVariable('type', 'rtmp');
so.addVariable('streamer','rtmp://server-ip:1935/jgm-liverecord');
so.addVariable('file','livestream');
so.addVariable('controlbar','over');
so.addVariable('dock','true');
so.write('videoframe');
}

function newJWPlayer()
{
var so = new SWFObject('/jw/player-5-5.swf','mpl','600','338','10');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('autostart', 'false');
so.addVariable('type', 'rtmp');
so.addVariable('streamer','rtmp://server-ip:1935/jgm-liverecord');
so.addVariable('file','livestream');
so.addVariable('controlbar','over');
so.addVariable('dock','true');
so.write('videoframe');
}

</SCRIPT>




**I am guessing that this is a somewhat 'normal' request, as all I am trying to do is use jw/html5 to show a live video stream from Wowza.

8 Community Answers

JW Player

User  
0 rated :

I should add that the ingest is .h264 baseline 3 using aac 44.1/32 via adobe media encoder.

JW Player

User  
0 rated :

Does anyone have an example snippet of code that will allow the jw player to work cross platform including ios/ipad?

I have read through everything I can find and still cannot find a solution. Somehow, I must be missing something, because I can't imagine that it is supposed to be this difficult to video's to play.

thanks

JW Player

User  
0 rated :

Shawn, I have a working video on-demand (not streaming) example:
http://osric.com/chris/jwplayer/jwplayer5.5/vod.html

I'm not running my Wowza server as a service, so while the video may not play when you visit the sample page, I have verified that the code works on both a desktop browser and an iOS device (an iPad).

JW Player

User  
0 rated :

Sorry, I meant that my video on-demand example is not a _live_ stream. It is streaming via a Wowza server.

JW Player

User  
0 rated :

@Chris

thanks for the example.

I tried it on my site but for some reason the ipad/iphone still don't work. Have time to take a peek under the hood for me?

http://tiltshift.wptumble.com/live-broadcast/

JW Player

User  
0 rated :

I'm seeing the same thing as you--it works on the desktop, but not on an iOS device. (There I see a video window with the play button crossed out.)

I think the issue may be with the stream? I set up a basic page with an HTML5 video element pointing to your stream, but it does not play on my iPad:
http://osric.com/chris/jwplayer/jwplayer5.5/live-stream.html

This is a wild guess, but you might try a different MP4 container (e.g. .mov instead of .f4v).

JW Player

User  
0 rated :

@Chris

I'm guessing you may be correct about the file itself. Basically I simply use Adobe Media Encoder and have it set to livestream-record.

This allows me auto archive video's of the live events to show up on wowza immediately after the broadcast.

I do notice that wowza saved the video as .flv no matter what I am encoding it at (H.264)

I am guessing that is not at all right, but have no idea.

By any chance could you try to do a liverecord broadcast via Adobe Media Encoder and let me know what settings you use in order to get the final 'saved' video to play properly?

I have tried just about every setting in AME that I can think of, and none of the saved video's will play on the ipad.

thanks

JW Player

User  
0 rated :

when you stream with AME make sure you have mp4:Stream_name in place
having the mp4: will ensure that wowza records the stream as mp4

This question has received the maximum number of answers.