r15882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r15881‎ | r15882 | r15883 >
Date:20:30, 29 July 2006
Author:dale
Status:old
Tags:
Comment:
audio support for java,
mac clients are now defaulted to cortado
Modified paths:
  • /branches/embed_media/phase3/embed/JOrbisPlayer.jar (added) (history)
  • /branches/embed_media/phase3/embed/jogg-0.0.7.jar (added) (history)
  • /branches/embed_media/phase3/embed/jorbis-0.0.15.jar (added) (history)
  • /branches/embed_media/phase3/embed/jorbis_embed.php (added) (history)
  • /branches/embed_media/phase3/includes/Linker.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
@@ -28,6 +28,8 @@
2929 || (agt.indexOf("msie 5.5")!=-1)
3030 || (agt.indexOf("msie 6.0")!=-1) ) );
3131
 32+var is_mac = (agt.indexOf("mac os x")!= -1);
 33+
3234 /*
3335 EMBED FUNCTIONS:
3436 replace a target with a emebed type and provided url.
@@ -49,6 +51,11 @@
5052 //force jre:
5153 //detect plugin avalibilty
5254 var embed_type = detect_client_plugins();
 55+ //force jre for macs for now
 56+ if(is_mac){
 57+ embed_type = 'jre';
 58+ }
 59+
5360 //draw given plugin type:
5461 //document.getElementById(target).innerHTML='play with:'+embed_type +' url: ' + url;
5562
@@ -101,7 +108,7 @@
102109 //div_parent.appendChild(div_cnt);
103110
104111 //expand the magnified section to give space for the controls:
105 - document.getElementById("magnify_"+opt['target']).style.width='145px';
 112+ document.getElementById("magnify_"+opt['target']).style.width='172px';
106113 //show the controls:
107114 document.getElementById("cnt_" + opt['target']).style.display='inline';
108115
@@ -123,14 +130,7 @@
124131 document.video_Launch_of_Skylab_ogg.play();*/
125132 }
126133 function jre_embed(opt){
127 - //alert(target+","+ media_url+","+ opt);
128 -
129 - //var eb = document.createElement("applet");
130 - //eb.code='com.fluendo.player.Cortado.class';
131 - //eb.archive="/wiki_dev/phase3/cortado-ovt-stripped-0.2.0.jar";
132 - //eb.width='320';
133 - //eb.height='240';
134 -
 134+
135135 //need to build an iframe include only really deal with java security issues
136136 //@todo make sure the embed code is coming from the same server as the media
137137 var iframe = document.createElement("iframe");
@@ -145,15 +145,21 @@
146146
147147 if(!opt['stream_type'])opt['stream_type']='video';
148148
149 - //@todo load in the path and server url from mediaWiki
150 - var cortado_src = 'http://metavid.ucsc.edu/wiki_dev/phase3/embed/cortado_embed.php';
151 - cortado_src+= "?media_url=" + opt['media_url'];
152 - cortado_src+= "&stream_type=" + opt['stream_type'];
153 - cortado_src+= "&width=" + opt['width'] + "&height=" + opt['height'];
154 - cortado_src+= "&duration=" + opt['duration'];
 149+ //@todo load in the path and server url from mediaWiki or from the media URL:
 150+
 151+ //for now use jcraft for audio:
 152+ if(opt['stream_type']=='audio'){
 153+ var iframe_src = 'http://metavid.ucsc.edu/wiki_dev/jorbis-0.0.16/player/jorbis_embed.php';
 154+ }else{
 155+ var iframe_src = 'http://metavid.ucsc.edu/wiki_dev/phase3/embed/cortado_embed.php';
 156+ }
 157+ iframe_src+= "?media_url=" + opt['media_url'];
 158+ iframe_src+= "&stream_type=" + opt['stream_type'];
 159+ iframe_src+= "&width=" + opt['width'] + "&height=" + opt['height'];
 160+ iframe_src+= "&duration=" + opt['duration'];
155161
156162 //document.write(cortado_src);
157 - iframe.src=cortado_src;
 163+ iframe.src=iframe_src;
158164
159165 //wiki_dev/phase3/embed/cortado_embed.php?media_url=http://metavid.ucsc.edu/wiki_dev/phase3/images/3/38/Launch_of_Skylab.ogg
160166 info_div = document.getElementById("info_"+opt['target']);
Index: branches/embed_media/phase3/includes/Linker.php
@@ -791,7 +791,7 @@
792792 }else{
793793 $ratio = $height/$width;
794794 }
795 - //only allow scale if video
 795+ //scale if video
796796 if($img->type == MEDIATYPE_VIDEO){
797797 if(isset($options['width']))$width=$options['width'];
798798 if(isset($options['height'])){
@@ -800,10 +800,8 @@
801801 //use the ratio of grabbed frame to keep scale.
802802 $height = round($width*$ratio);
803803 }
804 - }
 804+ }
805805
806 -
807 -
808806 //this may be usefull if we want to include a specific alternate image for the movie still.
809807 if ( $options['manual_thumb'] != '' ) # Use manually specified thumbnail
810808 {
@@ -869,9 +867,8 @@
870868 }else{
871869 $im_frame_url = $img->movieFrameUrl();
872870 $stream_type = 'video';
873 - }
 871+ }
874872
875 -
876873 $u = $title->escapeLocalURL();
877874 $alt = $options['alt'];
878875
@@ -879,7 +876,7 @@
880877 //@todo pull media server location from config.
881878 $media_url = "http://metavid.ucsc.edu" . $img->getUrl();
882879
883 - //do output:
 880+ //do output:
