Index: branches/embed_media/phase3/skins/common/embed_media.js |
— | — | @@ -28,6 +28,8 @@ |
29 | 29 | || (agt.indexOf("msie 5.5")!=-1)
|
30 | 30 | || (agt.indexOf("msie 6.0")!=-1) ) );
|
31 | 31 |
|
| 32 | +var is_mac = (agt.indexOf("mac os x")!= -1);
|
| 33 | +
|
32 | 34 | /*
|
33 | 35 | EMBED FUNCTIONS:
|
34 | 36 | replace a target with a emebed type and provided url.
|
— | — | @@ -49,6 +51,11 @@ |
50 | 52 | //force jre:
|
51 | 53 | //detect plugin avalibilty
|
52 | 54 | var embed_type = detect_client_plugins();
|
| 55 | + //force jre for macs for now
|
| 56 | + if(is_mac){
|
| 57 | + embed_type = 'jre';
|
| 58 | + }
|
| 59 | +
|
53 | 60 | //draw given plugin type:
|
54 | 61 | //document.getElementById(target).innerHTML='play with:'+embed_type +' url: ' + url;
|
55 | 62 |
|
— | — | @@ -101,7 +108,7 @@ |
102 | 109 | //div_parent.appendChild(div_cnt);
|
103 | 110 |
|
104 | 111 | //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';
|
106 | 113 | //show the controls:
|
107 | 114 | document.getElementById("cnt_" + opt['target']).style.display='inline';
|
108 | 115 |
|
— | — | @@ -123,14 +130,7 @@ |
124 | 131 | document.video_Launch_of_Skylab_ogg.play();*/
|
125 | 132 | }
|
126 | 133 | 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 | +
|
135 | 135 | //need to build an iframe include only really deal with java security issues
|
136 | 136 | //@todo make sure the embed code is coming from the same server as the media
|
137 | 137 | var iframe = document.createElement("iframe");
|
— | — | @@ -145,15 +145,21 @@ |
146 | 146 |
|
147 | 147 | if(!opt['stream_type'])opt['stream_type']='video';
|
148 | 148 |
|
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'];
|
155 | 161 |
|
156 | 162 | //document.write(cortado_src);
|
157 | | - iframe.src=cortado_src;
|
| 163 | + iframe.src=iframe_src;
|
158 | 164 |
|
159 | 165 | //wiki_dev/phase3/embed/cortado_embed.php?media_url=http://metavid.ucsc.edu/wiki_dev/phase3/images/3/38/Launch_of_Skylab.ogg
|
160 | 166 | info_div = document.getElementById("info_"+opt['target']);
|
Index: branches/embed_media/phase3/includes/Linker.php |
— | — | @@ -791,7 +791,7 @@ |
792 | 792 | }else{ |
793 | 793 | $ratio = $height/$width; |
794 | 794 | } |
795 | | - //only allow scale if video |
| 795 | + //scale if video |
796 | 796 | if($img->type == MEDIATYPE_VIDEO){ |
797 | 797 | if(isset($options['width']))$width=$options['width']; |
798 | 798 | if(isset($options['height'])){ |
— | — | @@ -800,10 +800,8 @@ |
801 | 801 | //use the ratio of grabbed frame to keep scale. |
802 | 802 | $height = round($width*$ratio); |
803 | 803 | } |
804 | | - } |
| 804 | + } |
805 | 805 | |
806 | | - |
807 | | - |
808 | 806 | //this may be usefull if we want to include a specific alternate image for the movie still. |
809 | 807 | if ( $options['manual_thumb'] != '' ) # Use manually specified thumbnail |
810 | 808 | { |
— | — | @@ -869,9 +867,8 @@ |
870 | 868 | }else{ |
871 | 869 | $im_frame_url = $img->movieFrameUrl(); |
872 | 870 | $stream_type = 'video'; |
873 | | - } |
| 871 | + } |
874 | 872 | |
875 | | - |
876 | 873 | $u = $title->escapeLocalURL(); |
877 | 874 | $alt = $options['alt']; |
878 | 875 | |
— | — | @@ -879,7 +876,7 @@ |
880 | 877 | //@todo pull media server location from config. |
881 | 878 | $media_url = "http://metavid.ucsc.edu" . $img->getUrl(); |
882 | 879 | |
883 | | - //do output: |
| 880 | + //do output: |
884 | 881 | $embed_out=''; |
885 | 882 | |
886 | 883 | //@todo move embed media js include to <head> |
— | — | @@ -888,7 +885,6 @@ |
889 | 886 | } |
890 | 887 | //grab the duration |
891 | 888 | $duration = $img->getDuration(); |
892 | | - $height = $img->getHeight(); |
893 | 889 | //echo "GET DURRATION : $duration ... while get HEIGHT: $height<BR>"; |
894 | 890 | |
895 | 891 | $embed_vars = "{target:'{$base_unique_name}',media_url:'{$media_url}',stream_type:'{$stream_type}'"; |
— | — | @@ -903,8 +899,8 @@ |
904 | 900 | <img id ="img_{$base_unique_name}" width="{$width}" height="{$height}" src="{$im_frame_url}"> |
905 | 901 | </a> |
906 | 902 | </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};"> |
909 | 905 | <a id="play_{$base_unique_name}" title="play media" href="javascript:auto_embed({$embed_vars})"> |
910 | 906 | <img style="float:right" src="{$icon_path}vid_play_sm.png"> |
911 | 907 | </a> |
— | — | @@ -923,8 +919,11 @@ |
924 | 920 | </a> |
925 | 921 | </span> |
926 | 922 | <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> |
929 | 928 | </div> |
930 | 929 | {$label} |
931 | 930 | </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 |
932 | 931 | + 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 |
933 | 932 | + 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 |
934 | 933 | + 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>
|