Skip to content

Commit

Permalink
make it so /embed/ for IA stream_only items does not show the [downlo…
Browse files Browse the repository at this point in the history
…ad] option in the player menu

git-svn-id: http://www.kaltura.org/kalorg/html5video/trunk/mwEmbed@1955 b58a29cf-3064-46da-94c6-1c29cc75c8e5
  • Loading branch information
traceypooh committed May 18, 2011
1 parent 1ba3699 commit 9ab0ea7
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 67 deletions.
140 changes: 74 additions & 66 deletions modules/InternetArchiveSupport/InternetArchiveVideoPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,79 +104,90 @@ mw.IA =



// Set up so that:
// - when "click to play" clicked, resize video window and playlist
// - we advance to the next clip (when 2+ present)
newEmbedPlayerMW:function(arg)
{
var player = $('#mwplayer');
if (!player)
return;
// Set up so that:
// - when "click to play" clicked, resize video window and playlist
// - we advance to the next clip (when 2+ present)
newEmbedPlayerMW:function(arg)
{
if (typeof($('#iframeVidso').get(0)) != 'undefined')
{
// this means we are in a context like /embed/
mw.setConfig( {
'EmbedPlayer.EnabledOptionsMenuItems':
['playerSelect','share','aboutPlayerLibrary']
});
}

mw.log('newEmbedPlayerMW()');
player.bind('ended', mw.IA.onDoneMW);
player.unbind('play').bind('play', mw.IA.firstplayMW);
player.bind('pause', mw.IA.pause);

player.bind('onCloseFullScreen', function(){ setTimeout(function() { mw.IA.resizeMW(); }, 500); }); //xxx timeout lameness
},
var player = $('#mwplayer');
if (!player)
return;


pause:function()
{
mw.log('paused');
return; //xxxx not quite ready for hash yet
mw.log('newEmbedPlayerMW()');
player.bind('ended', mw.IA.onDoneMW);
player.unbind('play').bind('play', mw.IA.firstplayMW);
player.bind('pause', mw.IA.pause);

location.hash = '#' + IAD.playlist[mw.IA.playingClipNumMW]['ORIG'] +
'/start=' + Math.round($('#mwplayer').get(0).currentTime * 10) / 10;
},
player.bind('onCloseFullScreen', function(){ setTimeout(function() { mw.IA.resizeMW(); }, 500); }); //xxx timeout lameness
},


resizeMW:function()
{
var player = $('#mwplayer');
pause:function()
{
mw.log('paused');
return; //xxxx not quite ready for hash yet

$('#flowplayerdiv').css('width', this.VIDEO_WIDTH);
$('#flowplayerdiv').css('height', this.VIDEO_HEIGHT);
location.hash = '#' + IAD.playlist[mw.IA.playingClipNumMW]['ORIG'] +
'/start=' + Math.round($('#mwplayer').get(0).currentTime * 10) / 10;
},

$('#flowplayerplaylist').css('width', this.VIDEO_WIDTH);

var jplay = player[0];
IAD.log('IA ' + jplay.getWidth() + 'x' + jplay.getHeight());
resizeMW:function()
{
var player = $('#mwplayer');

jplay.resizePlayer({'width': this.VIDEO_WIDTH,
'height': this.VIDEO_HEIGHT},true);
},
$('#flowplayerdiv').css('width', this.VIDEO_WIDTH);
$('#flowplayerdiv').css('height', this.VIDEO_HEIGHT);

$('#flowplayerplaylist').css('width', this.VIDEO_WIDTH);

firstplayMW:function()
{
if (typeof(mw.IA.MWsetup)!='undefined')
return;
mw.IA.MWsetup = true;
var jplay = player[0];
IAD.log('IA ' + jplay.getWidth() + 'x' + jplay.getHeight());

mw.log('firstplayMW()');
mw.IA.resizeMW();
},
jplay.resizePlayer({'width': this.VIDEO_WIDTH,
'height': this.VIDEO_HEIGHT},true);
},


playClipMW:function(idx)
{
mw.IA.playingClipNumMW = idx;
mw.log('IA play: ('+idx+')');
if (typeof(IAD)=='undefined' || typeof(IAD.playlist[idx])=='undefined')
return;
firstplayMW:function()
{
if (typeof(mw.IA.MWsetup)!='undefined')
return;
mw.IA.MWsetup = true;

var group = IAD.playlist[idx];
mw.log(group);
mw.log('firstplayMW()');
mw.IA.resizeMW();
},


playClipMW:function(idx)
{
mw.IA.playingClipNumMW = idx;
mw.log('IA play: ('+idx+')');
if (typeof(IAD)=='undefined' || typeof(IAD.playlist[idx])=='undefined')
return;

// set things up so we can update the "playing triangle"
this.flowplayerplaylist = $('#flowplayerplaylist')[0];
this.indicateIsPlaying(idx);
var group = IAD.playlist[idx];
mw.log(group);

// location.hash = '#' + group['ORIG']; //xxxx not quite ready yet
// set things up so we can update the "playing triangle"
this.flowplayerplaylist = $('#flowplayerplaylist')[0];
this.indicateIsPlaying(idx);

mw.ready(function(){
// location.hash = '#' + group['ORIG']; //xxxx not quite ready yet

mw.ready(function(){

var player = $('#mwplayer'); // <div id="mwplayer"><video ...></div>
if (!player)
Expand All @@ -193,15 +204,15 @@ playClipMW:function(idx)
});
});

return false;
},
return false;
},


onDoneMW:function(event, onDoneActionObject )
{
mw.IA.playingClipNumMW++;
mw.IA.playClipMW(mw.IA.playingClipNumMW);
},
onDoneMW:function(event, onDoneActionObject )
{
mw.IA.playingClipNumMW++;
mw.IA.playClipMW(mw.IA.playingClipNumMW);
},



Expand Down Expand Up @@ -258,14 +269,10 @@ div.overlay-content {\n\
}



mw.setConfig( {
// We want our video player to attribute something...
"EmbedPlayer.AttributionButton" : true,

//'jQueryUISkin' : 'kdark',
//"EmbedPlayer.NativeControlsMobileSafari" : true, //xxx

'Mw.UserPreferenceExpireDays' : 90,

// Our attribution button
Expand All @@ -277,14 +284,15 @@ div.overlay-content {\n\
});




// NOTE: keep this outside "mw.ready()" so that "click-to-play" does indeed
// cause the newEmbedPlayerMW() call
$( mw ).bind('newEmbedPlayerEvent', mw.IA.newEmbedPlayerMW);

mw.ready(function(){
var hash = unescape(location.hash);
mw.log("IA Player says mw.ready()" + hash)

mw.log("IA Player says mw.ready()" + hash);


var star = (mw.IA.arg('start') ? parseFloat(mw.IA.arg('start')) : 0);
Expand Down
2 changes: 1 addition & 1 deletion mwEmbedFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function __construct(){
// Parse the embedFrame request and sanitize input
private function parseRequest(){
if( isset($_REQUEST['iaid']) && include('/petabox/setup.inc') ){
Video::mwEmbedSetup(); // archive.org media
$this->playerIframeId .= Video::mwEmbedSetup(); // archive.org media
}

// Check for / attribute type request and update "REQUEST" global
Expand Down

0 comments on commit 9ab0ea7

Please sign in to comment.