Index: trunk/extensions/MetavidWiki/maintenance/ogg_thumb_insert.php |
— | — | @@ -28,8 +28,8 @@ |
29 | 29 | ogg_thumb_insert.php 17 /var/www/localhost/htdocs/media/stream.ogg 20 |
30 | 30 | |
31 | 31 | Notes: |
32 | | - if possible you want to use the source footage rather than the ogg to generat thumbnails (ie the mpeg2 or dv) |
33 | | -EOT; |
| 32 | + if possible you want to use the source footage rather than the ogg to generate the thumbnails (ie the mpeg2 or dv) |
| 33 | +EOT; |
34 | 34 | exit (); |
35 | 35 | } |
36 | 36 | $streamid=$args[0]; |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -53,17 +53,16 @@ |
54 | 54 | $this->stream_name = $wgRequest->getVal('stream_name'); |
55 | 55 | if($this->stream_name=='')$error_page.=wfMsg('edit_stream_missing').", "; |
56 | 56 | $this->req_time = $wgRequest->getVal('t'); |
57 | | - if($this->req_time=='')$error_page.=wfMsg('mv_missing_req_time'); |
58 | | - if(!$this->req_time)$this->req_time = $wgRequest->getVal('time_range'); |
59 | 57 | |
60 | 58 | switch($this->feed_format ){ |
61 | 59 | case 'cmml': |
62 | 60 | $this->get_stream_cmml(); |
63 | 61 | break; |
64 | | - case 'jroe': |
| 62 | + /* disabled for now |
| 63 | + * case 'jroe': |
65 | 64 | //returns roe stream info in json object for easy DOM injection |
66 | 65 | $this->get_roe_json(); |
67 | | - break; |
| 66 | + break;*/ |
68 | 67 | case 'roe': |
69 | 68 | $this->get_roe_xml(); |
70 | 69 | break; |
— | — | @@ -124,9 +123,9 @@ |
125 | 124 | die('stream does not exist'); |
126 | 125 | } |
127 | 126 | $this->streamPageTitle = Title::newFromText($this->stream_name.'/'.$this->req_time, MV_NS_STREAM); |
128 | | - //get the default mvd set: |
| 127 | + //get the requested mvd set: |
129 | 128 | $this->mvcp = new MV_Component(); |
130 | | - $this->mvcp->procMVDReqSet(); |
| 129 | + $this->mvcp->procMVDReqSet($only_requested=true); |
131 | 130 | |
132 | 131 | //get all track types avaliable in current range: |
133 | 132 | $this->mvd_type_res = MV_Index::getMVDTypeInRange($this->mvTitle->getStreamId(), |
— | — | @@ -136,7 +135,7 @@ |
137 | 136 | //get all avaliable files |
138 | 137 | $this->file_list =$this->mvTitle->mvStream->getFileList(); |
139 | 138 | } |
140 | | - function get_roe_json(){ |
| 139 | + /*function get_roe_json(){ |
141 | 140 | $fname = 'Mv_SpecialExport::get_roe_json'; |
142 | 141 | wfProfileIn( $fname ); |
143 | 142 | $this->get_row_data(); |
— | — | @@ -149,7 +148,7 @@ |
150 | 149 | $jsonContents = xml2json::transformXmlStringToJson($xml_page); |
151 | 150 | print $jsonContents; |
152 | 151 | wfProfileOut($fname); |
153 | | - } |
| 152 | + }*/ |
154 | 153 | //start high level: |
155 | 154 | function get_roe_xml($header=true){ |
156 | 155 | global $mvDefaultVideoQualityKey, $wgServer; |
— | — | @@ -176,7 +175,7 @@ |
177 | 176 | $dAttr=($file->getNameKey()==$mvDefaultVideoQualityKey)?' default="true"':''; |
178 | 177 | $dSrc=($file->getPathType()=='url_anx')?$this->mvTitle->getWebStreamURL($file->getNameKey()):$file->getFullURL(); |
179 | 178 | ?> |
180 | | - <video id="<?=htmlentities($file->getNameKey())?>"<?=$dAttr?> src="<?=$dSrc?>" title="<?=htmlentities($file->get_desc())?>" content-type="<?=htmlentities($file->getContentType())?>" /> |
| 179 | + <mediaSource id="<?=htmlentities($file->getNameKey())?>"<?=$dAttr?> src="<?=$dSrc?>" title="<?=htmlentities($file->get_desc())?>" content-type="<?=htmlentities($file->getContentType())?>" /> |
181 | 180 | <?}?> |
182 | 181 | </switch> |
183 | 182 | </track> |
— | — | @@ -186,18 +185,18 @@ |
187 | 186 | //output cmml header: |
188 | 187 | //@@todo lookup language for layer key patterns |
189 | 188 | $sTitle = Title::makeTitle(NS_SPECIAL, 'MvExportStream'); |
190 | | - $query = 'stream_name='.$this->stream_name.'&feed_format=cmml&tracks='.strtolower($row->mvd_type); |
191 | | - $clink = $sTitle->getFullURL($query); |
| 189 | + $query = 'stream_name='.$this->stream_name.'&t='.$this->req_time.'&feed_format=cmml&tracks='.strtolower($row->mvd_type); |
| 190 | + $clink = $sTitle->getFullURL($query); |
| 191 | + $inline = (in_array(strtolower($row->mvd_type), $this->mvcp->mvd_tracks))?'true':'false'; |
192 | 192 | ?> |
193 | | - <text id="<?=$row->mvd_type?>" title="<?=wfMsg($row->mvd_type)?>" node_count="<?=$row->count?>" lang="en" content-type="text/cmml" src="<?=htmlentities($clink)?>"> |
| 193 | + <mediaSource id="<?=$row->mvd_type?>" title="<?=wfMsg($row->mvd_type)?>" inline="<?=$inline?>" lang="en" content-type="text/cmml" src="<?=htmlentities($clink)?>"> |
194 | 194 | <? |
195 | | - //output inline cmml: |
196 | | - if(in_array(strtolower($row->mvd_type), $this->mvcp->mvd_tracks)){ |
| 195 | + //output inline cmml (if requested): |
| 196 | + if($inline=='true'){ |
197 | 197 | $this->get_stream_cmml(true, $row->mvd_type); |
198 | 198 | } |
199 | | - //close text track |
200 | 199 | ?> |
201 | | - </text> |
| 200 | + </mediaSource> |
202 | 201 | <? |
203 | 202 | } |
204 | 203 | ?> |
— | — | @@ -263,8 +262,7 @@ |
264 | 263 | <<?=$ns?>title><?=wfMsg($role)?></<?=$ns?>title> |
265 | 264 | <<?=$ns?>description><?=htmlentities(wfMsg($role.'_desc'))?></<?=$ns?>description> |
266 | 265 | </<?=$ns?>head> |
267 | | - <?=$body_string?> |
268 | | - |
| 266 | + <?=$body_string?> |
269 | 267 | </cmml> |
270 | 268 | <? |
271 | 269 | } |
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Component.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | } |
27 | 27 | //process the request set (load from settings if not set in url |
28 | 28 | //@@todo would be good to allow user-set preference in the future) |
29 | | - function procMVDReqSet(){ |
| 29 | + function procMVDReqSet($only_requested=false){ |
30 | 30 | global $wgRequest; |
31 | 31 | global $mvMVDTypeDefaultDisp, $mvMVDTypeAllAvailable; |
32 | 32 | //if already computed return: |
— | — | @@ -39,16 +39,18 @@ |
40 | 40 | $this->mvd_tracks[]= $tk; |
41 | 41 | } |
42 | 42 | } |
43 | | - }else{ |
44 | | - //do reality check on settings: |
45 | | - foreach($mvMVDTypeDefaultDisp as $tk){ |
46 | | - if(!in_array($tk, $mvMVDTypeAllAvailable)){ |
47 | | - global $wgOut; |
48 | | - $wgOut->errorPage('mvd_default_mismatch','mvd_default_mismatch_text'); |
49 | | - } |
| 43 | + }else{ |
| 44 | + if(!$only_requested){ |
| 45 | + //set the default tracks (if not restricted to requested tracks) |
| 46 | + foreach($mvMVDTypeDefaultDisp as $tk){ |
| 47 | + if(!in_array($tk, $mvMVDTypeAllAvailable)){ |
| 48 | + global $wgOut; |
| 49 | + $wgOut->errorPage('mvd_default_mismatch','mvd_default_mismatch_text'); |
| 50 | + } |
| 51 | + } |
| 52 | + //just set to global default: |
| 53 | + $this->mvd_tracks = $mvMVDTypeDefaultDisp; |
50 | 54 | } |
51 | | - //just set to global default: |
52 | | - $this->mvd_tracks = $mvMVDTypeDefaultDisp; |
53 | 55 | } |
54 | 56 | } |
55 | 57 | function getStateReq(){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -89,6 +89,8 @@ |
90 | 90 | |
91 | 91 | //roe url (for xml based metadata) |
92 | 92 | "roe":null, |
| 93 | + //if roe includes metadata tracks we can expose a link to metadata |
| 94 | + "show_meta_link":false, |
93 | 95 | |
94 | 96 | //custom attributes for mv_embed: |
95 | 97 | "play_button":true, |
— | — | @@ -771,18 +773,29 @@ |
772 | 774 | if(typeof data == 'object' ){ |
773 | 775 | js_log('type of data is object'); |
774 | 776 | _this.roe_data = data; |
| 777 | + |
| 778 | + $j.each(_this.roe_data.getElementsByTagName('mediaSource'), function(inx, n){ |
| 779 | + if(n.getAttribute('content-type')=='video/ogg' && n.getAttribute("default")=="true"){ |
| 780 | + js_log('set src to '+n.getAttribute("src")); |
| 781 | + _this['src'] = n.getAttribute("src"); |
| 782 | + } |
| 783 | + if(n.getAttribute('content-type')=='text/cmml'){ |
| 784 | + js_log('cmml available'); |
| 785 | + _this['show_meta_link']=true; |
| 786 | + } |
| 787 | + }); |
| 788 | + /* |
775 | 789 | //set the src to video tag with "default" attribute: |
776 | | - var rVids = _this.roe_data.getElementsByTagName('video'); |
| 790 | + //var rVids = _this.roe_data.getElementsByTagName('video'); |
777 | 791 | js_log('found '+ rVids.length + ' video tags'); |
778 | 792 | $j.each(_this.roe_data.getElementsByTagName('video'), function(inx,n){ |
779 | 793 | if(n.getAttribute("default")=="true"){ |
780 | 794 | js_log('set src to '+n.getAttribute("src")); |
781 | 795 | _this['src'] = n.getAttribute("src"); |
782 | 796 | } |
783 | | - }); |
| 797 | + }); |
| 798 | + */ |
784 | 799 | //set the thumbnail: |
785 | | - //for some reason getElementById does not work > ? |
786 | | - //rThumb = this.roe_data.getElementById('stream_thumb'); |
787 | 800 | $j.each(_this.roe_data.getElementsByTagName('img'), function(inx, n){ |
788 | 801 | if(n.getAttribute("id")=="stream_thumb"){ |
789 | 802 | js_log('set thumb to '+n.getAttribute("src")); |
— | — | @@ -1427,7 +1440,16 @@ |
1428 | 1441 | } |
1429 | 1442 | function do_request(req_url,callback,mv_json_response){ |
1430 | 1443 | js_log('do request: ' + req_url); |
1431 | | - if( parseUri(document.URL).host != parseUri(req_url).host){ |
| 1444 | + if( parseUri(document.URL).host == parseUri(req_url).host){ |
| 1445 | + //no proxy at all do a direct request: |
| 1446 | + $j.ajax({ |
| 1447 | + type: "GET", |
| 1448 | + url:req_url, |
| 1449 | + success:function(data){ |
| 1450 | + callback(data); |
| 1451 | + } |
| 1452 | + }); |
| 1453 | + }else{ |
1432 | 1454 | //check if MV_embed path matches document.URL then we can use the local proxy: |
1433 | 1455 | if(parseUri(document.URL).host == parseUri(mv_embed_path).host ){ |
1434 | 1456 | js_log('use mv_embed_proxy : ' + parseUri(document.URL).host + ' != '+ parseUri(req_url).host); |
— | — | @@ -1443,7 +1465,6 @@ |
1444 | 1466 | //need to get data via DOM proxy injection with callback |
1445 | 1467 | global_req_cb.push(callback); |
1446 | 1468 | if(!mv_json_response){ |
1447 | | - //swap out & in req url: |
1448 | 1469 | req_url =req_url.replace(/&/g,'__amp__'); |
1449 | 1470 | loadExternalJs(mv_embed_path+'mv_data_proxy.php?url='+req_url+ |
1450 | 1471 | '&cb=mv_jsdata_cb&cb_inx='+(global_req_cb.length-1) ); |
— | — | @@ -1452,16 +1473,7 @@ |
1453 | 1474 | loadExternalJs(req_url+'&cb=mv_jsdata_cb&cb_inx='+(global_req_cb.length-1)); |
1454 | 1475 | } |
1455 | 1476 | } |
1456 | | - }else{ |
1457 | | - //no proxy at all do a direct request: |
1458 | | - $j.ajax({ |
1459 | | - type: "GET", |
1460 | | - url:req_url, |
1461 | | - success:function(data){ |
1462 | | - callback(data); |
1463 | | - } |
1464 | | - }); |
1465 | | - } |
| 1477 | + } |
1466 | 1478 | } |
1467 | 1479 | function mv_jsdata_cb(response){ |
1468 | 1480 | //run the callback from the global req cb object: |