Permalink
Browse files

merge with develop branch

  • Loading branch information...
1 parent 7810380 commit 48a812b68e8ca944752107781945da512ea7153a @ranyefet ranyefet committed Mar 19, 2012
Showing with 815 additions and 203 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 loader.js
  3. +4 −1 modules/AdSupport/mw.AdTimeline.js
  4. +15 −4 modules/AdSupport/mw.VastAdParser.js
  5. +8 −7 modules/DolStatistics/mw.DolStatistics.js
  6. +1 −0 modules/DolStatistics/tests/DOLStatisticsPlaylist.html
  7. +7 −1 modules/DoubleClick/mw.DoubleClick.js
  8. +7 −1 modules/EmbedPlayer/mw.EmbedPlayer.js
  9. +4 −5 modules/EmbedPlayer/mw.EmbedPlayerNative.js
  10. +1 −1 modules/EmbedPlayer/mw.IFramePlayerApiClient.js
  11. +7 −6 modules/EmbedPlayer/mw.MediaElement.js
  12. +1 −1 modules/EmbedPlayer/mw.MediaSource.js
  13. +12 −4 modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
  14. +4 −3 modules/KalturaSupport/KalturaResultObject.php
  15. +1 −1 modules/KalturaSupport/mw.KAds.js
  16. +15 −13 modules/KalturaSupport/mw.KDPMapping.js
  17. +1 −1 modules/KalturaSupport/mw.KTimedText.js
  18. +148 −6 modules/KalturaSupport/tests/AutoPlay.qunit.html
  19. +3 −0 modules/KalturaSupport/tests/Carousel.html
  20. +1 −0 modules/KalturaSupport/tests/CustomJQueryUiSkin.html
  21. +46 −41 modules/KalturaSupport/tests/PS/HBP/hbp.js
  22. +35 −97 modules/KalturaSupport/uiConfComponents/carouselPlugin.js
  23. +18 −9 modules/Playlist/mw.Playlist.js
  24. +1 −1 mwEmbed.js
  25. +68 −0 skins/common/mw.style.mwCommon.css
  26. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
  27. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
  28. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
  29. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
  30. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png
  31. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
  32. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
  33. BIN skins/jquery.ui.themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  34. BIN skins/jquery.ui.themes/smoothness/images/ui-icons_222222_256x240.png
  35. BIN skins/jquery.ui.themes/smoothness/images/ui-icons_2e83ff_256x240.png
  36. BIN skins/jquery.ui.themes/smoothness/images/ui-icons_454545_256x240.png
  37. BIN skins/jquery.ui.themes/smoothness/images/ui-icons_888888_256x240.png
  38. BIN skins/jquery.ui.themes/smoothness/images/ui-icons_cd0a0a_256x240.png
  39. +405 −0 skins/jquery.ui.themes/smoothness/jquery-ui-1.7.2.css
