Title: Problem playing CloudFront hosted video
Last modified: August 21, 2016

---

# Problem playing CloudFront hosted video

 *  Resolved [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/)
 * Greetings from Canada,
 * I’m setting up s2members (version 140614) to work with RTMP streaming from AWS/
   CloudFront. I’ve worked with the awesome s2members plugin on another site although
   not with S3/CloudFront. The s2member video tutorial is out of sync with the new
   AWS UI so I had to figure things out. Perhaps somewhere I’ve miss-configured 
   things.
 * On AWS I setup a new user in the IAM interface (as using the root user is frowned
   upon) and gave it CloudFrontFullAccess permissions. This user is a member of 
   the s2member group also with CloudFrontFullAccess permissions. I did give this
   user a password in the Sign-In Credentials section. I added this users’ S3 public
   and private access keys to the correct fields in s2member. Ditto for the public
   and private CloudFront key pair. I then set the option checkbox for s2members
   to configure the CloudFront distributions. On the AWS side I could see the two
   distributions being created and waited for the status to be set to deployed. 
   On the s2members side I got some error messages but after I unchecked the auto-
   configure checkbox and clicked the Save All Settings button again (after waiting
   for the CloudFront deployed status) there were no further errors.
 * I have jwplayer 6.7 installed in the WP root/jwplayer directory as per the instructions.
   When I embed the recommended s2Stream shortcode in a page I don’t see the video
   player. When I look at the page source I don’t see the jwplayer.js script being
   called.
 * Any assistance would be greatly appreciated.
 * Cheers,
    Scott
 * [https://wordpress.org/plugins/s2member/](https://wordpress.org/plugins/s2member/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Lockhart](https://wordpress.org/support/users/muldari/)
 * (@muldari)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086783)
 * I’m having the exact same issue. Hopefully we can get this resolved soon.
 *  Thread Starter [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086853)
 * The fact that I don’t see the jwplayer javascript file bugs me. So to do some
   trouble shooting I uploaded the s2hacks.php file to /wp-content/mu-plugins/ and
   ran it ([http://mysite.ca/?reset_aws=yes](http://mysite.ca/?reset_aws=yes)) to
   wipe the AWS configuration. This wipes the s2members S3/CloudFront configuration.
   Now I can just focus on a local installation.
 * I then uploaded the video.mp4 file to /wp-content/plugins/s2member-files/ and
   updated the test page shortcode to use the locally hosted video file rather than
   AWS S3. Again no video!
 * JWplayer is correctly installed as I can see the javascript file at: [http://mysite.ca/jwplayer/jwplayer.js](http://mysite.ca/jwplayer/jwplayer.js)
 * As before I do not see the jwplayer.js script file included in the browser html
   source. The theme is a (predominantly) css-customized version of underscores (
   [http://underscores.me/](http://underscores.me/)). It has wp_head() which, I 
   would expect, should be sufficient for the s2members plugin to register and enqueue
   the jwplayer javascript. Perhaps I am getting a plugin conflict. I’ll have to
   test the configuration tomorrow in the sandbox. Any advice would be appreciated.
 * Cheers,
    Scott
 *  Thread Starter [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086932)
 * Okay, after a decent night sleep I reconstituted the site on my localhost sandbox.
   I switched the theme over to twentytwelve. Still no video player showing and,
   like the live site, I don’t see the jwpalyer.js script in the site header even
   though I can access it at [http://localhost:8080/mytestsite/jwplayer/jwplayer.js](http://localhost:8080/mytestsite/jwplayer/jwplayer.js).
   I know about case sensitivities on unix systems. The jwplayer is in the right
   location. Nothing aberrant is in the htaccess file.
 * I looked at the other live site where I do have s2member installed and am running
   a twentytwelve child theme. I’ve using it for audio delivery via /wp-content/
   plugins/s2member-files/. The jwplayer works there and I do see the jwplayer.js
   script in the header.
 * Okay, so maybe it is a plugin conflict. I systematically turned off each plugin
   and tested for the video player. I’m now down to running only twentytwelve and
   s2members on WP 3.9.1 and I don’t see the player or javascript file! I downloaded
   a fresh copy of s2members from the WP repository just in case there was a file
   corruption. Still no go.
 * The only relevant difference between the two sites is I don’t currently have 
   PayPal configured on the wayward site or sandbox. I would not expect that playing
   videos would be tied to having the PayPal configuration setup. Correct me if 
   I am wrong.
 * Again any advice would be greatly appreciated.
 * Cheers,
    Scott
 *  Thread Starter [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086979)
 * Okay Cristian and jaswsinc, I see you have been actively addressing other peoples
   issues over the past few hours. I’d greatly appreciate a pointer in my direction.
   I’ve re-watched the video tutorials as well as searched the forums. Obviously
   I’ve got something misconfigured.
 * I’ve tried the video shortcode [s2Stream player=”jwplayer-v6″ player_path=”/jwplayer/
   jwplayer.js” file_download=”video.mp4″ rewrite=”yes” /] as well as the file download
   shortcode [s2File download=”large.jpg” inline=”yes” /]. The file download shortcode
   just gives me the URL for the file.
 * Cheers,
    Scott
 *  Thread Starter [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086997)
 * Okay so even though you are planning to only _stream_ video and not have members
   download it you must fill out the Download Options > **Basic Download Restrictions**.
   I’ve set it to unlimited for all levels. This enables the jwplayer javascript
   in the header of your theme.
 * **AWS S3/CloudFront integration**
    Once I resolved the above issue I was easily
   able to setup CloudFront. Here is how:
 * Log into AWS and create a bucket in Services > S3. Use the bucket naming convention
   as per s2members instructions. Add this to s2members > **Amazon S3/CDN Storage
   Option panel**.
 * Then create a user in AWS Services > IAM, say s2user. Make sure the “Generate
   an access key for each User” is selected then click Create. In the popup click
   _Download Credentials_. A file should be downloaded that has this users Access
   Key ID and Secret Access Key. Add these to the s2members > **Amazon S3/CDN Storage
   Option panel**.
 * In the AWS IAM > Users section select your new user. In the _Permissions_ tab
   click _Attach User Policy _ and scroll down to the _CloudFront Full Access_ policy
   and click the _Select_ button. I also created a Group to which I added this user
   and gave the group the CloudFront Full Access policy as with the user. Don’t 
   know it this is optional.
 * Then select the users _Security Credentials_ tab. Copy the Access Key to the 
   s2members > **Amazon S3/CloudFront CDN Storage Options panel**. I did give the
   user a password but this may be optional. It didn’t hurt.
 * To get the Amazon CloudFront Private Key from AWS click on your login name and
   select the _Security Credentials_ option from the dropdown. You will get a warning
   popup which you can just close. Open the CloudFront Key Pairs section and click
   the Create New Key Pair button then click the Download Private Key File button.
   Copy the _Private Key_ to the Amazon Private Key section of the s2members > **
   Amazon S3/CloudFront CDN Storage Options panel**.
 * Now select the _Yes, automatically configure my Amazon …_ checkbox and click 
   Save All Changes at the bottom. When the page refreshes after the save you will
   get error messages. Don’t worry. Go to AWS Services > CloudFront and you should
   see two distributions (Web and RTMP) with the status labelled as “In Progress”.
   Wait until the status changes to Deployed. Took me about 20-25 minutes. When 
   you see the Deployed status go back to s2members > Amazon S3/CloudFront CDN Storage
   Options panel and uncheck the _Yes, automatically configure my Amazon …_ checkbox.
   Click the click Save All Changes button again. That should clear ay error message.
 * Now upload a video to your S3 bucket and embed the jwplayer in a protected page
   as per the instructions.
 * Perhaps when Jason has time the error message that appears when one saves the
   _Yes, automatically configure my Amazon …_ checkbox can be finessed to something
   like “Check AWS CloudFront for the distribution’s status to change to Deployed”.
   Maybe update the video tutorial if time permits. This really is a great plugin.
   First time I’ve used it with AWS. **Kudos to Jason and the developers.**
 * Cheers,
    Scott
 *  Thread Starter [scott_van](https://wordpress.org/support/users/scott_van/)
 * (@scott_van)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5086998)
 * I should also add that to play a streamed video, now that you have s2member setup
   with a AWS IAM user, you have to configure each video with the correct permissions.
 * To do this select the video in AWS S3 and click the properties tab (upper right
   side). Click **Add More Permissions**. Select _Authenticated Users_ for the Grantee
   and make sure you check _Open/Download_ then click Save.
 * Cheers,
    Scott
 *  [charuchandra91](https://wordpress.org/support/users/charuchandra91/)
 * (@charuchandra91)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5087147)
 * Thanks a million for your detailed instructions scott_van

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problem playing CloudFront hosted video’ is closed to new replies.

 * ![](https://ps.w.org/s2member/assets/icon-256x256.png?rev=980067)
 * [s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions](https://wordpress.org/plugins/s2member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/s2member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/s2member/)
 * [Active Topics](https://wordpress.org/support/plugin/s2member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/s2member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/s2member/reviews/)

## Tags

 * [amazon s3](https://wordpress.org/support/topic-tag/amazon-s3/)
 * [CloudFront](https://wordpress.org/support/topic-tag/cloudfront/)

 * 7 replies
 * 3 participants
 * Last reply from: [charuchandra91](https://wordpress.org/support/users/charuchandra91/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/problem-playing-cloudfront-hosted-video/#post-5087147)
 * Status: resolved