Created
February 2, 2009 14:01
-
-
Save julesfern/56919 to your computer and use it in GitHub Desktop.
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
| def embed_player_for(object, options={}) | |
| fallback_label = "Watch #{h object.name} on #{h @context.name}" | |
| fallback_url, js_url = if object.is_a? VideoConstruct | |
| [ @context.canonical_host+url_for_video_construct(object), | |
| @context.canonical_host+url_for_video_construct(object, {:from=>"embed", :format=>"js"})] | |
| else | |
| [ @context.canonical_host+url_for_channel(object), | |
| @context.canonical_host+url_for_channel(object, {:from=>"embed", :format=>"js")] | |
| end | |
| return "<script src=\"#{@context.canonical_host}#{js_url}\"></script>"+ | |
| "<br />Watch #{link_to(h(object.name), fallback_url)} on #{h @context.name}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment