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

JWPlayer 6 and private RTMP streaming from Cloudfront


With JWPlayer 5 you load a new video stream like this:

bc.. jwplayer(playerID).load({ file: 'myfile.mp4?[longboringprivatequerystringstuff]', provider: "rtmp", streamer: "rtmp://abc123etcetcetc.cloudfront.net/cfx/st" }).play();


In JWPlayer 6 this gives the following error:
Error loading media:
File not found

How should I change the code so that I can play RTMP stream in JW Player 6?

The documentation implies that you only need to specify the file as everything is worked out from the file parameter - this needs to be the full URL now.

Doing this also hasn't worked for me:
bc.. jwplayer(playerID).load({ file: 'rtmp://abc123etcetcetc.cloudfront.net/cfx/st/mp4:myfile.mp4?[longboringprivatequerystringstuff]' }).play();


In fact - doing this causes the player to attempt an HTTP request of the URL rather than splitting it up and attempting to stream.

Unfortunately this is only running on my local machine and the content is sensitive so I can't provide any online demos.

Thanks

Chris

38 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Hi Chris,

For V6, you just need to point to the entire thing as one file.

I would look at this document – http://www.longtailvideo.com/support/jw-player/28834/migrating-from-jw5-to-jw6

If you can’t get it working, please provide a link, thanks.

Best,
-Ethan

JW Player

User  
0 rated :

Hi Ethan,

I'm running into the same issue as Chris, but I'm not sure what you mean by "point to the entire thing as one file."

I realize that previous versions require you to split up the file and streamerdoes JW Player 6 not require this? (If this is the case, the documentation may not have been updated to reflect this.)

My embed code looks something like this:

bc.. jwplayer("video_container").setup({
file: "rtmp://sc9pnjwc87m61.cloudfront.net/cfx/st/video.mp4?Expires=1352842540&Signature=[lots of secret identification stuff]"
});



Is this formatting correct?

Thank you!
-Rylan

Ethan Feldman

JW Player Support Agent  
0 rated :

Hi Rylan,

Yes, that is correct, you need to point to the entire thing as one file.

We explain this here – http://www.longtailvideo.com/support/jw-player/28854/using-rtmp-streaming

Formatting looks correct, do you have a link?

Thanks,
-Ethan

JW Player

User  
0 rated :

Hi Ethan,

I got the same exact issus as Rylan. Did you manage to solve it when he asked a few months ago?

Here is my code:

bc.. jwplayer('player_2566').setup({
file: "rtmp://s1oh5cln43sbq3.cloudfront.net/cfx/st/mp4:video.mp4?Policy=[secret stuff]"
});



It gives me an "ID not found on server" (btw the token's algorithm works correctly since we are successfully using it with JWPlayer5 and we're just migrating). The issue seems related to JW6 only but I don't understand why.

Of course I've read first all the documents you linked and I think I understand how JW6 works compared to JW5, but no clue yet.

If you want I can give you a live example, I just need some time to set up a public page since my tests are all private.

Thankyou
-Slayne

Ethan Feldman

JW Player Support Agent  
0 rated :

Can I see where this is running?

JW Player

User  
0 rated :

Exact same problem

Worked fine in 5 when we used the streamer - does not work with the combined streamer and url.

My setup is perfect for html5 but the rtmp barfs everytime.

bc.. <script type="text/javascript">
jwplayer("player1407").setup({

'id': "player1407",
'stretching': "uniform",
'image': "/images/s3_images/splash_plate.jpg",
width:720,
height:406,
playlist: [{
image: "/images/s3_images/splash_plate.jpg",
sources: [{ file: "rtmp://s3ufuglyXXXk2.cloudfront.net/cfx/st/mp4:client_reviews_2013/DunkinBrands2013/DD_OpsMeeting_edit2.mp4?Expires=1374433845&Signature=XXXXXXXXXXXXX&Key-Pair-Id=XXXXXXXXXXXXXX", label: "360p LD" },]
}],
'primary': 'flash',
ga: {}
});
</script>

JW Player

User  
0 rated :

Reflecting on this maybe it's the way the player is splitting the URL.

I tried using the constant and of course I do have an mp4:

Just a thought,

JW Player

User  
0 rated :

Hi,

I wrote my own version of the url generator with a canned policy and it worked. The php lib for aws is very buggy and it seems easier do it by hand.

All set for now :-)

James

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you got it :)

JW Player

User  
-1 rated :

