Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php |
— | — | @@ -52,6 +52,33 @@ |
53 | 53 | $text = preg_replace( '/xx-marker' . $i . '-xx/', $markerList[$i], $text ); |
54 | 54 | return true; |
55 | 55 | } |
| 56 | + |
| 57 | +/* |
| 58 | + * hack to embed embedStream:StreamName links |
| 59 | +*/ |
| 60 | + function mvLinkEnd($skin, $title, $options, &$text, &$attribs, &$ret){ |
| 61 | + global $mvEmbedKey, $mvDefaultAspectRatio,$mvDefaultVideoPlaybackRes; |
| 62 | + if( substr( $title->getText(), 0, strlen($mvEmbedKey) )==$mvEmbedKey){ |
| 63 | + //parse text for extra params: |
| 64 | + $params = explode('|', $text); |
| 65 | + //set up defaults: |
| 66 | + $size = $mvDefaultVideoPlaybackRes; |
| 67 | + |
| 68 | + foreach($params as $param_set){ |
| 69 | + if(strpos($param_set, '=')!==false){ |
| 70 | + list($k, $v)= explode('=',$param_set); |
| 71 | + if($k=='width'){ |
| 72 | + $size = intval($v) . 'x' . ($mvDefaultAspectRatio * intval($v)); |
| 73 | + } |
| 74 | + } |
| 75 | + } |
| 76 | + $mvTitle = new MV_Title( substr( $title->getText(), strlen($mvEmbedKey)+1) ); |
| 77 | + $ret = $mvTitle->getEmbedVideoHtml('',$size); |
| 78 | + return false; |
| 79 | + } |
| 80 | + return true; |
| 81 | + } |
| 82 | + |
56 | 83 | // load the sequence page |
57 | 84 | function mvSeqTag( &$input, &$argv, &$parser ) { |
58 | 85 | global $wgTitle; |
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -178,6 +178,10 @@ |
179 | 179 | |
180 | 180 | $wgHooks['TitleMoveComplete'][] = 'mvMoveHook'; |
181 | 181 | |
| 182 | + |
| 183 | + $wgHooks['LinkEnd'][] = 'mvLinkEnd'; |
| 184 | + |
| 185 | + |
182 | 186 | // @@NOTE this hook is not avaliable by default in medaiwiki |
183 | 187 | // to use this hook you should add this function to moveTo() in Title.php: |
184 | 188 | /* |
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php |
— | — | @@ -124,6 +124,9 @@ |
125 | 125 | $mvDefaultSearchVideoPlaybackRes = '320x240'; |
126 | 126 | $mvDefaultVideoIconSize = '80x60'; |
127 | 127 | |
| 128 | +//The text Embed a metavid Stream inline in the wiki |
| 129 | +$mvEmbedKey = 'EmbedStream'; |
| 130 | + |
128 | 131 | /* |
129 | 132 | * All Available meta data layers |
130 | 133 | * these type keys are used to allow multiple layers of metadata per stream. |
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | $this->resolveHLRD(); |
61 | 61 | |
62 | 62 | //print "the final xml:\n"; |
63 | | - print $this->getSmilXml(); |
| 63 | + //print $this->getSmilXml(); |
64 | 64 | //die; |
65 | 65 | |
66 | 66 | //get parser Output Object (maybe cleaner way to do this? |