• How to use LongTail JW Player 5 with Wowza Media Server

    This article describes how to use JW Player 5 to stream from Wowza Media Server.

    Related Articles




    Configuration


    Set up JW Player 5 by using one of the following methods:



    After you have JW Player working following any of the options, you can configure it for streaming by changing the "file" to a video or live stream that you want to display and adding "streamer" and "provider" Flashvars. For example, if you used the Embed Tag method, you would change this:
    Code:
    <embed
      flashvars="file=/data/bbb.mp4"
      allowfullscreen="true"
      allowscripaccess="always"
      id="player1"
      name="player1"
      src="player.swf"
      width="480"
      height="270"
    />
    To this for a video on demand stream:
    Code:
    <embed
      flashvars="file=sample.mp4&streamer=rtmp://localhost:1935/vod&provider=rtmp"
      allowfullscreen="true"
      allowscripaccess="always"
      id="player1"
      name="player1"
      src="player.swf"
      width="480"
      height="270"
    />
    And to this for a live stream:
    Code:
    <embed
      flashvars="file=myStream&streamer=rtmp://localhost:1935/live&provider=rtmp"
      allowfullscreen="true"
      allowscripaccess="always"
      id="player1"
      name="player1"
      src="player.swf"
      width="480"
      height="270"
    />
    The following example shows how to implement the JW Player HTML5 fallback for iOS devices for Apple HTTP Live Streaming (Apple HLS/Cupertino):
    Code:
    <html>
    <head>
    <title>JW Player Fallback</title>
    </head>
    
    <body>
    <script type='text/javascript' src='jwplayer.js'></script>
    
    <div id='mediaplayer'></div>
    
    <script type="text/javascript">
      jwplayer('mediaplayer').setup({
        'id': 'playerID',
        'width': '480',
        'height': '270',
        'provider': 'rtmp',
        'streamer': 'rtmp://[wowza-address]:1935/vod',
        'file': 'sample.mp4',
        'modes': [
            {type: 'flash', src: 'player.swf'},
    	{type: 'html5', config:
    		{
    		'file': "http://[wowza-address]:1935/vod/mp4:sample.mp4/playlist.m3u8",
    		provider: 'video'
    		}
    	}
        ]
      });
    </script>
    </body>
    </html>


    Comments 26 Comments
    1. gretschdaddy -
      I am able to get JW Player to play a live stream. I am now trying to get it to play a multicast stream. I've tried variations of the working code with the multicast info with no success. I am able to view the multicast through VLC using the following - <code>
      rtsp://[wowza-address]:1935/live/finlename?multicastplay
      </code>
      so I know multicast is working. Can this be done? Thanks.
    1. rrlanham -
      Flash doesn't support multi-cast at present.

      Richard
    1. charlie -
      You can re-stream multicast through Wowza to Flash. The connection between Flash and Wowza is unicast (over TCP). The connection between the encoder and Wowza is multicast. Maybe more details aournd exactly what you are trying to accomplish would help.

      Charlie
    1. gretschdaddy -
      Thanks Charlie & Richard. A little background - I am currently running a Cisco Show & Share video portal with an external WMS for vod. I also have the Cisco infrastructure in place for live multicast on my network (Cisco DME's unicast to ACNS viewed on SNS or through wmp). I haven't had much luck streaming h.264 over the current system and found it quite easy to do through WMS with FME. As I mention, I am able to view the multicast through VLC, but don't want to push VLC out to all my end users so would like to be able to embed a player in a webpage that shows the live multicast. Any thoughts / suggestions are appreciated.

      Dave
    1. charlie -
      There is not a way to play a multicast stream directly using the Flash player.

      Charlie
    1. poojan206 -
      My website is in /var/www/html directory and i have installed WowzaMedia server on my VPS in /usr/local/ directory. Can you please tell me what path should I give in the streamer. I have given various things but I hget an error saying stream not found.

      Do i need to install something on the server to support RTMP?

      Please help me
    1. randall -
      Hello poojan206,

      Wowza supports RTMP by default.

      Have you taken a look at the link in the beginning of this thread? It mentions this line:
      flashvars="file=sample.mp4&streamer=rtmp://localhost:1935/vod&provider=rtmp"

      Notice that line uses an application called "vod" which you can setup by reading the VOD Tutorial.

      Also be sure to read through the Quick Start Guide and the Wowza User's Guide.
    1. poojan206 -
      Thanks randall. But still I am getting an error 'Stream not found : video.mov'

      I am using JW Player. Here is my code:

      var flashvars = {

      'file':'video.mov',
      'streamer':'rtmp://127.0.0.1/vod',
      'provider':'rtmp',

      'autostart':'true',

      'plugins':'captions-2',

      'captions.back':'true',

      'captions.file':'/caption.xml',

      'captions.state':'true',

      'captions.fontsize' :'24'

      };
    1. randall -
      Try: 'streamer':'rtmp://127.0.0.1:1935/vod'
    1. randall -
      Also try: 'file':'mp4:video.mov'

      Edit: Actually, adding the port is unnecessary for RTMP, since it defaults to port 1935. You have to add the mp4: prefix to .mov or .flv containers that are encoded in h.264. So, hopefully that works for you.
    1. tripleaaadelay -
      Hi guys, I need help on this one! I'm getting the "crossdomain policy restrictions" error...

      I uploaded "bigbuckbunny_450.mp4 into my "content" folder for my test. My html page along with player.swf and jwplayer.js is in a folder called "examples/jwflashtest."

      I tried the following based on this thread...

      <script type="text/javascript">
      jwplayer("container").setup({
      flashplayer: "player.swf",
      file: "bigbuckbunny_450.mp4&streamer=rtmp://MYIPADDRESS:1935/vod&provider=rtmp",
      height: 270,
      width: 480
      });
      </script>

      I can play the bigbuckbunny file using wowza's "simplevideostreaming" example page, but am having no luck with jw player.

      I've tried adding mp4 to the start... file: "mp4:bigbuckbunny..." but no luck.

      I tried putting a crossdomain.xml file on the server but maybe I put it in the wrong place? Can someone clarify where this should go? I tried outside of the public_html folder and inside too, but no luck. Do I need to put this in as the "root" user on my server?

      Any help would be appreciated.
    1. rrlanham -
      Review the article at top. You need a Flashvars string, which "file" is one part of.

      flashvars="file=sample.mp4&streamer=rtmp://localhost:1935/vod&provider=rtmp"

      Richard
    1. tripleaaadelay -
      Richard,

      Thank you. I got it working, but only after using the "Embed Tag Method" listed above.

      If I follow the "JWEmbedder" link up top (http://www.longtailvideo.com/support...eference-guide) and try modifying the first example they list, by adding "flashvars" the page only loads the message "Loading the player"...

      Code:
      <div id="container">Loading the player ...</div>

      <script type="text/javascript">
      jwplayer("container").setup({
      flashplayer: "/jwplayer/player.swf",
      ***ADDING "FLASHVARS" HERE-> file: "/uploads/video.mp4",
      height: 270,
      width: 480
      });
      </script>

      I am fine using the embed method, but I wanted to let you and others know where I was having trouble, so it could be explained to us beginners.

      Thanks!
    1. dangelovich -
      Should jwplayer be able to use Name Groups from Wowza v3?
      Can someone please post example embedding code?
    1. rrlanham -
      Take a look at this article:

      http://www.wowza.com/forums/content....amic-Streaming

      Richard
    1. apakabartv -
      Hello,
      Has anyone got a JW player PAUSE button issue with Wowza live stream ?
      I got JW player to work with Wowza live stream. However, for some reason, the JW player control button shows PAUSE instead of STOP.

      The problem with PAUSE is that it is a live stream, so there is no such thing called a PAUSE. When the PAUSE button is clicked (or when you clicked on the video screen), JW player will hang. The only way to continue watching after you PAUSE it is by refreshing the browser. i.e. reload the page and the JW player.

      For a live stream, you either keep watching, or stop the stream. When you want to resume after you STOP it, you will pick up whatever stream contents being broadcast when you click the START button.

      I know that this is not a Wowza issue. However, a little bit of google research brought me to this article: http://developer.longtailvideo.com/t...1343#comment:3 It seems that JW player folks don't agree if this is their problem.

      Has anyone experienced this kind of issue with JW player PAUSE button when playing live stream ?

      Regards,
      William.
    1. rrlanham -
      You can't pause a live rtmp stream. You need nDVR with Flash HTTP (Sanjose)

      http://www.wowza.com/forums/content....za-network-DVR

      Richard
    1. johnhenrydale -
      What would the flashvars for an embedded JW player doing a live stream look like if one were using the JW Embedder as opposed to the Embed tag method listed above ?I'm trying to send a live webcam stream (via Wirecast 4) to my Wowza EC2 instance using the following address:rtmp://ec2-50-112-7-99.us-west-2.compute.amazonaws.com/liveStream name = raccliveThe player is hosted here: johnhenrydale.com/racc.htmlPlease help - this is driving me bonkers - all yours and JW's documentation on this is so conflicting. They recommend using JW EMbedder option, yet you guys only show examples for the Embed tag above. Will the JW Embedder option actually work on a simple html web page pulling a live stream from Wowza Ec2 instance ?
    1. rrlanham -
      Change the streamer value to: rtmp://ec2-50-112-7-99.us-west-2.compute.amazonaws.com/liveStream

      The streamer is same ip/appName that you publish to

      Richard
    1. randall -
      Yes, it is possible.

      From the JW docs: http://www.longtailvideo.com/support...eference-guide

      I believe the relevant setup() options are:
      file: [stream name]
      provider: [rtmp]
      streamer: [rtmp://[Server IP]/[Application name]