Created
July 29, 2013 17:47
-
-
Save americos/6106137 to your computer and use it in GitHub Desktop.
Creating playlists for JW5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This lives in MonkeySee's: app/models/video_clip.rb