Wowza Community

playlist.php + JWPlayer + Wowza Media Server 3.5

Greetings to all in this forum.

I have a server with Wowza Media Server Perpetual Edition 3.5 on Ubuntu Server 12.04 LTS.

I’m trying to make a playlist with php I detect the device that connects to the web.

I already checked with pc, iphone, ipad, ipod, mac etc and everything works properly but I connect with a Samsung Galaxy I can not play.

I checked the live streaming from my server rtsp real player and everything is fine but my jwplayer will not.

That’s what I can be doing wrong?

index.html

Inside of …

[HTML]

JW Player goes here

[/HTML]

playlist.php

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad")): ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://mydomind.com:1935/live/presentacion_2/playlist.m3u8” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerhttp</jwplayer:provider>

<?php elseif (strpos($_SERVER['HTTP_USER_AGENT'],"blacberry") || strpos($_SERVER['HTTP_USER_AGENT'],"android")): ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“rtsp://mydomind.com:1935/live/presentacion_2” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerrtsp</jwplayer:provider>

<?php else: ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

<media:content url=“presentacion_1” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerrtmp</jwplayer:provider>

jwplayer:streamerrtmp://mydomind.com:1935/live/</jwplayer:streamer>

<?php endif; ?>

[/PHP]

Must I change this line:

elseif (strpos($_SERVER[‘HTTP_USER_AGENT’],“blacberry”) || strpos($_SERVER[‘HTTP_USER_AGENT’],“android”)):

for this?:

elseif (strpos($_SERVER[‘HTTP_USER_AGENT’],“blacberry”) || strpos($_SERVER[‘HTTP_USER_AGENT’],“samsung”) || strpos($_SERVER[‘HTTP_USER_AGENT’],“sony”) || strpos($_SERVER[‘HTTP_USER_AGENT’],“google”)):

Thank you very much for your help

Manyblue

I don’t think JW Player supports RTSP. So you might want to move your Blackberry/Android detection to your index.html file (or index.php) and bypass JW Player for those devices:

<?php 
if (strpos($_SERVER['HTTP_USER_AGENT'],"blackberry") || strpos($_SERVER['HTTP_USER_AGENT'],"android")) {
 header("Location: rtsp://mydomind.com:1935/live/presentacion_2");
 die();
 exit();
?>

Although some Android systems support HLS or Flash streams, so you may not want to automatically redirect all Android users to RTSP. Maybe just give them an RTSP link below your JW Player code in index.html which they can manually click if they have problems.

You cannot completely hide the URLs from the user. They can still look at your playlist.php file.

I just use JW Player’s HLS with Flash fallback mode:

http://www.longtailvideo.com/support/jw-player/29394/hls-with-mp4-fallback

Then offer an additional RTSP stream link below your JW Player embed code for Android or BlackBerry users who may not be able to play Flash or HLS:

<script type="text/javascript" language="JavaScript">
if ( (navigator.userAgent.indexOf('Android') >= 0) || (navigator.userAgent.indexOf('BlackBerry') >= 0) ) {
  document.write('Mobile viewers who cannot see the video above should try <a href="rtsp://mydomind.com:1935/live/presentacion_2">this direct video link</a> instead.');
}
</script>

My solution is the same as your solution, but remove the Android/BlackBerry RTSP portion from playlist.php

Then, add the direct RTSP video link manually below the video, just like the site you linked to:

http://www.outdoorlive.tv/portfolio.php

You can use my JavaScript code above to hide the Android/BlackBerry RTSP link from other users, if you prefer.

JW Player has a free version too, although it contains their logo watermark and is missing some advanced features.

Firstly thank you very much for your answer.

sameone told me that jwplayer does not support “rtmp” protocols.

This playlist work me well:

playlist.php

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad")) { ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://midominio.com:1935/live/presentacion_2/playlist.m3u8” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerhttp</jwplayer:provider>

<?php }else{ ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

<media:content url=“presentacion_1” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerrtmp</jwplayer:provider>

jwplayer:streamerrtmp://midominio.com:1935/live/</jwplayer:streamer>

<?php } ?>

[/PHP]

But what happend with smarphones ??

My probleme is in index.html or index.php i can not begining with:

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"blackberry") || strpos($_SERVER['HTTP_USER_AGENT'],"android")) { header("Location: rtsp://mydomind.com:1935/live/presentacion_2"); die(); exit(); ?>

[/PHP]

because the urls came fron the MySQL data base and are inside of a play list, i don´t know if you undrestand me ??

I used before jwplayer adoble flash media playback fine and down of the player 4 links for http iphone, http for ipad, rtsp for android and blackberry.

My proble here is the users can look the urls of the server, do you understand me ??

that’s what you recommend me ?

Thankyou thankyou for your answer.

Manyblue

PD:

If you have a concret day and a concret hour, I can pass you the url of the website and make a live streaming from Canary Islands to test the last playlist.php in this post.

I don´t like to write publicity in the forums.

I have 2 licences of Wowza Perpetual Edition.

This url show you a play list with jwplayer and this playlist.php:

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad")) { ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://midominio.com:1935/vod/mp4:name of the file.mp4/playlist.m3u8” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerhttp</jwplayer:provider>

<?php }else{ ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

<media:content url=“name of the file flv” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerrtmp</jwplayer:provider>

jwplayer:streamerrtmp://midominio.com:1935/vod/</jwplayer:streamer>

<?php } ?>

