Search code examples
jwplayerrtmpamazon-cloudfront

Streaming with CloudFront to JWPlayer


I followed the following tutorial: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/TutorialStreamingJWPlayer.html

And I hosted my html codes inside localhost (at the moment). I get the player opened but player do not play any videos. It just keep rotating (indicating its still loading). But nothing buffers or nothing else happens.

<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="jwplayer.js"></script>
</head>
<body>
<div id='mediaplayer'>This text will be replaced</div>
<script type="text/javascript">
   jwplayer('mediaplayer').setup({
      flashplayer : 'jwplayer.flash.swf',
      width: '720',
      height: '480',
      file: 'rtmp://sxxxxxx.cloudfront.net/cfx/st/a.mp4'
   });
</script>
</body> 

the a.mp4 file has marked public in the S3 bucket. I also created another http download for cloud front and if I just put the following URL file gets downloaded.

http://dxxxxxx.cloudfront.net/a.mp4

Solution

  • Which version of JWPlayer are you using? I'm not sure if this is the issue, but I had to prefix the filename part of my url with mp4:, like this:

    'rtmp://sxxxxxx.cloudfront.net/cfx/st/mp4:a.mp4'
    

    If that doesn't work code you put you code on a public URL, so we can help you diagnose the issue?

    Updated 1 March

    I've had a look at your JWplayer set up and it looks fine.

    I have a local JWPlayer page which I use for testing - it works fine with a RTMP stream I have from Amazon CloudFront, but as soon as switch to your RTMP file I get the same error as you.

    Therefore I think the issue must be todo with your Amazon set up. It might be worth double checking permissions on the file, or trying to add some other files to test with ( i can see you've made it public, but there are also some file level permissions you might need to set)