884881 $embed_out='';
885882
886883 //@todo move embed media js include to <head>
@@ -888,7 +885,6 @@
889886 }
890887 //grab the duration
891888 $duration = $img->getDuration();
892 - $height = $img->getHeight();
893889 //echo "GET DURRATION : $duration ... while get HEIGHT: $height<BR>";
894890
895891 $embed_vars = "{target:'{$base_unique_name}',media_url:'{$media_url}',stream_type:'{$stream_type}'";
@@ -903,8 +899,8 @@
904900 <img id ="img_{$base_unique_name}" width="{$width}" height="{$height}" src="{$im_frame_url}">
905901 </a>
906902 </div>
907 - <div class="thumbcaption" {$textalign}>
908 - <div id="magnify_{$base_unique_name}" class="magnify" style="width:54px;float:{$magnifyalign};">
 903+ <div class="thumbcaption" {$textalign}>
 904+ <div id="magnify_{$base_unique_name}" class="magnify" style="width:81px;float:{$magnifyalign};">
909905 <a id="play_{$base_unique_name}" title="play media" href="javascript:auto_embed({$embed_vars})">
910906 <img style="float:right" src="{$icon_path}vid_play_sm.png">
911907 </a>
@@ -923,8 +919,11 @@
924920 </a>
925921 </span>
926922 <a id="info_{$base_unique_name}" title="media info" href="{$u}">
927 - <img style="float:right" src="{$wgScriptPath}/skins/common/images/icons/vid_info_sm.png">
928 - </a>
 923+ <img style="float:right" width="27" height="27" src="{$wgScriptPath}/skins/common/images/icons/vid_info_sm.png">
 924+ </a>
 925+ <a id="dw_{$base_unique_name}" title="download media" href="{$media_url}">
 926+ <img style="float:right" width="27" height="27" src="{$wgScriptPath}/skins/common/images/icons/vid_download_sm.png">
 927+ </a>
929928 </div>
930929 {$label}
931930 </div>
Index: branches/embed_media/phase3/embed/JOrbisPlayer.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/embed_media/phase3/embed/JOrbisPlayer.jar
___________________________________________________________________
Added: svn:mime-type
932931 + application/octet-stream
Index: branches/embed_media/phase3/embed/jogg-0.0.7.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/embed_media/phase3/embed/jogg-0.0.7.jar
___________________________________________________________________
Added: svn:mime-type
933932 + application/octet-stream
Index: branches/embed_media/phase3/embed/jorbis-0.0.15.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/embed_media/phase3/embed/jorbis-0.0.15.jar
___________________________________________________________________
Added: svn:mime-type
934933 + application/octet-stream
Index: branches/embed_media/phase3/embed/jorbis_embed.php
@@ -0,0 +1,58 @@
 2+<?
 3+$media_url = (isset($_GET['media_url']))?$_GET['media_url']:die('no media url provided');
 4+?>
 5+<html>
 6+ <head>
 7+ <TITLE>JOrbisPlayer</TITLE>
 8+ </head>
 9+
 10+ <BODY bgcolor=#FFFFFF link="#0000FF" text="#000000" vlink="#0000FF"
 11+ alink="#FF0000" topmargin="0" bottommargin="0" leftmargin="0"
 12+ rightmargin="0" marginheight="0" marginwidth="0">
 13+
 14+<?
 15+//stoped
 16+if(!isset($_GET['state']))$_GET['state']='play';
 17+
 18+
 19+if($_GET['state']=='play'){
 20+ ?>
 21+ <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
 22+ width="1" height="1" align="left"
 23+ codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
 24+ <PARAM NAME="java_codebase" VALUE="http://www.jcraft.com/jorbis/player/">
 25+ <PARAM NAME="java_code" VALUE="JOrbisPlayer.class">
 26+ <PARAM NAME="archive" VALUE="JOrbisPlayer-0.0.16.2-rsa.jar">
 27+ <PARAM NAME="jorbis.player.play.0" VALUE="<?=$media_url?>">
 28+ <PARAM NAME="jorbis.player.icestats" VALUE="no">
 29+ <PARAM NAME="jorbis.player.playonstartup" VALUE="yes">
 30+ <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
 31+ <COMMENT>
 32+
 33+ <EMBED type="application/x-java-applet;version=1.3"
 34+ width="1" height="1"
 35+ java_codebase="http://www.jcraft.com/jorbis/player/"
 36+ java_code="JOrbisPlayer.class"
 37+ archive="JOrbisPlayer-0.0.16.2-rsa.jar"
 38+ jorbis.player.play.0="<?=$media_url?>"
 39+ jorbis.player.icestats="no"
 40+ jorbis.player.playonstartup="yes"
 41+ pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html">
 42+ <NOEMBED>
 43+ </COMMENT>
 44+ No J2SE plugin support.
 45+ </NOEMBED>
 46+ </EMBED>
 47+</OBJECT>
 48+<a href="<?=$_SERVER['REQUEST_URI'].'&state=stop'?>">Stop</a>
 49+<?
 50+}else if($_GET['state']=='stop'){
 51+ ?>
 52+ <a href="<?=$_SERVER['PHP_SELF'].'?media_url='.$_GET['media_url']?>">Play</a>
 53+ <?
 54+}
 55+
 56+?>
 57+
 58+</body>
 59+</html>