Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php |
— | — | @@ -1173,7 +1173,7 @@ |
1174 | 1174 | //returns results via nickname via semantic query: |
1175 | 1175 | function getViaNickname($partname, $limit=5){ |
1176 | 1176 | //split the nickname via spaces: |
1177 | | - $nick_parts = split('_', $partname); |
| 1177 | + $nick_parts = split('_', str_replace(' ', '_',$partname)); |
1178 | 1178 | $query_string=''; |
1179 | 1179 | $or=''; |
1180 | 1180 | foreach($nick_parts as $pname){ |
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php |
— | — | @@ -76,7 +76,6 @@ |
77 | 77 | } |
78 | 78 | //go from High level resource description to smile doc |
79 | 79 | function resolveHLRD_to_SMIL(){ |
80 | | - global $wgTitle; |
81 | 80 | //init smil skeleton: |
82 | 81 | $this->smilDoc = new DOMDocument('1.0','UTF-8'); |
83 | 82 | |
— | — | @@ -87,9 +86,10 @@ |
88 | 87 | //add meta data: |
89 | 88 | $titleNode = $this->smilDoc->createElement('meta'); |
90 | 89 | $titleNode->setAttribute("name", "title"); |
91 | | - $titleNode->setAttribute("content", $wgTitle->getText() ); |
| 90 | + $titleNode->setAttribute("content", $this->mTitle->getText() ); |
| 91 | + //add the title to the head node: |
| 92 | + $headNode->appendChild($titleNode); |
92 | 93 | |
93 | | - |
94 | 94 | //add resolved transitions to the head: |
95 | 95 | $tranNodeList = $this->hlrdDoc->getElementsByTagName('transition'); |
96 | 96 | foreach ($tranNodeList as $tranNode){ |
— | — | @@ -209,6 +209,14 @@ |
210 | 210 | |
211 | 211 | $node->setAttribute('type',$img->getMimeType()); |
212 | 212 | $node->setAttribute('src', $thumbnail->file->getURL()); |
| 213 | + |
| 214 | + //if type is ogg: (set dur and poster) |
| 215 | + if( $img->getMimeType()=='application/ogg') { |
| 216 | + if( !$node->hasAttribute('dur') ) |
| 217 | + $node->setAttribute('dur', $thumbnail->file->getLength() ); |
| 218 | + if( !$node->hasAttribute('poster') ) |
| 219 | + $node->setAttribute('poster', ) |
| 220 | + } |
213 | 221 | } |
214 | 222 | break; |
215 | 223 | } |
— | — | @@ -234,7 +242,10 @@ |
235 | 243 | if(trim($innerWikiText)!=''){ |
236 | 244 | $f = $node->ownerDocument->createDocumentFragment(); |
237 | 245 | $parserOutput = $wgParser->parse($innerWikiText ,$this->mTitle, ParserOptions::newFromUser( $wgUser )); |
238 | | - $f->appendXML($parserOutput->getText()); |
| 246 | + $f->appendXML( "<![CDATA[\n". |
| 247 | + $parserOutput->getText() . |
| 248 | + "]]>" |
| 249 | + ); |
239 | 250 | $node->appendChild($f); |
240 | 251 | } |
241 | 252 | return $node; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -365,6 +365,7 @@ |
366 | 366 | this.default_players = new Object(); |
367 | 367 | this.default_players['video/x-flv']= ['flash','vlc']; |
368 | 368 | this.default_players['video/ogg']=['native','vlc','java']; |
| 369 | + this.default_players['application/ogg']=['native','vlc','java']; |
369 | 370 | this.default_players['video/mp4']=['vlc']; |
370 | 371 | }, |
371 | 372 | addPlayer : function(player, mime_type) |
— | — | @@ -385,7 +386,7 @@ |
386 | 387 | this.players.push(player); |
387 | 388 | }, |
388 | 389 | getMIMETypePlayers : function(mime_type) |
389 | | - { |
| 390 | + { |
390 | 391 | var mime_players = new Array(); |
391 | 392 | if(this.default_players[mime_type]) |
392 | 393 | for (var d in this.default_players[mime_type]) |
— | — | @@ -398,14 +399,15 @@ |
399 | 400 | return mime_players; |
400 | 401 | }, |
401 | 402 | defaultPlayer : function(mime_type) |
402 | | - { |
| 403 | + { |
403 | 404 | var mime_players = this.getMIMETypePlayers(mime_type); |
404 | 405 | if(mime_players.length) |
405 | 406 | { |
406 | 407 | // check for prior preference for this mime type |
407 | | - for(var i in mime_players) |
408 | | - if(mime_players[i].id==this.preference[mime_type]) |
| 408 | + for( var i in mime_players ){ |
| 409 | + if( mime_players[i].id==this.preference[mime_type] ) |
409 | 410 | return mime_players[i]; |
| 411 | + } |
410 | 412 | // otherwise just return the first compatible player |
411 | 413 | // (it will be chosen according to the default_players list |
412 | 414 | return mime_players[0]; |
— | — | @@ -1761,12 +1763,13 @@ |
1762 | 1764 | js_log('set via prefrence: '+playable_sources[source].mime_type); |
1763 | 1765 | this.selected_source = playable_sources[source]; |
1764 | 1766 | } |
1765 | | - } |
| 1767 | + } |
1766 | 1768 | //set Ogg via player support: |
1767 | 1769 | for(var source in playable_sources){ |
| 1770 | + js_log('f:autoSelectSource' + playable_sources[source].mime_type); |
1768 | 1771 | var mime_type =playable_sources[source].mime_type; |
1769 | 1772 | //set source via player |
1770 | | - if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex'){ |
| 1773 | + if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='application/ogg'){ |
1771 | 1774 | for(var i in embedTypes.players){ |
1772 | 1775 | var player = embedTypes.players[i]; |
1773 | 1776 | //debugger; |
— | — | @@ -1851,7 +1854,8 @@ |
1852 | 1855 | }, |
1853 | 1856 | getPlayableSources: function(){ |
1854 | 1857 | var playable_sources= new Array(); |
1855 | | - for(var i in this.sources){ |
| 1858 | + for(var i in this.sources){ |
| 1859 | + js_log('getPlayableSources:'+this.sources[i].mime_type); |
1856 | 1860 | if(this.isPlayableType(this.sources[i].mime_type)){ |
1857 | 1861 | if(mv_restrict_roe_time_source){ |
1858 | 1862 | if(this.sources[i]['start']) |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | disp_play_head:null, |
62 | 62 | userSlide:false, |
63 | 63 | loading:true, |
64 | | - loading_external_data:true, //load external data by default |
| 64 | + loading_external_data:true, //if we are loading external data (set to loading by default) |
65 | 65 | tracks:{}, |
66 | 66 | default_track:null, // the default track to add clips to. |
67 | 67 | init : function(element){ |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | _this.clip_ready_count++; |
208 | 208 | continue; |
209 | 209 | } |
210 | | - js_log('clip sources count: '+ clip.embed.media_element.sources.length); |
| 210 | + //js_log('clip sources count: '+ clip.embed.media_element.sources.length); |
211 | 211 | clip.embed.on_dom_swap(); |
212 | 212 | if(clip.embed.loading_external_data==false && |
213 | 213 | clip.embed.init_with_sources_loadedDone==false){ |
— | — | @@ -437,11 +437,12 @@ |
438 | 438 | //js_log('found clip: '+ this.cur_clip.id + 'transIn:'); |
439 | 439 | |
440 | 440 | //updte start offset (@@todo should probably happen somewhere else like in getDuration() ) |
441 | | - if(!this.cur_clip.embed.start_offset) |
| 441 | + if(typeof this.cur_clip.embed.start_offset=='undefined') |
442 | 442 | this.cur_clip.embed.start_offset=this.cur_clip.embed.media_element.selected_source.start_offset; |
443 | 443 | |
444 | 444 | //render effects ontop: |
445 | | - //issue thumbnail update request: (if plugin supports it will render out frame (if media ) |
| 445 | + //issue thumbnail update request: (if plugin supports it will render out frame |
| 446 | + // if not then we do a call to the server to get a new thumbnail |
446 | 447 | this.cur_clip.embed.updateTimeThumb(perc); |
447 | 448 | |
448 | 449 | this.cur_clip.embed.currentTime = (float_sec -pl_sum_time)+this.cur_clip.embed.start_offset ; |
— | — | @@ -1682,12 +1683,12 @@ |
1683 | 1684 | $j.each(seq_tags, function(i,seq_elm){ |
1684 | 1685 | var inx = 0; |
1685 | 1686 | //get all the clips for the given seq: |
1686 | | - $j.each(seq_elm.childNodes, function(i, mediaElemnt){ |
| 1687 | + $j.each(seq_elm.childNodes, function(i, mediaElement){ |
1687 | 1688 | //~complex~ have to hannlde a lot like "switch" "region" etc |
1688 | 1689 | //js_log('proccess: ' + mediaElemnt.tagName); |
1689 | | - if(typeof mediaElemnt.tagName!='undefined'){ |
| 1690 | + if(typeof mediaElement.tagName!='undefined'){ |
1690 | 1691 | //set up basic mvSMILClip send it the mediaElemnt & mvClip init: |
1691 | | - var cur_clip = new mvSMILClip(mediaElemnt, |
| 1692 | + var cur_clip = new mvSMILClip(mediaElement, |
1692 | 1693 | { |
1693 | 1694 | id:'p_' + _this.id + '_c_'+inx, |
1694 | 1695 | pp:_this, |
— | — | @@ -1715,6 +1716,7 @@ |
1716 | 1717 | return this.init(smil_clip_element, mvClipInit); |
1717 | 1718 | } |
1718 | 1719 | //http://www.w3.org/TR/2007/WD-SMIL3-20070713/smil-extended-media-object.html#smilMediaNS-BasicMedia |
| 1720 | +//and some resource description elements |
1719 | 1721 | var mv_supported_media_attr = new Array( |
1720 | 1722 | 'src', |
1721 | 1723 | 'type', |
— | — | @@ -1722,7 +1724,10 @@ |
1723 | 1725 | 'transIn', |
1724 | 1726 | 'transOut', |
1725 | 1727 | 'fill', |
1726 | | - 'dur' |
| 1728 | + 'dur', |
| 1729 | + |
| 1730 | + 'uri', |
| 1731 | + 'poster' |
1727 | 1732 | ); |
1728 | 1733 | //all the overwritten and new methods for playlist extension of mv_embed |
1729 | 1734 | mvSMILClip.prototype = { |
— | — | @@ -1749,7 +1754,11 @@ |
1750 | 1755 | } |
1751 | 1756 | }) |
1752 | 1757 | this['tagName'] =smil_clip_element.tagName; |
1753 | | - |
| 1758 | + if( smil_clip_element.firstChild ){ |
| 1759 | + this['wholeText']=smil_clip_element.firstChild.wholeText; |
| 1760 | + js_log("SET wholeText: "+ this['wholeText']); |
| 1761 | + } |
| 1762 | + //debugger; |
1754 | 1763 | //mv_embed specific property: |
1755 | 1764 | if(smil_clip_element.hasAttribute('poster')) |
1756 | 1765 | this['img'] = smil_clip_element.getAttribute('poster'); |
— | — | @@ -1789,10 +1798,20 @@ |
1790 | 1799 | if(this['type']){ |
1791 | 1800 | switch(this['type']){ |
1792 | 1801 | case 'text/html': |
1793 | | - this.embed = new htmlEmbedWrapper({pc:this}); |
| 1802 | + case 'image/jpeg': |
| 1803 | + this.embed = new htmlEmbedWrapper({pc:this, id:'e_'+this.id}); |
1794 | 1804 | break; |
| 1805 | + case 'application/ogg': |
| 1806 | + case 'video/ogg': |
| 1807 | + this['type']='video/ogg'; //conform to 'video/ogg' type |
| 1808 | + this.parent_setUpEmbedObj(); |
| 1809 | + break; |
1795 | 1810 | } |
1796 | 1811 | } |
| 1812 | + //if we got embed we are done: |
| 1813 | + if(this.embed) |
| 1814 | + return ; |
| 1815 | + //guess by less reliable tagName: |
1797 | 1816 | if(this.tagName=='video') |
1798 | 1817 | return this.parent_setUpEmbedObj(); |
1799 | 1818 | |
— | — | @@ -1802,16 +1821,67 @@ |
1803 | 1822 | * grabs settings from parent clip |
1804 | 1823 | */ |
1805 | 1824 | var htmlEmbedWrapper=function(init){ |
1806 | | - return this.init(init); |
| 1825 | + ve = document.createElement('div'); |
| 1826 | + //extend ve with all this |
| 1827 | + this.init(init); |
| 1828 | + for(method in this){ |
| 1829 | + if(method!='readyState' && method!='style'){ |
| 1830 | + ve[method]= this[method]; |
| 1831 | + } |
| 1832 | + } |
| 1833 | + return ve; |
1807 | 1834 | } |
1808 | 1835 | var pcHtmlEmbedDefaults={ |
1809 | 1836 | 'dur':4 //default duration of 4seconds |
1810 | 1837 | } |
1811 | 1838 | htmlEmbedWrapper.prototype={ |
| 1839 | + supports: { |
| 1840 | + 'play_head':true, |
| 1841 | + 'play_or_pause':true, |
| 1842 | + 'fullscreen':false, |
| 1843 | + 'time_display':true, |
| 1844 | + 'volume_control':true, |
| 1845 | + |
| 1846 | + 'overlays':true, |
| 1847 | + 'playlist_swap_loader':true //if the object supports playlist functions |
| 1848 | + }, |
| 1849 | + start_offset:0, |
1812 | 1850 | init:function(init){ |
1813 | 1851 | js_log('htmlEmbedWrapper'); |
1814 | 1852 | if(init['pc']){ |
1815 | 1853 | this['pc'] = init['pc']; |
| 1854 | + } |
| 1855 | + ve = document.createElement('div'); |
| 1856 | + for(i in init){ |
| 1857 | + //set the parent clip pointer: |
| 1858 | + if(i=='pc'){ |
| 1859 | + this['pc']=init['pc']; |
| 1860 | + }else{ |
| 1861 | + ve.setAttribute(i,init[i]); |
| 1862 | + } |
| 1863 | + } |
| 1864 | + var videoInterface = new embedVideo(ve); |
| 1865 | + //inherit the base embed properties: |
| 1866 | + for( var i in videoInterface){ |
| 1867 | + if(typeof this[i] == 'undefined'){ |
| 1868 | + this[i]=videoInterface[i]; |
| 1869 | + }else{ |
| 1870 | + this['parent_'+i]=videoInterface[i]; |
| 1871 | + } |
| 1872 | + } |
| 1873 | + }, |
| 1874 | + //nothing to update in static html display: |
| 1875 | + updateTimeThumb:function(){ |
| 1876 | + return ; |
| 1877 | + }, |
| 1878 | + getHTML:function(){ |
| 1879 | + //set up the css for our parent div: |
| 1880 | + $j(this).css({'width':this.pc.pp.width, 'height':this.pc.pp.height, 'overflow':"hidden"}); |
| 1881 | + //@@todo support more smil stuff: |
| 1882 | + if( this.pc.type =='image/jpeg'){ |
| 1883 | + $j(this).html('<img src="'+this.pc.src+'">'); |
| 1884 | + }else{ |
| 1885 | + $j(this).html(this.pc.wholeText); |
1816 | 1886 | } |
1817 | 1887 | }, |
1818 | 1888 | getDuration:function(){ |
— | — | @@ -1819,20 +1889,15 @@ |
1820 | 1890 | return this.pc.dur; |
1821 | 1891 | //no dur use default: |
1822 | 1892 | return pcHtmlEmbedDefaults.dur; |
| 1893 | + }, |
| 1894 | + //gives a chance to make any nesseary external requests |
| 1895 | + //@@todo we can "start loading images" if we want |
| 1896 | + on_dom_swap:function(){ |
| 1897 | + this.loading_external_data=false |
| 1898 | + this.ready_to_play=true; |
| 1899 | + return ; |
1823 | 1900 | } |
1824 | 1901 | } |
1825 | | -/* |
1826 | | -* ImgWrapperEmbed extends htmlEmbedWrapper and but displays an image |
1827 | | -*/ |
1828 | | -var imgEmbedWrapper=function(img_init){ |
1829 | | - return this.init; |
1830 | | -} |
1831 | | -//all the overwritten and new methods for playlist extension of mv_embed |
1832 | | -imgEmbedWrapper.prototype = { |
1833 | | - init:function(){ |
1834 | | - js_log("imgWrapperEmbed init"); |
1835 | | - } |
1836 | | -} |
1837 | 1902 | var mv_supported_transition_attr = new Array( |
1838 | 1903 | 'id', |
1839 | 1904 | 'type', |
— | — | @@ -1974,7 +2039,7 @@ |
1975 | 2040 | js_log('ignored pos: '+ pos); |
1976 | 2041 | //for now just add to the end: |
1977 | 2042 | this.clips.push(clipObj); |
1978 | | - js_log('addClip cur_clip len:'+ clipObj.embed.media_element.sources.length); |
| 2043 | + //js_log('addClip cur_clip len:'+ clipObj.embed.media_element.sources.length); |
1979 | 2044 | }, |
1980 | 2045 | getClipCount:function(){ |
1981 | 2046 | return this.clips.length; |
— | — | @@ -2041,4 +2106,4 @@ |
2042 | 2107 | newString = newString.replace (myRegExp, '&' + entities[i] + ';'); |
2043 | 2108 | } |
2044 | 2109 | return newString; |
2045 | | -} |
| 2110 | +} |
\ No newline at end of file |