Hi,
I'm having this exact issue. Can someone provide embed code with a sample url?

Thanks,
J

JW Player

User  
0 rated :

Same issue:

Embed Code:
<div id='player_4321'></div>
<script type='text/javascript'>
jwplayer('player_4321').setup({
file: "rtmp://my_server.cloudfront.net:1935/cfx/st/my_video.mp4?Expires=1359672044&Signature=wp1Vt5pEfNmNgfV7mx3OzuTj9Gt6cS~U0f8EulLwfs4puh3JKgep6ftlJYclVXDgov-odx4JJBvMSEQqre7wORZVhIc4WekoECJqbgHlesux~Fu~VF3O84yZyu84SNwNeBd~8EKNxZKvty47OD0qfz0-CKeKwfzxIfdxOOMJ6yc_&Key-Pair-Id=my_id ",
width: "480",
height: "270"
});
</script>

This embed produces ID not found on server. I tested with public read access without signing URL and was able to get that to work. Any ideas for this one?

Thanks,
J

Ethan Feldman

JW Player Support Agent  
1 rated :

Do you have a link?

JW Player

User  
0 rated :

Try this.

rtmp://s1iq2cbtodqqky.cloudfront.net:1935/cfx/st/2012-05-26_12-17-55_73.mp4?Expires=1359678105&Signature=iv5ICtu5o4M3t8eMzFpNPqOf0-41EFgZcy7J62qfeteDynvxQq6InkHYzA-05sMiWJLBZ5yALy2trq3F~oaG89irzFXyMupbpELqpvkESUCz08SCUMmnKBq37kqMHf4rXHdNICq-DJzXlxZiDXKWsK5m25I3sdGrxHNZoo44aDE_&Key-Pair-Id=APKAJC22BYF2JGZTOC6A

-J

Ethan Feldman

JW Player Support Agent  
0 rated :

This says “ID not found on server” , are you sure it is there?

JW Player

User  
0 rated :

Hi Ethan,

I'm having the same problem with jwplayer 6 (free version). I get an "Error loading stream - could not connect to server" despite it working fine in jwplayer 5.

This code works:

http://198.64.147.106/playerv2/testjw5.html

This one does not.

http://198.64.147.106/playerv2/testjw6.html

Can you help me?

Thank you very much in advance

alan

Ethan Feldman

JW Player Support Agent  
0 rated :

“NetworkError: 404 Not Found – http://198.64.147.106/playerv2/jwplayer.flash.swf”

JW Player

User  
0 rated :

Hi Ethan,

Okay, thank you for your help. Can you take another look at these links?

What I really need is for either player 5 or 6 to have both Akamai RTMP Flash tokenization and HTML 5 failover. I don't see where using the embed or object method allows for failover, and the javascript embed method doesn't seem to work with RTMP tokenization. As you can see I'm a bit stymied.

Here are the two test pages for jw player 5 and 6:

http://198.64.147.106/playerv2/testjw5.html

http://198.64.147.106/playerv2/testjw6.html

Thank you again very much.

alan

Ethan Feldman

JW Player Support Agent  
0 rated :

The best way to do this would be like this:

For JW6 – http://www.longtailvideo.com/support/jw-player/29394/hls-with-mp4-fallback (instead of hls for the 1st source, use the rtmp)

For JW5 – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/18530/embedding-an-rtmp-stream-with-an-html5-fallback

JW Player

User  
0 rated :

Ethan, thanks again for your reply.

I saw that link, but as you can see from my attempt here (Test 1, Javascript):

http://198.64.147.106/playerv2/testjw5.html

It doesn't return the video when using the Akamai plugin and token.

I've added another example where I removed the plugin and replaced it with "provider: 'rtmp'" and I get the expected "access denied".

Thoughts?

Ethan Feldman

JW Player Support Agent  
0 rated :

If you are using the akamai plugin, you should get it from them – http://mediapm.edgesuite.net/jw/

JW Player

User  
0 rated :

And I can't get RTMP tokenization to work at all on jwplayer 6.

Ethan Feldman

JW Player Support Agent  
0 rated :

For JW6 – http://www.longtailvideo.com/support/jw-player/28854/using-rtmp-streaming

Secure Token

The Wowza Media Server includes a feature called Secure Token that is used to protect your streams from downloading. It works by having the player send a token to the server, which is verified before the stream is started. JW Player supports this mechanism, using the RTMP securetoken option:

