// 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" );
var kplayerEmbed = {
- instanceOf:'kflashEmbed',
+ instanceOf:'kplayerEmbed',
supports: {
'play_head':true,
'pause':true,
},
getEmbedHTML : function () {
var embed_code = this.getEmbedObj();
+ alert
var _this = this;
setTimeout(function(){
_this.postEmbedJS();
},
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");
_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
*
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 );
/**
* 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),
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
*/
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;
+}
+
+
+
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;