Close

December 20, 2012

s2Member CloudFront Streaming from Sub-Folder

We have been doing a great deal of work using WordPress and a nifty little plugin called s2Member (http://www.s2member.com).  It essentially creates an entire subscription service automatically, complete with secure streaming links to Amazon CloudFront videos, to server content only to paying subscribers.

The technology setup is fairly complex, but once its working its an extremely efficient delivery mechanism for secure video content delivery to paying subscribers.

One really big hurdle we did face, was trying to deliver content from within a sub-folder on CloudFront, using Jwplayer and s2Member.

We kept getting “ID not found” errors while trying to play videos from a sub-folder, but it would work perfectly if we streamed it from the root folder. Technically, for MP4 files, CloudFront requires that you pre-pend “mp4:” to the file you want to stream, but it allows you to get away from it with videos from the root folder.

For files in sub-folders it will break each time. The “mp4:” tag MUST be include to the RTMP file stream, as is display below. Hopefully this will help people avoid the issue we ran into!

 

 
 {type: "rtmp", file: "<?php echo $mp4["streamer"]; ?>/mp4:<?php echo $mp4["file"]; ?>"},