jwplayer(“myElement”).setup({
file: “rtmp://example.com/vod/mp4:myVideo.mp4”,
height: 360,
image: “/assets/myVideo.jpg”,
rtmp: {
securetoken: “Kosif093n203a”
},
width: 640
});

Note we do not support the option to compile in the securetoken. SWF provides little incremental security over JS (they’re both client-side), especially when the JS code is slightly obfuscated.

JW Player

User  
0 rated :

Hi Ethan,

Regarding jw player 6, please see "test 5, rtmp tokenized / using securetoken" on http://198.64.147.106/playerv2/testjw6.html .

I suspect this will not work because that code is for Wowza and my CDN is Akamai.

Any suggestions for tokenization using javascript embed for rtmp?

Thanks

alan

JW Player

User  
0 rated :

Regarding jw player 5, I would like to point out that the Akamai plugin works when using the Object or Embed method of instantiating the player, but not javascript. And that's where I'm stuck.

alan

Ethan Feldman

JW Player Support Agent  
0 rated :

You should use the Akamai V6 plugin then.

Ethan Feldman

JW Player Support Agent  
0 rated :

The provide for V5 works with JS too.

If you click the “Release Package” link on – http://mediapm.edgesuite.net/jw/, they provide you with a sample of it working with our embedder in both v5 and v6.

JW Player

User  
0 rated :

The sample in the zip file for V5 uses swfobject.embedSWF(). But that method doesn't provide HTML 5 failover, does it?

Ethan Feldman

JW Player Support Agent  
0 rated :

It doesn’t, but you should be able to embed using our embedder in the same method, something like:

<script type="text/javascript" src="jwplayer.js"></script>
<div id="thePlayer"></div>
<script type="text/javascript">
    jwplayer("thePlayer").setup({
        flashplayer: "player.swf",
        file: "file.f4m",
        provider: "akamaiProvider.swf",
        height: "270",
        width: "380"
    });
</script>

JW Player

User  
0 rated :

Ethan, that's exactly what I'm trying to do with V5 in "Test 1, Javascript" on the page:

http://198.64.147.106/playerv2/testjw5.html

and it fails.

I would not be surprised if I was doing something wrong, so I truly appreciate your attention.

Ethan Feldman

JW Player Support Agent  
0 rated :

On the 1st example you have:

, file: ‘599/e59911_302.mp4?auth=daEambtdbdsc5avddcBcdanabbqb1b3dccW-bpDFgw-iYG-Gyv_CmEorxH&;aifp=v8000&slist=599/e59911_302’
, streamer: ‘rtmp://cp161626.edgefcs.net/ondemand’
, provider: ‘akamaijw.swf’

If you are using rtmp , you wouldn’t use the amkamai provider.

The akamai provider is for f4m streams (hds).

JW Player

User  
0 rated :

Im trying to connect to live stream with this code on JW6 free

but it shows

ERROR LOADING STREAM:
COULD NOT CONNECT TO SEVER

jwplayer("myElement").setup({
playlist: [{
image: "images/repo.png",
sources: [{
file: "rtmp://mysite.com/live"
},{
file: "http://mysite.com:1935/live/myStream/playlist.m3u8"
}]
}],
height: 360,
primary: "flash",
width: 640
}

anyone can help me?

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you have a link?

JW Player

User  
0 rated :

yeah!!!

http://msportv.com/DEMO/

but the streaming is off now!! please send me an email when u are onlile for check it together!!

albert_van_leizer@hotmail.com

seee youuuuuuu

Ethan Feldman

JW Player Support Agent  
0 rated :

Let me know when it up so I can check.

JW Player

User  
0 rated :

I had the same problem original poster had.

I came up with a workaround:

http://wejn.com/blog/2013/01/how-to-pass-query-string-in-rtmp-connect-url-in-jwplayer6/

that allows you to pass arbitrary query string in RTMP connect URL and then play arbitrary file.

It's tested with Wowza Media Server and judging by the posts so far, it would work for Chris Sun's "cloudfront.net" use case, too.

Ethan Feldman

JW Player Support Agent  
0 rated :

Cool, thanks for sharing.

JW Player

User  
0 rated :

1. i was trying to setup CF/JW 6.2/Signed URLs for 2 days now
2. I read about 100 pages on the web
3. I knew about Cloudberry and the origin permission issues

but after this great post i was eager to try it again with cloudberry - and it works!

post is here: https://forums.aws.amazon.com/thread.jspa?messageID=437093&#437093

greets

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you got it !

This question has received the maximum number of answers.