From: Michael Dale Date: Tue, 17 Nov 2009 16:33:59 +0000 (+0000) Subject: * some kplayer updates X-Git-Tag: 1.31.0-rc.0~38773 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=b1bf7f46a9a60c1e80c8962de57817cd109fc945;p=lhc%2Fweb%2Fwiklou.git * some kplayer updates * fix to the menu --- diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 42caf4a516..12b88f9492 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -1844,15 +1844,12 @@ embedVideo.prototype = { // fade in a black bg div ontop of everything var div_code = '
' + - '
' + - // @@TODO: this style should go to .css - '' + - 'close' + + '' + + 'close' + '' + - '
' + - html_code - + '
' + - '
'; + '
' + + '
'+ + ''; $j( '#' + sel_id ).prepend( div_code ); if ( fade_in ) $j( '#blackbg_' + sel_id ).fadeIn( "slow" ); diff --git a/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js b/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js index 9cdef6a2c5..f3c81a11bc 100644 --- a/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js +++ b/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js @@ -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 * diff --git a/js2/mwEmbed/libEmbedVideo/vlcEmbed.js b/js2/mwEmbed/libEmbedVideo/vlcEmbed.js index 41872a01e9..af20394123 100644 --- a/js2/mwEmbed/libEmbedVideo/vlcEmbed.js +++ b/js2/mwEmbed/libEmbedVideo/vlcEmbed.js @@ -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 ); diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index f1c98238d4..2a2aaf265a 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -785,11 +785,14 @@ var global_req_cb = new Array(); // The global request callback array /** * Utility Functions - * + */ + + + /** * parseUri 1.2.2 * (c) Steven Levithan * 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 */ diff --git a/js2/mwEmbed/skins/mvpcf/playerSkin.css b/js2/mwEmbed/skins/mvpcf/playerSkin.css index 1a51a1c64c..dcba3cbe5a 100644 --- a/js2/mwEmbed/skins/mvpcf/playerSkin.css +++ b/js2/mwEmbed/skins/mvpcf/playerSkin.css @@ -199,3 +199,63 @@ 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; +} + + + diff --git a/js2/mwEmbed/skins/mvpcf/styles.css b/js2/mwEmbed/skins/mvpcf/styles.css index 4c8b402dbd..43c58eb3c9 100644 --- a/js2/mwEmbed/skins/mvpcf/styles.css +++ b/js2/mwEmbed/skins/mvpcf/styles.css @@ -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;