[/PHP]

Tell me samething about…

Thanks: Manyblue

Maybe if I use this playlist.php

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad")): ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://www.midominio.com:1935/live/presentacion_2/playlist.m3u8” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerhttp</jwplayer:provider>

<?php elseif (strpos($_SERVER['HTTP_USER_AGENT'],"blacberry") || strpos($_SERVER['HTTP_USER_AGENT'],"android")): header("Location: rtsp://www.midominio.com:1935/live/presentacion_2"); else: ?> Playlist Presentación Libro: El sombrero de paja.

Presentacion.

<media:content url=“presentacion_1” />

<media:thumbnail url=“thumbs/1.png” />

jwplayer:providerrtmp</jwplayer:provider>

jwplayer:streamerrtmp://www.midominio.com:1935/live/</jwplayer:streamer>

<?php endif; ?>

[/PHP]

Thank: Manyblue

OK thankyou, i´ll look it.

JW Player jajajajaja 249 $ anual ??? too expensive for me …

Kind regards: Manyblue

Your solution, i have traied but no go now i can not open de player with my pc.

I have solution for iOS and flash (http, rtmp) but not for android (rtp/rtp)

What do you recommend me?

Thankyou: Manyblue

[PHP]

<?php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad")): ?> Playlist Directo OnLine.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://www.mydomind.com:1935/live/presentacion_2/playlist.m3u8” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerhttp</jwplayer:provider>

<?php elseif (strpos($_SERVER['HTTP_USER_AGENT'],"BlacKberry") || strpos($_SERVER['HTTP_USER_AGENT'],"Android")): ?> Playlist Directo OnLine.

Presentacion.

Sat, 20 Diciembre 2012 20:30:00 GMT

<media:content url=“http://www.maydomind.com:1935/live/presentacion_2/manifest.f4m” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerhttp</jwplayer:provider>

<?php else: ?> Playlist Directo OnLine.

Presentacion.

<media:content url=“presentacion_1” />

<media:thumbnail url=“thumbs/1.gif” />

jwplayer:providerrtmp</jwplayer:provider>

jwplayer:streamerrtmp://www.mydomind.com:1935/live/</jwplayer:streamer>

<?php endif; ?>

[/PHP]

Could this work?

I no longer jwplayer fails in iphone, well, flash for pc, mac etc well but have not tried it on android

kind regards: Manyblue

is other option to instal Rockplaye or Skyfire in andrid for to look flv video ??

Kind regards: Manyblue

First, thank you very much for your attention.

Second, tell you I’m not a programmer, I’m a power user, nothing more.

Third is I have a project in hand but I need to solve this problem with the devices.

I have not tried http://mydomind.com:1935/live/presentacion_2/manifest.f4m in android directly on android but with the player in wowza go fine.

The direct url rtmp (flash), http (iOS) and RTSP (Android) go fine.

I have watched the player coming in wowza and all work fine, the HTTP and rtmp silver light etc etc.

I have installed for the moment: vod, live, dvr and mymodule,

What do you need more, if you want to acces to the server teel me.

Like I said earlier, thanks for your attention: Manyblue

I have test the urls in iphone, ipad, ipod, pc (windows, mac, ubuntu) all go fine.

I haven´t android jajajajaja for example samsung galaxy and for that and for the moment i haven´t test it. But a friend say me no go, he have a new galaxy mini tablet and for that i think no go in google tablet.

Kind regards: Manyblue

I have a suscription to streamingmedia.com

I was reading the article ia heve look in other post here:

http://www.streamingmedia.com/Articles/Editorial/Featured-Articles/Jeroen-Wijering-Talks-HLS-DASH-and-the-JW-Player-6-86523.aspx

I understand now the proble.

I think i have two solutions:

  1. my solution with the playlist.php + down of the player a link only for android rtsp

  2. Use an application for android and flash rtmp, and wait to chrome integrated hls native in the browswer.

Are there other solution ??

A friend told me this:

the only player who played the three protocols is vlc has browser plugins and I think there app available for iPhone and Android.

but not many people have it installed in their browsers.

manublue,

If I were in your place, I would first check the playing of streams on the devices manually. That is, create a playlist file for the device and play it directly (not dyanmically via php), If it doesn’t play, I would check other things but if it plays, then i’ll check my code.

Also, switch-case based code will be cleaner and simpler for you I think.

Thanks and best wishes

Inderjeet S Sodhi

http://www.inderjeetsodhi.com

Hello ManyBlue,

Some device look for port 554 to do rtmp, and for Wowza can use it you have to add in the file: /conf/VHost.xml.

1935,554

I think that is the solution to your problem, Samsung Galaxy smile with me when i use jwplayer, it´s the best. I saw your code, it`s good.

Sorry for my english.

Greetings from Venezuela