Search code examples
amazon-s3jwplayeramazon-cloudfront

Streaming Video - jwplayer, amazon s3 and cloudfront


I have a streaming distribution at s6b99lczhnef6.cloudfront.net on Amazon. The origin is a bucket in S3. The bucket has a video video.mp4. It's public. I am trying to test streaming this video with jwplayer, following is the code:

<html>
<head>
    <script type="text/javascript" src="jwplayer/jwplayer.js"></script>
</head>
<body>
    <div id="container">Loading the player ...</div>
    <script type="text/javascript">
    jwplayer("container").setup({
        flashplayer: "jwplayer/player.swf",
        file: "video.mp4",
        height: 270,
        provider: "rtmp",
        streamer: "rtmp://s6b99lczhnef6.cloudfront.net/cfx/st",
        width: 480
    });
    </script>
</body> 
</html>

The video is not playing. There are no JS errors. What could be going wrong?


Solution

  • Loading the HTML page from a server other than 'localhost' works.