Skip to content

Instantly share code, notes, and snippets.

@americos
Created July 29, 2013 17:47
Show Gist options
  • Save americos/6106137 to your computer and use it in GitHub Desktop.
Save americos/6106137 to your computer and use it in GitHub Desktop.
Creating playlists for JW5
#Return a json string of related videos for JW Player playlist
def get_related_videos_for_jwplayer
related = self.related_clips
result = []
#Self Clip
result << {
"file" => self.rate_limited_url,
"image" => self["thumb_url"],
"title" => self["title"]
}
#Rest of related clips
related.each do |c|
item = {
"file" => c.rate_limited_url,
"image" => c["thumb_url"],
"title" => c["title"]
}
result << item
end
result.to_json
end
@americos
Copy link
Author

This lives in MonkeySee's: app/models/video_clip.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment