I searched a way to automatically load all attached videos in a custom post type as SublimeVideo playlist. After some time I got it working and here I’ll share the code with everyone who is interested to do it the same way.
Leave a Reply
You must be logged in to post a comment.
First of all get all video attachements of the post or page:
2nd: Load the videos into the playlist code with a unique ID (http://docs.sublimevideo.net/beta/playlists). Here I do use the attachement ID for each video and of cause the same for the thumbnail. You have to change the width and height within the
<video>
code.3rd: Well that’s done. Now I wanted to have the videos responsive to allow resizing it for mobile devices. Here the SublimeVideo-Team helped me. Please add the following style to your stylesheet:
The fluid width is defined here (you copied it already!):
Last but not least: Add the JavaScript code as seen at the documentation (http://docs.sublimevideo.net/beta/playlists):
That’s it. I hope it helps anyone who starts get get lost with this, too!