r37547 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37546‎ | r37547 | r37548 >
Date:04:04, 11 July 2008
Author:stipe
Status:old
Tags:
Comment:
basic flowplayer javascript implemented
Modified paths:
  • /branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/FlowPlayerDark.swf (modified) (history)
  • /branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_flashEmbed.js (modified) (history)

Diff [purge]

Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/FlowPlayerDark.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_flashEmbed.js
@@ -5,14 +5,17 @@
66 var controls_html ='';
77 js_log('embedObj control is: '+this.controls);
88 if(this.controls){
9 - controls_html+= this.getControlsHtml('stop');
 9+ controls_html+= this.getControlsHtml('play_head') +
 10+ this.getControlsHtml('play_or_pause') +
 11+ this.getControlsHtml('stop') +
 12+ this.getControlsHtml('info_span');
1013 }
1114 setTimeout('document.getElementById(\''+this.id+'\').postEmbedJS()', 150);
1215 return this.wrapEmebedContainer( this.getEmbedObj() )+ controls_html;
1316 },
1417 getEmbedObj:function(){
1518 if(!this.duration)this.duration=30;
16 - return '<div id="FlowPlayerAnnotationHolder"></div>'+"\n";
 19+ return '<div id="FlowPlayerAnnotationHolder_'+this.pid+'"></div>'+"\n";
1720 },
1821 postEmbedJS : function()
1922 {
@@ -24,9 +27,84 @@
2528 },
2629 doFlashEmbed : function()
2730 {
28 - new flashembed("FlowPlayerAnnotationHolder",
29 - { src: mv_embed_path + 'FlowPlayerDark.swf', width: this.width, height: this.height, id: this.pid },
 31+ var clip = flashembed('FlowPlayerAnnotationHolder_'+this.pid,
 32+ { src: mv_embed_path + 'FlowPlayerDark.swf', width: this.width, height: this.height, id: this.pid},
3033 { config: { autoPlay: true, showStopButton: false, showPlayButton: false,
3134 videoFile: this.media_element.selected_source.uri } });
 35+ },
 36+ /* js hooks/controls */
 37+ play : function(){
 38+ if(this.thumbnail_disp)
 39+ {
 40+ //call the parent
 41+ this.parent_play();
 42+ }else{
 43+ this.getPluginEmbed().DoPlay();
 44+ this.paused=false;
 45+ }
 46+ },
 47+ pause : function(){
 48+ this.getPluginEmbed().Pause();
3249 }
3350 }
 51+
 52+function locateFlashEmbed(clip)
 53+{
 54+ for(var i in global_ogg_list)
 55+ {
 56+ var embed = document.getElementById(global_ogg_list[i]);
 57+ if(embed.media_element.selected_source.uri.match(clip.fileName))
 58+ {
 59+ js_log('found flash embed');
 60+ return embed;
 61+ }
 62+ }
 63+}
 64+
 65+/* flowplayer callbacks */
 66+function onFlowPlayerReady()
 67+{
 68+ js_log('onFlowPlayerReady');
 69+}
 70+
 71+function onClipDone(clip)
 72+{
 73+ var embed = locateFlashEmbed(clip);
 74+ embed.setStatus("Clip Done...");
 75+}
 76+
 77+function onLoadBegin(clip)
 78+{
 79+ var embed = locateFlashEmbed(clip);
 80+ embed.setStatus("Loading Begun...");
 81+}
 82+
 83+function onPlay(clip)
 84+{
 85+ var embed = locateFlashEmbed(clip);
 86+ embed.setStatus("Playing...");
 87+}
 88+
 89+function onStop(clip)
 90+{
 91+ var embed = locateFlashEmbed(clip);
 92+ embed.setStatus("Stopped...");
 93+}
 94+
 95+function onPause(clip)
 96+{
 97+ var embed = locateFlashEmbed(clip);
 98+ embed.setStatus("Paused...");
 99+}
 100+
 101+function onResume(clip)
 102+{
 103+ var embed = locateFlashEmbed(clip);
 104+ embed.setStatus("Resumed...");
 105+}
 106+
 107+function onStartBuffering(clip)
 108+{
 109+ var embed = locateFlashEmbed(clip);
 110+ embed.setStatus("Buffering Started...");
 111+}

Status & tagging log