r16277 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16276‎ | r16277 | r16278 >
Date:03:05, 30 August 2006
Author:dale
Status:old
Tags:
Comment:
added 5 second buffer to vlc based playback.
Modified paths:
  • /branches/embed_media/phase3/embed (modified) (history)
  • /branches/embed_media/phase3/embed/m3u.php (added) (history)
  • /branches/embed_media/phase3/includes/Wiki.php (modified) (history)
  • /branches/embed_media/phase3/skins/common/embed_media.js (modified) (history)

Diff [purge]

Index: branches/embed_media/phase3/skins/common/embed_media.js
@@ -5,7 +5,7 @@
66 //if they don't have annodex & on a win/linux look for java/plugin
77 //if on mac force java plugin.
88 */
9 -
 9+var wiki_web_path = 'http://metavid.ucsc.edu/wiki_dev/phase3/';
1010 //some client detection code:
1111 var agt=navigator.userAgent.toLowerCase();
1212 var is_major = parseInt(navigator.appVersion);
@@ -119,6 +119,9 @@
120120 //show the controls:
121121 document.getElementById("cnt_" + opt['target']).style.display='inline';
122122
 123+ //set the media url to the m3u file:
 124+ opt['media_url']=wiki_web_path + 'embed/m3u.php?media_url='+opt['media_url'];
 125+ //alert('url:'+opt['media_url']);
123126 setTimeout('run_vlc(\''+opt['target']+'\',\''+opt['media_url']+'\')', 200);
124127 }
125128
@@ -137,7 +140,6 @@
138141 document.video_Launch_of_Skylab_ogg.play();*/
139142 }
140143 function jre_embed(opt){
141 -
142144 //need to build an iframe include only really deal with java security issues
143145 //@todo make sure the embed code is coming from the same server as the media
144146 var iframe = document.createElement("iframe");
@@ -156,9 +158,9 @@
157159
158160 //for now use jcraft for audio:
159161 if(opt['stream_type']=='audio'){
160 - var iframe_src = 'http://metavid.ucsc.edu/wiki_dev/phase3/embed/jorbis_embed.php';
 162+ var iframe_src = wiki_web_path + 'embed/jorbis_embed.php';
161163 }else{
162 - var iframe_src = 'http://metavid.ucsc.edu/wiki_dev/phase3/embed/cortado_embed.php';
 164+ var iframe_src = wiki_web_path + 'embed/cortado_embed.php';
163165 }
164166 iframe_src+= "?media_url=" + opt['media_url'];
165167 iframe_src+= "&stream_type=" + opt['stream_type'];
Index: branches/embed_media/phase3/includes/Wiki.php
@@ -175,8 +175,7 @@
176176 if( NS_MEDIA == $title->getNamespace() || NS_EMBED == $title->getNamespace() ) {
177177 // FIXME: where should this go?
178178 $title = Title::makeTitle( NS_IMAGE, $title->getDBkey() );
179 - }
180 -
 179+ }
181180 switch( $title->getNamespace() ) {
182181 case NS_IMAGE:
183182 return new ImagePage( $title );
Index: branches/embed_media/phase3/embed/m3u.php
@@ -0,0 +1,21 @@
 2+<?
 3+//generates a m3u file so that vlc buffers clips.
 4+if(isset($_GET['media_url'])){
 5+ $media_url=$_GET['media_url'];
 6+}else{
 7+ //@@TODO media_url = media not found .ogg
 8+ $media_url='';
 9+}
 10+//how much to buffer (for now 5 seconds):
 11+$cache_len = 5000;
 12+
 13+
 14+//set out the m3u file as so that VLC will know to handle it:
 15+header('Content-Type: application/x-videolan-vlc');
 16+?>#EXTM3U
 17+
 18+#EXTVLCOPT:http-caching=<?=$cache_len?>
 19+#
 20+# METAVID playlist file:
 21+#
 22+<?=$media_url?>
\ No newline at end of file
Property changes on: branches/embed_media/phase3/embed
___________________________________________________________________
Modified: svn:ignore
123 - _notes
224 + _notes
cortado-ovt-debug-0.2.0.1.jar
cortado-ovt-stripped-0.2.0.jar
cortado-ovt.jar