Index: trunk/phase3/js2/mwEmbed/example_usage/Sequence_Render.html |
— | — | @@ -0,0 +1,68 @@ |
| 2 | +<!doctype html> |
| 3 | +<html> |
| 4 | +<head> |
| 5 | + <title>Seeking Render Example</title> |
| 6 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
| 7 | + <style> |
| 8 | + #render_box { |
| 9 | + position:absolute; |
| 10 | + width:320px; |
| 11 | + height:240px; |
| 12 | + } |
| 13 | + |
| 14 | + </style> |
| 15 | + <script> |
| 16 | +mwAddOnloadHook(function(){ |
| 17 | + |
| 18 | + $j('#render_player').firefoggRender({ |
| 19 | + 'render_options':{ |
| 20 | + "framerate" : 30 |
| 21 | + }, |
| 22 | + 'target_startRender':'#buttonStart', |
| 23 | + 'target_stopRender': '#buttonStop', |
| 24 | + 'target_timeStatus': '#time_status' |
| 25 | + |
| 26 | + },function( foggRender ){ |
| 27 | + $j('#loading_text').hide(); |
| 28 | + if( foggRender.enabled ){ |
| 29 | + $j('#info_control').show(); |
| 30 | + }else{ |
| 31 | + $j('#info_control').html( |
| 32 | + foggRender.myFogg.getTargetHtml('target_please_install') |
| 33 | + ); |
| 34 | + if(!($j.browser.mozilla && $j.browser.version >= '1.9.1')) { |
| 35 | + $j('#info_control').html( |
| 36 | + foggRender.myFogg.getTargetHtml('target_use_latest_fox') |
| 37 | + ); |
| 38 | + } |
| 39 | + } |
| 40 | + }); |
| 41 | + |
| 42 | +}); |
| 43 | + </script> |
| 44 | +</head> |
| 45 | +<body> |
| 46 | +<playlist id="render_player" src="media/sample_smil.xml" controls="false" width="320" height="240"></playlist> |
| 47 | + |
| 48 | +<!-- <video id="render_player" |
| 49 | + durationHint="27" |
| 50 | + src="http://upload.wikimedia.org/wikipedia/commons/4/41/Panthera_tigris8.ogg" |
| 51 | + style="width:320px;height:240px;" |
| 52 | + controls="false" |
| 53 | + poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Panthera_tigris8.ogg/mid-Panthera_tigris8.ogg.jpg"> |
| 54 | +</video> |
| 55 | +--> |
| 56 | + |
| 57 | + |
| 58 | +<span id="loading_text" style="position:absolute; top:320px;"> |
| 59 | +loading render system <blink>...</blink> |
| 60 | +</span> |
| 61 | +<div id="info_control" style="display:none;"> |
| 62 | + <button id="buttonStart">Do Render</button> |
| 63 | + <button id="buttonStop">Stop</button> |
| 64 | + Current Time: <input type="text" id="time_status" value="0.0" /> |
| 65 | + <span id="status"></span><br> |
| 66 | +</div> |
| 67 | + |
| 68 | +</body> |
| 69 | +</html> |
Index: trunk/phase3/js2/mwEmbed/binPlayers/kaltura-player/kdp.swf |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/js2/mwEmbed/binPlayers/kaltura-player/kdp.swf |
___________________________________________________________________ |
Name: svn:mime-type |
1 | 70 | + application/octet-stream |
Name: svn:executable |
2 | 71 | + * |
Index: trunk/phase3/js2/mwEmbed/binPlayers/kaltura-player/README |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +This Kaltura Dynamic Player +Playlist (KDP) is a sub package of the taken Kaltura Community Edition (CE) Built from Kaltura.org source. |
| 3 | + |
| 4 | +The full Kaltura Community Edition is licensed under the (GNU Affero General Public License v3) |
| 5 | + |
| 6 | +And the source code is available on the kaltura.org site: |
| 7 | +http://www.kaltura.org/project/kalturaCE |
| 8 | + |
| 9 | +More info about the KDP: |
| 10 | +http://www.kaltura.org/kdp-dynamic-player-and-playlist-widget |
| 11 | + |
| 12 | + |
Index: trunk/phase3/js2/mwEmbed/binPlayers/kaltura-player/wrapper.swf |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/js2/mwEmbed/binPlayers/kaltura-player/wrapper.swf |
___________________________________________________________________ |
Name: svn:mime-type |
1 | 13 | + application/octet-stream |
Name: svn:executable |
2 | 14 | + * |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -526,8 +526,8 @@ |
527 | 527 | * This is not feature complete but we need a way to get at template properties |
528 | 528 | * |
529 | 529 | * |
530 | | - * @param wikiText the wikitext to be parsed |
531 | | - * @return parserObj returns a parser object that has methods for getting at |
| 530 | + * @param {String} wikiText the wikitext to be parsed |
| 531 | + * @return {Object} parserObj returns a parser object that has methods for getting at |
532 | 532 | * things you would want |
533 | 533 | */ |
534 | 534 | $.parser = { }; |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/kplayerEmbed.js |
— | — | @@ -11,58 +11,119 @@ |
12 | 12 | }, |
13 | 13 | getEmbedHTML : function () { |
14 | 14 | var embed_code = this.getEmbedObj(); |
15 | | - // setTimeout('$j(\'#' + this.id + '\').get(0).postEmbedJS()', 2000); |
| 15 | + var _this = this; |
| 16 | + setTimeout(function(){ |
| 17 | + _this.postEmbedJS(); |
| 18 | + }, 50); |
16 | 19 | js_log( "return embed html" ); |
17 | 20 | return this.wrapEmebedContainer( embed_code ); |
18 | 21 | }, |
19 | | - getEmbedObj:function() { |
20 | | - var player_path = mv_embed_path + 'binPlayers/kaltura-player/player.swf'; |
21 | | - return '<object id="' + this.pid + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + |
22 | | - 'width="' + this.width + '" height="' + this.height + '">' + |
23 | | - '<param name="movie" value="' + player_path + '" />' + |
24 | | - '<param name="allowfullscreen" value="true" />' + |
25 | | - '<param name="allowscriptaccess" value="always" />' + |
26 | | - '<param name="flashvars" value="file=video.flv&image=preview.jpg" />' + |
27 | | - '<embed ' + |
28 | | - 'type="application/x-shockwave-flash" ' + |
29 | | - 'id="' + this.pid + '" ' + |
30 | | - 'src="' + player_path + '" ' + |
31 | | - 'width="' + this.width + '" ' + |
32 | | - 'height="' + this.height + '" ' + |
33 | | - 'allowscriptaccess="always" ' + |
34 | | - 'allowfullscreen="true" ' + |
35 | | - 'flashvars="autostart=true&file=' + escape( this.getSrc() ) + '" ' + |
36 | | - '/>' + |
37 | | - '</object>'; |
38 | | - /*return '<object id="'+this.pid+'" type="application/x-shockwave-flash"'+ |
39 | | - 'allowScriptAccess="always" allowNetworking="all" allowFullScreen="true" '+ |
40 | | - 'height="'+ parseInt(this.height) + '" ' + |
41 | | - 'width="' + parseInt(this.width) + '" ' + |
42 | | - 'data="http://www.kaltura.com/index.php/kwidget/wid/_309/uiconf_id/1000106">'+ |
43 | | - '<param name="allowScriptAccess" value="always"/>'+ |
44 | | - '<param name="allowNetworking" value="all"/>'+ |
45 | | - '<param name="allowFullScreen" value="true"/>'+ |
46 | | - '<param name="bgcolor" value="#000000"/>'+ |
47 | | - '<param name="movie" value="http://www.kaltura.com/index.php/kwidget/wid/_0/uiconf_id/1000106"/>'+ |
48 | | - '<param name="flashVars" value="emptyF=onKdpEmpty&readyF=onKdpReady&'+ |
49 | | - //set the url: |
50 | | - 'entryId=' + escape( this.getSrc() ) + '"/>'+ |
51 | | - '<param name="wmode" value="opaque"/>'+ |
52 | | - '</object>'; */ |
| 22 | + getEmbedObj:function() { |
| 23 | + var player_path = mv_embed_path + 'binPlayers/kaltura-player'; |
| 24 | + return '<object width="' + this.width + '" height="' + this.height + '" '+ |
| 25 | + 'data="' + player_path + '/wrapper.swf" allowfullscreen="true" '+ |
| 26 | + 'allownetworking="all" allowscriptaccess="always" '+ |
| 27 | + 'type="application/x-shockwave-flash" '+ |
| 28 | + 'id="' + this.pid + '" name="' + this.pid + '">'+ |
| 29 | + '<param value="always" name="allowScriptAccess"/>'+ |
| 30 | + '<param value="all" name="allowNetworking"/>'+ |
| 31 | + '<param value="true" name="allowFullScreen"/>'+ |
| 32 | + '<param value="#000000" name="bgcolor"/>'+ |
| 33 | + '<param value="wrapper.swf" name="movie"/>'+ |
| 34 | + '<param value="' + |
| 35 | + 'kdpUrl=' + player_path + '/kdp.swf' + |
| 36 | + '&ks=dummy&partner_id=0&subp_id=0' + |
| 37 | + '&uid=0&emptyF=onKdpEmpty&readyF=onKdpReady' + |
| 38 | + '" ' + |
| 39 | + 'name="flashVars"/>'+ |
| 40 | + '<param value="opaque" name="wmode"/>'+ |
| 41 | + '</object>'; |
53 | 42 | }, |
54 | 43 | postEmbedJS:function() { |
55 | | - this.monitor(); |
| 44 | + var _this = this; |
| 45 | + this.getKDP(); |
| 46 | + if( this.kdp && this.kdp.insertMedia){ |
| 47 | + |
| 48 | + // Add KDP listeners |
| 49 | + |
| 50 | + //this.kdp.addJsListener("doPlay","kdpDoOnPlay"); |
| 51 | + //this.kdp.addJsListener("doStop","kdpDoOnStop"); |
| 52 | + //myKdp.addJsListener("fastForward","kdpDoOnFF"); |
| 53 | + |
| 54 | + _this.bindKdpFunc( 'doPause', 'kdpPause' ); |
| 55 | + _this.bindKdpFunc( 'doPlay', 'play' ); |
| 56 | + _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' ); |
| 57 | + |
| 58 | + // Insert the src: |
| 59 | + this.kdp.insertMedia("-1",'http://192.168.192.90/kskin/kplayer-examples/media/bbb.flv','true'); |
| 60 | + this.kdp.dispatchKdpEvent('doPlay'); |
| 61 | + |
| 62 | + // Start the monitor |
| 63 | + this.monitor(); |
| 64 | + }else{ |
| 65 | + setTimeout( function(){ |
| 66 | + _this.postEmbedJS(); |
| 67 | + }, 25); |
| 68 | + } |
56 | 69 | }, |
| 70 | + /** |
| 71 | + * bindKdpFunc |
| 72 | + * |
| 73 | + * @param {String} flash binding name |
| 74 | + * @param {String} function callback name |
| 75 | + */ |
| 76 | + bindKdpFunc:function( bName, fName ){ |
| 77 | + var cbid = fName + '_cb_' + this.id.replace(' ', '_'); |
| 78 | + eval( 'window[ \'' + cbid +'\' ] = function(){$j(\'#' + this.id + '\').get(0).'+ fName +'();}' ); |
| 79 | + this.kdp.addJsListener( bName , cbid); |
| 80 | + }, |
| 81 | + kdpPause:function(){ |
| 82 | + this.parent_pause(); |
| 83 | + }, |
| 84 | + play:function() { |
| 85 | + if( this.kdp && this.kdp.dispatchKdpEvent ) |
| 86 | + this.kdp.dispatchKdpEvent('doPlay'); |
| 87 | + this.parent_play(); |
| 88 | + }, |
57 | 89 | pause:function() { |
58 | | - this.stop(); |
| 90 | + this.kdp.dispatchKdpEvent('doPause'); |
| 91 | + this.parent_pause(); |
59 | 92 | }, |
60 | | - monitor:function() { |
61 | | - // this.parent_monitor(); |
| 93 | + doSeek:function( prec ){ |
| 94 | + var _this = this; |
| 95 | + if( this.kdp ){ |
| 96 | + var seek_time = prec * this.getDuration(); |
| 97 | + this.kdp.dispatchKdpEvent('doSeek', seek_time); |
| 98 | + // Kdp is missing seek done callback |
| 99 | + setTimeout(function(){ |
| 100 | + _this.seeking= false; |
| 101 | + },500); |
| 102 | + } |
| 103 | + this.monitor(); |
| 104 | + }, |
| 105 | + updateVolumen:function( perc ) { |
| 106 | + if( this.kdp && this.kdp.dispatchKdpEvent ) |
| 107 | + this.kdp.dispatchKdpEvent('volumeChange', perc); |
| 108 | + }, |
| 109 | + monitor:function() { |
| 110 | + if( this.kdp && this.kdp.getMediaSeekTime ){ |
| 111 | + this.currentTime = this.kdp.getMediaSeekTime(); |
| 112 | + } |
| 113 | + this.parent_monitor(); |
| 114 | + }, |
| 115 | + // get the embed fla object |
| 116 | + getKDP: function () { |
| 117 | + this.kdp = document.getElementById( this.pid ); |
62 | 118 | } |
63 | 119 | } |
64 | 120 | |
| 121 | +function kdpDoOnPause( player ){ |
| 122 | + var cat = player |
| 123 | + debugger; |
| 124 | +} |
| 125 | + |
65 | 126 | function onKdpReady( playerId ) { |
66 | | - js_log( "IN THEORY PLAYER IS READY" ); |
| 127 | + js_log( "IN THEORY PLAYER IS READY:" + playerId); |
67 | 128 | /* |
68 | 129 | window.myKdp=get(playerId); |
69 | 130 | get("Player_State").innerHTML="<br> READY (Id=" + playerId + ")"; |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | "mwe-ogg-player-quicktime-activex" : "QuickTime ActiveX", |
43 | 43 | "mwe-ogg-player-cortado" : "Java Cortado", |
44 | 44 | "mwe-ogg-player-flowplayer" : "Flowplayer", |
| 45 | + "mwe-ogg-player-kplayer" : "Kaltura player", |
45 | 46 | "mwe-ogg-player-selected" : "(selected)", |
46 | 47 | "mwe-ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
47 | 48 | "mwe-generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1<\/b><br \/>Visit the <a href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback Methods<\/a> page to download a player.<br \/>", |
— | — | @@ -877,14 +878,9 @@ |
878 | 879 | this.duration = parseFloat( this.duration ); |
879 | 880 | js_log( "duration is: " + this.duration ); |
880 | 881 | |
881 | | - // Get defaults |
882 | | - var dwh = mw.conf['video_size'].split( 'x' ); |
883 | | - this.width = element.style.width ? element.style.width : dwh[0]; |
884 | | - if ( element.tagName == 'AUDIO' ) { |
885 | | - this.height = element.style.height ? element.style.height : 0; |
886 | | - } else { |
887 | | - this.height = element.style.height ? element.style.height : dwh[1]; |
888 | | - } |
| 882 | + |
| 883 | + this.setDimSize( element, 'width' ); |
| 884 | + this.setDimSize( element, 'height' ); |
889 | 885 | |
890 | 886 | // Set the plugin id |
891 | 887 | this.pid = 'pid_' + this.id; |
— | — | @@ -908,6 +904,17 @@ |
909 | 905 | // Load skin: |
910 | 906 | loadExternalCss( mv_embed_path + 'skins/' + this.skin_name + '/playerSkin.css' ); |
911 | 907 | }, |
| 908 | + // Function for set width height from attributes or by default value |
| 909 | + setDimSize:function( element, dim ){ |
| 910 | + var dcss = parseInt( $j(element).css( dim ).replace( 'px' , '' ) ); |
| 911 | + var dattr = parseInt( $j(element).attr( dim ) ); |
| 912 | + this[ dim ] = ( dcss )? dcss : dattr; |
| 913 | + if(!this[ dim ]){ |
| 914 | + // Grab width/height from default value |
| 915 | + var dwh = mw.conf['video_size'].split( 'x' ); |
| 916 | + this[ dim ] = ( dim == 'width' )? dwh[0] : dwh[1]; |
| 917 | + } |
| 918 | + }, |
912 | 919 | on_dom_swap: function() { |
913 | 920 | js_log( 'f:on_dom_swap' ); |
914 | 921 | // Process the provided ROE file... if we don't yet have sources |
— | — | @@ -2010,14 +2017,16 @@ |
2011 | 2018 | * must be overwritten by embed object to support this functionality. |
2012 | 2019 | */ |
2013 | 2020 | pause: function() { |
| 2021 | + var _this = this; |
2014 | 2022 | var eid = ( this.pc != null ) ? this.pc.pp.id:this.id; |
2015 | 2023 | // js_log('mv_embed:do pause'); |
2016 | 2024 | // (playing) do pause |
2017 | 2025 | this.paused = true; |
| 2026 | + var $pt = $j( '#' + eid); |
2018 | 2027 | // update the ctrl "paused state" |
2019 | | - $j( '#' + eid + ' .play-btn span' ).removeClass( 'ui-icon-pause' ).addClass( 'ui-icon-play' ); |
2020 | | - $j( '#' + eid + ' .play-btn' ).unbind().btnBind().click( function() { |
2021 | | - $j( '#' + eid ).get( 0 ).play(); |
| 2028 | + $pt.find('.play-btn span' ).removeClass( 'ui-icon-pause' ).addClass( 'ui-icon-play' ); |
| 2029 | + $pt.find('.play-btn' ).unbind().btnBind().click( function() { |
| 2030 | + _this.play(); |
2022 | 2031 | } ).attr( 'title', gM( 'mwe-play_clip' ) ); |
2023 | 2032 | }, |
2024 | 2033 | /** |
— | — | @@ -2337,8 +2346,8 @@ |
2338 | 2347 | /* players and supported mime types |
2339 | 2348 | @@note ideally we query the plugin to get what mime types it supports in practice not always reliable/avaliable |
2340 | 2349 | */ |
2341 | | -var flowPlayer = new mediaPlayer( 'flowplayer', ['video/x-flv', 'video/h264'], 'flowplayer' ); |
2342 | | -// var kplayer = new mediaPlayer('kplayer', ['video/x-flv', 'video/h264'], 'kplayer'); |
| 2350 | +//var flowPlayer = new mediaPlayer( 'flowplayer', ['video/x-flv', 'video/h264'], 'flowplayer' ); |
| 2351 | +var kplayer = new mediaPlayer('kplayer', ['video/x-flv', 'video/h264'], 'kplayer'); |
2343 | 2352 | |
2344 | 2353 | var omtkPlayer = new mediaPlayer( 'omtkplayer', ['audio/ogg'], 'omtk' ); |
2345 | 2354 | |
— | — | @@ -2377,8 +2386,8 @@ |
2378 | 2387 | this.loadPreferences(); |
2379 | 2388 | |
2380 | 2389 | // set up default players order for each library type |
2381 | | - this.default_players['video/x-flv'] = ['flowplayer', 'vlc']; |
2382 | | - this.default_players['video/h264'] = ['flowplayer', 'vlc']; |
| 2390 | + this.default_players['video/x-flv'] = ['kplayer', 'vlc']; |
| 2391 | + this.default_players['video/h264'] = ['kplayer', 'vlc']; |
2383 | 2392 | |
2384 | 2393 | this.default_players['video/ogg'] = ['native', 'vlc', 'java', 'generic']; |
2385 | 2394 | this.default_players['application/ogg'] = ['native', 'vlc', 'java', 'generic']; |
— | — | @@ -2560,8 +2569,8 @@ |
2561 | 2570 | // flowplayer has pretty good compatiablity |
2562 | 2571 | // (but if we wanted to be fancy we would check for version of flash and update the mp4/h.264 support |
2563 | 2572 | |
2564 | | - // this.players.addPlayer( kplayer ); |
2565 | | - this.players.addPlayer( flowPlayer ); |
| 2573 | + this.players.addPlayer( kplayer ); |
| 2574 | + //this.players.addPlayer( flowPlayer ); |
2566 | 2575 | } |
2567 | 2576 | // VLC |
2568 | 2577 | if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) ) |
— | — | @@ -2649,8 +2658,8 @@ |
2650 | 2659 | }*/ |
2651 | 2660 | if ( type == 'application/x-shockwave-flash' ) { |
2652 | 2661 | |
2653 | | - // this.players.addPlayer( kplayer ); |
2654 | | - this.players.addPlayer( flowPlayer ); |
| 2662 | + this.players.addPlayer( kplayer ); |
| 2663 | + //this.players.addPlayer( flowPlayer ); |
2655 | 2664 | |
2656 | 2665 | // check version to add omtk: |
2657 | 2666 | var flashDescription = navigator.plugins["Shockwave Flash"].description; |