# HG changeset patch # User cavaliet # Date 1326467583 -3600 # Node ID a1f9f75839257d01da6968900a98dc62e409a667 # Parent de5a44f597e934c2b759f349f0f28505ea2e7147 The embed player can now play a youtube video. diff -r de5a44f597e9 -r a1f9f7583925 src/ldt/ldt/ldt_utils/projectserializer.py --- a/src/ldt/ldt/ldt_utils/projectserializer.py Fri Jan 13 12:42:07 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/projectserializer.py Fri Jan 13 16:13:03 2012 +0100 @@ -352,6 +352,8 @@ elif content.videopath: href = content.videopath.rstrip('/') + "/" + content.src meta_item_value = content.videopath.rstrip('/') + "/" + else: + href = content.src new_media = { "http://advene.liris.cnrs.fr/ns/frame_of_reference/ms" : "o=0", diff -r de5a44f597e9 -r a1f9f7583925 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Fri Jan 13 12:42:07 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Fri Jan 13 16:13:03 2012 +0100 @@ -104,13 +104,22 @@ } ] }, + {% if youtube_url %} player:{ - type:'jwplayer', // player type - live: true, - height: 300, - width: {{ player_width }}, - provider: "rtmp" + type:'youtube', // player type + height: 300, + width: {{ player_width }}, + video: '{{ youtube_url }}' }, + {% else %} + player:{ + type:'jwplayer', // player type + live: true, + height: 300, + width: {{ player_width }}, + provider: "rtmp" + }, + {% endif %} modules: [ { type: "MediaFragment", metadata:{ diff -r de5a44f597e9 -r a1f9f7583925 src/ldt/ldt/ldt_utils/views/front.py --- a/src/ldt/ldt/ldt_utils/views/front.py Fri Jan 13 12:42:07 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/views/front.py Fri Jan 13 16:13:03 2012 +0100 @@ -64,6 +64,10 @@ def annot_content(request, content_iri_id): # Get the wanted content content = Content.objects.get(iri_id=content_iri_id) + # Get the content src to see if it is a youtube video + youtube_url = None + if content.src is not None and "youtube.com" in content.src: + youtube_url = content.src # The main project for the content proj = Project.objects.filter(contents__in=[content])[0] # Vars for player @@ -81,7 +85,7 @@ return render_to_response("front/front_player.html", {'content': content, 'project':proj, 'player_id': player_id, - 'json_url': json_url, 'player_width':player_width, 'player_height':player_height, 'stream_mode':stream_mode, + 'json_url': json_url, 'player_width':player_width, 'player_height':player_height, 'stream_mode':stream_mode, 'youtube_url':youtube_url, 'is_gecko': is_gecko}, context_instance=RequestContext(request)) diff -r de5a44f597e9 -r a1f9f7583925 src/ldt/ldt/static/ldt/css/front_home.css --- a/src/ldt/ldt/static/ldt/css/front_home.css Fri Jan 13 12:42:07 2012 +0100 +++ b/src/ldt/ldt/static/ldt/css/front_home.css Fri Jan 13 16:13:03 2012 +0100 @@ -22,7 +22,7 @@ list-style: none; } .graph_annotation { - background: url(./imgs/whitealpha.png); margin:148px -297px; position:absolute; + background: url(./imgs/whitealpha.png); margin:148px -296px; position:absolute; } /* Plus annotés */