* some kplayer updates
authorMichael Dale <dale@users.mediawiki.org>
Tue, 17 Nov 2009 16:33:59 +0000 (16:33 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Tue, 17 Nov 2009 16:33:59 +0000 (16:33 +0000)
* fix to the menu

js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/libEmbedVideo/kplayerEmbed.js
js2/mwEmbed/libEmbedVideo/vlcEmbed.js
js2/mwEmbed/mv_embed.js
js2/mwEmbed/skins/mvpcf/playerSkin.css
js2/mwEmbed/skins/mvpcf/styles.css

index 42caf4a..12b88f9 100644 (file)
@@ -1844,15 +1844,12 @@ embedVideo.prototype = {
                // fade in a black bg div ontop of everything
                 var div_code = '<div id="blackbg_' + sel_id + '" class="videoComplete" ' +
                         'style="height:' + parseInt( height ) + 'px;width:' + parseInt( width ) + 'px;">' +
-                         '<div class="videoOptionsComplete">' +
-                       // @@TODO: this style should go to .css
-                       '<span style="float:right;margin-right:10px">' +
-                                       '<a href="#" style="color:white;" onClick="$j(\'#' + sel_id + '\').get(0).closeDisplayedHTML();return false;">close</a>' +
+                               '<span style="float:right;margin-right:10px">' +
+                               '<a href="#" style="color:white;" onClick="$j(\'#' + sel_id + '\').get(0).closeDisplayedHTML();return false;">close</a>' +
                        '</span>' +
-                       '<div id="mv_disp_inner_' + sel_id + '" style="padding-top:10px;">' +
-                                html_code
-                          + '</div>' +
-                          '</div></div>';
+                         '<div class="videoOptionsComplete">' +                                        
+                          '</div>'+
+                        '</div>';              
                $j( '#' + sel_id ).prepend( div_code );
                if ( fade_in )
                        $j( '#blackbg_' + sel_id ).fadeIn( "slow" );
index 9cdef6a..f3c81a1 100644 (file)
@@ -1,5 +1,5 @@
 var kplayerEmbed = {
-       instanceOf:'kflashEmbed',
+       instanceOf:'kplayerEmbed',
        supports: {
                'play_head':true,
                'pause':true,
@@ -11,6 +11,7 @@ var kplayerEmbed = {
        },
        getEmbedHTML : function () {
                var embed_code =  this.getEmbedObj();
+               alert
                var _this = this;
                setTimeout(function(){
                        _this.postEmbedJS();
@@ -41,9 +42,9 @@ var kplayerEmbed = {
        },
        postEmbedJS:function() {
                var _this = this;
-               this.getKDP();          
+               this.getKDP();  
+               //alert(        this.kdp );
                if( this.kdp && this.kdp.insertMedia){
-               
                        // Add KDP listeners
                        
                        //this.kdp.addJsListener("doPlay","kdpDoOnPlay");
@@ -52,20 +53,24 @@ var kplayerEmbed = {
                                                
                        _this.bindKdpFunc( 'doPause', 'kdpPause' );
                        _this.bindKdpFunc( 'doPlay', 'play' );
-                       _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' );                                                                     
-               
-                       // Insert the src:
-                       this.kdp.insertMedia("-1",'http://192.168.192.90/kskin/kplayer-examples/media/bbb.flv','true');                 
+                       _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' );
+                                               
+                       // KDP player likes an absolute url for the src:
+                       var src = mw.absoluteUrl( _this.getSrc() );
+                       js_log('play src: ' + src);
+                       // Insert the src:      
+                       this.kdp.insertMedia("-1", src, 'true' );                       
                        this.kdp.dispatchKdpEvent('doPlay');
                        
                        // Start the monitor
                        this.monitor();
                }else{
+                       js_log('insert media: not defiend' + typeof this.kdp.insertMedia );
                        setTimeout( function(){
                                _this.postEmbedJS();
                        }, 25);
                }               
-       },
+       },      
        /**
        * bindKdpFunc
        * 
index 41872a0..af20394 100644 (file)
@@ -60,9 +60,10 @@ var vlcEmbed = {
                        this.vlc.style.width = this.width;
                        this.vlc.style.height = this.height;
                        this.vlc.playlist.items.clear();
+                       var src = mw.absoluteUrl( this.getSrc() ) ;
                        // @@todo if client supports seeking no need to send seek_offset to URI
-                       js_log( 'vlc play::' + this.getSrc() );
-                       var itemId = this.vlc.playlist.add( this.getSrc() );
+                       js_log( 'vlc play::' + src );
+                       var itemId = this.vlc.playlist.add( src );
                        if ( itemId != -1 ) {
                                // play
                                this.vlc.playlist.playItem( itemId );
index f1c9823..2a2aaf2 100644 (file)
@@ -785,11 +785,14 @@ var global_req_cb = new Array(); // The global request callback array
        
        /**
        * Utility Functions
-       * 
+       */
+               
+       
+       /**
        * parseUri 1.2.2
        * (c) Steven Levithan <stevenlevithan.com>
        *  MIT License
-       */      
+       */              
        $.parseUri = function (str) {
                var     o   = $.parseUri.options,
                        m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
@@ -817,6 +820,25 @@ var global_req_cb = new Array(); // The global request callback array
                        loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
                }
        };      
+       
+       /*
+       * getAbsoluteUrl takes a src and returns the aboluste location given the document.URL
+       * @param {String} src path or url
+       */
+       $.absoluteUrl = function( src ){
+               var pSrc =  mw.parseUri( src );
+               if( pSrc.protocol != '')
+                       return src;                             
+               
+               // Get  the document path               
+               var pDoc = mw.parseUri( document.URL );
+               // If a leading slash:  
+               if( src.indexOf( '/' ) == 1 ){
+                       return pDoc.protocol + '://' + pDoc.authority + src;
+               }else{
+                       return pDoc.protocol + '://' + pDoc.authority + pDoc.directory + src;
+               }
+       };
        /**
        * Takes in a string returns an xml dom object 
        */
index 1a51a1c..dcba3cb 100644 (file)
        color:#FFE96E;
        font-weight:bold;
 }
+
+.videoComplete{
+       position: absolute;
+       top:0px;
+       left:0px;
+       z-index: 10;
+       font-size:16px;
+       overflow: hidden;
+       background:transparent url(images/transparent_bg.png) repeat scroll 0 0;
+}
+.videoComplete .videoOptionsComplete {
+       background:transparent url('images/player_video_options_bg.png') no-repeat scroll 0pt;
+       color:#7A7A7A;
+       font-size:10pt;
+       height:158px;
+       left:10%;
+       overflow:auto;
+       padding:19px;
+       position:relative;
+       top:16%;
+       width:283px;
+}
+.videoComplete .videoOptionsComplete p { text-align: center; margin: 3px 0; padding: 0; }
+.videoComplete .videoOptionsComplete a {
+       color: white;
+/*     font-size: 22px;*/
+       font-size:12px;
+       text-decoration: underline;
+}
+.videoComplete .videoOptionsComplete a.active{
+       color: #bbf;
+}
+.videoComplete .videoOptionsComplete a.email {
+       font-size:16px;
+       background: url(images/ico_mail.png) right 0px no-repeat; 
+       padding: 0 50px 0 0;
+}
+
+.videoComplete div.embed_code textarea {
+       margin: 8px 0 8px 0;
+       padding: 3px;
+       width: 258px;
+       height: 54px;
+       border: 1px solid #dadada;
+       font-family: Arial;
+       color: #777;
+       font-size: 11px;
+}
+.videoComplete div.embed_code button.copy_to_clipboard {
+       background: #dddddd url(images/button_to_clipboard.png) 0 0 repeat-x;
+       border: 1px solid #3b4552;
+       text-align: center;
+       padding: 2px 4px;
+       margin: 0 0 6px 0;
+       float: right;
+       display: inline;
+}
+
+
+
index 4c8b402..43c58eb 100644 (file)
@@ -280,64 +280,8 @@ div.floatleft, table.floatleft {
        margin: 0 0 6px 0;
 }
 
-.videoComplete {
-/*     width: 100%;
-       height: 100%;*/
-       background: url(images/transparent_bg.png) 0 0 repeat;
-       position: absolute;
-       top:0px;
-       left:0px;
-       z-index: 10;
-       font-size:16px;
-       overflow: hidden;
-}
 
-/*     margin: -305px 0 0 0; */
-.videoComplete .videoOptionsComplete {
-       background:transparent url('images/player_video_options_bg.png') no-repeat scroll 0pt;
-       color:#7A7A7A;
-       font-size:10pt;
-       height:158px;
-       left:10%;
-       overflow:auto;
-       padding:19px;
-       position:relative;
-       top:16%;
-       width:283px;
-}
-.videoComplete .videoOptionsComplete p { text-align: center; margin: 3px 0; padding: 0; }
-.videoComplete .videoOptionsComplete a {
-       color: white;
-/*     font-size: 22px;*/
-       font-size:12px;
-       text-decoration: underline;
-}
-
-.videoComplete .videoOptionsComplete a.email {
-       font-size:16px;
-       background: url(images/ico_mail.png) right 0px no-repeat; 
-       padding: 0 50px 0 0;
-}
 
-.videoComplete div.embed_code textarea {
-       margin: 8px 0 8px 0;
-       padding: 3px;
-       width: 258px;
-       height: 54px;
-       border: 1px solid #dadada;
-       font-family: Arial;
-       color: #777;
-       font-size: 11px;
-}
-.videoComplete div.embed_code button.copy_to_clipboard {
-       background: #dddddd url(images/button_to_clipboard.png) 0 0 repeat-x;
-       border: 1px solid #3b4552;
-       text-align: center;
-       padding: 2px 4px;
-       margin: 0 0 6px 0;
-       float: right;
-       display: inline;
-}
 .cl_status{
        position:absolute; 
        bottom:0px;