View
@@ -1,2 +1,3 @@
/LocalSettings.php
/cache
+/nbproject
View
@@ -133,6 +133,7 @@ mw.addResourcePaths( {
"mw.style.ui_start" : "skins/jquery.ui.themes/start/jquery-ui-1.7.2.css",
"mw.style.ui_sunny" : "skins/jquery.ui.themes/sunny/jquery-ui-1.7.2.css",
"mw.style.ui_kdark" : "skins/jquery.ui.themes/kaltura-dark/jquery-ui-1.7.2.css",
+ "mw.style.ui_smoothness" : "skins/jquery.ui.themes/smoothness/jquery-ui-1.7.2.css",
"mw.style.mwCommon" : "skins/common/mw.style.mwCommon.css",
@@ -180,9 +180,12 @@ mw.AdTimeline.prototype = {
// Restore the player if we played an ad:
_this.restorePlayer();
}
+ // Sync player size
+ embedPlayer.bindHelper('playing', function() {
+ embedPlayer.controlBuilder.syncPlayerSize();
+ });
// Trigger onplay ( even if there were no ads )
embedPlayer.triggerHelper( 'onplay' );
-
// Continue playback
embedPlayer.play();
},0);
View
@@ -78,10 +78,21 @@ mw.VastAdParser = {
}
if( type == 'video/h264' || type == 'video/ogg' || type == 'video/webm' ){
- currentAd.videoFiles.push({
- 'src' :_this.getURLFromNode( mediaFile ),
- 'type' : type
- });
+ var source = {
+ 'src' :_this.getURLFromNode( mediaFile ),
+ 'type' : type
+ };
+ if( $( mediaFile ).attr('bitrate') ){
+ source['data-bandwith'] = $( mediaFile ).attr('bitrate')* 1024;
+ }
+ if( $( mediaFile ).attr('width') ){
+ source['data-width'] = $( mediaFile ).attr('width');
+ }
+ if( $( mediaFile ).attr('height') ){
+ source['data-height'] = $( mediaFile ).attr('height');
+ }
+ // Add the source object:
+ currentAd.videoFiles.push( source );
mw.log( "VastAdParser::add MediaFile:" + currentAd.videoFile );
}
});
View
@@ -65,11 +65,16 @@ mw.DolStatistics.prototype = {
});
// On change media remove any existing bindings:
- embedPlayer.bindHelper( 'onChangeMediaDone' + _this.bindPostFix, function(){
+ embedPlayer.bindHelper( 'onChangeMedia' + _this.bindPostFix, function(){
if( ! embedPlayer['data-playerError'] ){
$embedPlayer.data('DolStatisticsCounter', $embedPlayer.data('DolStatisticsCounter') + 1 );
}
});
+ // Set the local autoplay flag:
+ embedPlayer.bindHelper( 'Playlist_PlayClip' + _this.bindPostFix, function(event, clipIndex, autoPlay){
+ $( embedPlayer ).data('playlistAutoPlayFlag', autoPlay);
+ });
+
// Register to our events
$.each(this.eventsList, function(k, eventName) {
switch( eventName ) {
@@ -298,12 +303,8 @@ mw.DolStatistics.prototype = {
getAutoPlayFlag: function(){
var embedPlayer = this.embedPlayer;
// Check if in playlist mode:
- if( embedPlayer.evaluate( '{playlistAPI.kpl0Url}' ) ){
- if( $( embedPlayer ).data('DolStatisticsCounter') == 1 ){
- return embedPlayer.autoplay;
- } else {
- return !!embedPlayer.evaluate( '{playlistAPI.autoContinue}' );
- }
+ if( typeof $( embedPlayer ).data('playlistAutoPlayFlag') != 'undefined' ){
+ return $( embedPlayer ).data('playlistAutoPlayFlag');
}
return embedPlayer.autoplay;
},
@@ -29,6 +29,7 @@
flashvars: {
'autoPlay' : true,
'playlistAPI.autoInsert' : 'true',
+ 'playlistAPI.autoContinue' : 'true',
'playlistAPI.kpl0Name' : 'test 4 item playlist',
'playlistAPI.kpl0Url' : 'http%3A%2F%2Fwww.kaltura.com%2Findex.php%2Fpartnerservices2%2Fexecuteplaylist%3Fuid%3D%26partner_id%3D243342%26subp_id%3D24334200%26format%3D8%26ks%3D%7Bks%7D%26playlist_id%3D0_q79jh71b'
}
@@ -33,6 +33,9 @@ mw.DoubleClick.prototype = {
// Inherit BaseAdPlugin
mw.inherit( this, new mw.BaseAdPlugin( embedPlayer, callback ) );
+ // remove any old bindings:
+ embedPlayer.unbindHelper( this.bindPostfix );
+
// Determine if we are in managed or kaltura point based mode.
if( this.getConfig( "preSequence" ) && this.getConfig( "adTagUrl" ) ){
// managed:
@@ -80,6 +83,7 @@ mw.DoubleClick.prototype = {
},
addKalturaCuePointBindings: function(){
var _this = this;
+ mw.log("DoubleClick::addKalturaCuePointBindings");
// Add a binding for cuepoints:
_this.embedPlayer.bindHelper( 'KalturaSupport_AdOpportunity' + _this.bindPostfix, function( event, cuePointWrapper ){
var cuePoint = cuePointWrapper.cuePoint;
@@ -409,6 +413,7 @@ mw.DoubleClick.prototype = {
this.restorePlayer();
},
restorePlayer: function(){
+ mw.log("DoubleClick::restorePlayer");
this.adPlaying = false;
this.embedPlayer.sequenceProxy.isInSequence = true;
@@ -424,10 +429,11 @@ mw.DoubleClick.prototype = {
// Show the content:
this.showContent();
+ // Check for sequence proxy style restore:
if( this.restorePlayerCallback ){
this.restorePlayerCallback();
this.restorePlayerCallback = null;
- } else {
+ } else { // do a manual restore:
// stop ad playback:
this.embedPlayer.adTimeline.restorePlayer();
// managed midroll ( just play content directly )
@@ -481,6 +481,7 @@ mw.EmbedPlayer.prototype = {
*/
switchPlaySource: function( source, switchCallback, doneCallback ){
var _this = this;
+
var targetPlayer = mw.EmbedTypes.getMediaPlayers().defaultPlayer( source.mimeType ) ;
if( targetPlayer.id != this.selectedPlayer.id ){
this.selectedPlayer = targetPlayer;
@@ -1224,6 +1225,8 @@ mw.EmbedPlayer.prototype = {
var chnagePlayingMedia = this.isPlaying();
// Reset first play to true, to count that play event
this.firstPlay = true;
+ // reset donePlaying count on change media.
+ this.donePlayingCount = 0;
this.triggeredEndDone = false;
this.preSequence = false;
this.postSequence = false;
@@ -1277,7 +1280,9 @@ mw.EmbedPlayer.prototype = {
if( chnagePlayingMedia ){
_this.play();
} else {
- // need to confirm this pause is not needed ( mdale )
+ // pause is need to keep pause sate, while
+ // switch source calls .play() that some browsers require.
+ // to reflect source swiches.
_this.pause();
}
if( callback ){
@@ -1676,6 +1681,7 @@ mw.EmbedPlayer.prototype = {
var _this = this;
var $this = $( this );
+
mw.log( "EmbedPlayer:: play: " + this._propagateEvents + ' poster: ' + this.stopped );
// Store the absolute play time ( to track native events that should not invoke interface updates )
this.absoluteStartPlayTime = new Date().getTime();
@@ -704,13 +704,12 @@ mw.EmbedPlayerNative = {
if( _this.parent_play() ){
this.getPlayerElement();
if ( this.playerElement && this.playerElement.play ) {
- // Dont play if in pause loading state
+ // If in pauseloading state make sure the loading spinner is present:
if( this.isPauseLoading ){
- this.playerElement.pause();
- } else {
- // issue a play request
- this.playerElement.play();
+ this.hideSpinnerOncePlaying()
}
+ // issue a play request
+ this.playerElement.play();
// re-start the monitor:
this.monitor();
}
@@ -217,7 +217,7 @@ mw.IFramePlayerApiClient.prototype = {
// Bind orientation change to resize player ( if fullscreen )
$(window).bind( 'orientationchange', function(e){
if( localIframeInFullscreen ){
- $('meta[name="viewport"]').attr('content', 'initial-scale=1; maximum-scale=1.0');
+ $('meta[name="viewport"]').attr('content', 'initial-scale=1');
doFullscreen();
}
});
@@ -164,7 +164,6 @@ mw.MediaElement.prototype = {
// Select the default source
var playableSources = this.getPlayableSources();
var flash_flag = false, ogg_flag = false;
-
// Check if there are any playableSources
if( playableSources.length == 0 ){
return false;
@@ -207,15 +206,15 @@ mw.MediaElement.prototype = {
// Check for device flags:
var desktopVdn, mobileVdn;
$.each( vndSources, function( inx, source) {
- // kaltura tags vdn sources with iphonenew
+ // Kaltura tags vdn sources with iphonenew
if( source.getFlavorId() && source.getFlavorId().toLowerCase() == 'iphonenew' ){
mobileVdn = source;
} else {
desktopVdn = source;
}
})
- // NOTE: We really should not have two vdn sources the point of vdn is to be a set of adaptive streams.
- // This work around is a result of kaltura HLS stream tagging
+ // NOTE: We really should not have two VDN sources the point of vdn is to be a set of adaptive streams.
+ // This work around is a result of Kaltura HLS stream tagging
if( mw.isIphone() && mobileVdn ){
setSelectedSource( mobileVdn );
} else if( desktopVdn ){
@@ -226,8 +225,6 @@ mw.MediaElement.prototype = {
mw.log('MediaElement::autoSelectSource: Set via Adaptive HLS: source flavor id:' + _this.selectedSource.getFlavorId() + ' src: ' + _this.selectedSource.getSrc() );
return this.selectedSource;
}
-
-
//Set via user bandwidth pref will always set source to closest bandwidth allocation while not going over EmbedPlayer.UserBandwidth
if( $.cookie('EmbedPlayer.UserBandwidth') ){
@@ -319,6 +316,10 @@ mw.MediaElement.prototype = {
mw.log('MediaElement::autoSelectSource: from ' + this.selectedSource.mimeType + ' because of resolution:' + this.selectedSource.width + ' close to: ' + displayWidth );
return this.selectedSource;
}
+ // if no size info is set just select the first source:
+ if( namedSourceSet[ codec ][0] ){
+ return setSelectedSource( namedSourceSet[ codec ][0] );
+ }
}
};
@@ -46,7 +46,7 @@ mw.mergeConfig( 'EmbedPlayer.SourceAttributes', [
'data-shorttitle', // short title for stream ( useful for stream switching control bar widget)
'data-width', // the width of the stream
'data-height', // the height of the stream
- 'data-bandwidth', // the overall bitrate of the stream
+ 'data-bandwidth', // the overall bitrate of the stream in bytes
'data-sizebytes', // the size of the stream in bytes
'data-framerate', // the framereate of the stream
'data-flavorid', // a source flavor id ( useful for targeting devices )
@@ -457,10 +457,18 @@ mw.PlayerControlBuilder.prototype = {
setTimeout( function(){ _this.syncPlayerSize() }, 200);
},
syncPlayerSize: function(){
+ mw.log( "PlayerControlBuilder::syncPlayerSize" );
var embedPlayer = this.embedPlayer;
- if( $( embedPlayer ).width() != $(window).width() ){
- embedPlayer.resizePlayer( this.getWindowSize() );
- };
+ // resize to the playlist container
+ // TODO change this to an event so player with interface around it ( ppt widget etc ) can
+ // set the player to the right size.
+ if( embedPlayer.playlist && ! this.inFullScreen ){
+ embedPlayer.playlist.syncPlayerSize();
+ } else {
+ if( $( embedPlayer ).width() != $(window).width() ){
+ embedPlayer.resizePlayer( this.getWindowSize() );
+ };
+ }
},
getWindowSize: function(){
return {
@@ -857,7 +865,7 @@ mw.PlayerControlBuilder.prototype = {
var bindFirstPlay = false;
_this.addRightClickBinding();
-
+
// check if the player takes up the full window size:
if( $( embedPlayer ).width() == $(window).width() ){
this.isWindowSizePlayer = true;
View
@@ -356,7 +356,7 @@ function setupPlayerConfig() {
if( $key == "id" ) {
continue;
}
- $plugins[ $pluginId ][ $key ] = $this->formatString((string) $value);
+ $plugins[ $pluginId ][ $key ] = $this->formatString( (string) $value );
}
}
}
@@ -371,7 +371,7 @@ function setupPlayerConfig() {
// uiVars
if( $this->uiConfFile ) {
- $uiVarsXml = $this->getUiConfXML()->xpath("*//var");
+ $uiVarsXml = $this->getUiConfXML()->xpath( "*//var" );
for( $i=0; $i < count($uiVarsXml); $i++ ) {
$key = ( string ) $uiVarsXml[ $i ]->attributes()->key;
@@ -385,6 +385,7 @@ function setupPlayerConfig() {
$vars[ $key ] = $this->formatString($value);
}
}
+
// Set Plugin attributes from uiVars/flashVars to our plugins array
foreach( $vars as $key => $value ) {
// If this is not a plugin setting, continue
@@ -409,7 +410,7 @@ function setupPlayerConfig() {
);
}
// Removes from vars array (keep only flat vars)
- unset( $vars[ $key ] );
+ //unset( $vars[ $key ] );
}
$this->playerConfig = array(
@@ -212,7 +212,7 @@ mw.KAds.prototype = {
waitForPlayback = function(){
waitForPlaybackCount++;
// Wait for playback for 10 seconds
- if( vid.currentTime > 0 || waitForPlaybackCount > 200 ){
+ if( vid.currentTime > 0 || waitForPlaybackCount > 400 ){
// Seek to where we did the switch
embedPlayer.seek( seekPerc );
} else {
@@ -260,7 +260,7 @@
return result;
}
// Return undefined to string: undefined, null, ''
- if( result === "undefined" || result === "null" || result == "" )
+ if( result === "undefined" || result === "null" || result === "" )
result = undefined;
if( result === "false"){
@@ -300,15 +300,17 @@
// Check the exported kaltura object ( for manual overrides of any mapping )
if( embedPlayer.playerConfig
- &&
- embedPlayer.playerConfig[ objectPath[0] ]
+ &&
+ embedPlayer.playerConfig.plugins
+ &&
+ embedPlayer.playerConfig.plugins[ objectPath[0] ]
){
- var kObj = embedPlayer.playerConfig[ objectPath[0] ] ;
+ var kObj = embedPlayer.playerConfig.plugins[ objectPath[0] ] ;
// TODO SHOULD USE A FUNCTION map
if( !objectPath[1] ){
return kObj;
}
- if( !objectPath[2] && kObj[ objectPath[1] ] ){
+ if( !objectPath[2] && (objectPath[1] in kObj) ){
return kObj[ objectPath[1] ];
}
if( objectPath[2] && kObj[ objectPath[1] ] && kObj[ objectPath[1] ][ objectPath[2] ] ){
@@ -410,13 +412,13 @@
case 'configProxy':
switch( objectPath[1] ){
case 'flashvars':
+ var fv;
+ if( embedPlayer.playerConfig && embedPlayer.playerConfig['vars'] ){
+ fv = embedPlayer.playerConfig['vars'];
+ } else {
+ fv = $( embedPlayer ).data('flashvars');
+ }
if( objectPath[2] ) {
- var fv;
- if( embedPlayer.playerConfig && embedPlayer.playerConfig['vars'] ){
- fv = embedPlayer.playerConfig['vars'];
- } else {
- fv = $( embedPlayer ).data('flashvars');
- }
switch( objectPath[2] ) {
case 'autoPlay':
// get autoplay
@@ -439,7 +441,7 @@
}
} else {
// Get full flashvars object
- return $( embedPlayer ).data( 'flashvars' );
+ return fv;
}
break;
case 'sessionId':
@@ -899,7 +901,7 @@
embedPlayer.emptySources();
break;
case 'changeMedia':
- // Check if we don't have entryId and referenceId and they both not -1 - Empty sources
+ // ChecchangeMediak if we don't have entryId and referenceId and they both not -1 - Empty sources
if( ( ! notificationData.entryId || notificationData.entryId == "" || notificationData.entryId == -1 )
&& ( ! notificationData.referenceId || notificationData.referenceId == "" || notificationData.referenceId == -1 ) ) {
embedPlayer.emptySources();
Oops, something went wrong.

0 comments on commit 48a812b

Please sign in to comment.