add 'open' control to embedded player
This commit is contained in:
parent
1533e2ca64
commit
fac583b968
1 changed files with 11 additions and 5 deletions
|
@ -21,11 +21,14 @@ Ox.load('UI', {
|
||||||
pandora.user.ui.item = options.item;
|
pandora.user.ui.item = options.item;
|
||||||
pandora.api.get({id: options.item, keys: videoKeys}, function(result) {
|
pandora.api.get({id: options.item, keys: videoKeys}, function(result) {
|
||||||
var data = getVideoOptions(result.data);
|
var data = getVideoOptions(result.data);
|
||||||
that.append(pandora.player = Ox.VideoPlayer({
|
that.append(pandora.$player = Ox.VideoPlayer({
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: pandora.site.cantPlay.text,
|
censoredTooltip: pandora.site.cantPlay.text,
|
||||||
controlsTop: Ox.Fullscreen.available ? ['fullscreen'] : [],
|
controlsTooltips: {open: 'Open in ' + pandora.site.site.name},
|
||||||
|
controlsTop: (Ox.Fullscreen.available ? ['fullscreen'] : []).concat(
|
||||||
|
['space', 'open']
|
||||||
|
),
|
||||||
controlsBottom: ['play', 'volume', 'scale', 'timeline', 'settings'],
|
controlsBottom: ['play', 'volume', 'scale', 'timeline', 'settings'],
|
||||||
duration: data.duration,
|
duration: data.duration,
|
||||||
enableFind: false,
|
enableFind: false,
|
||||||
|
@ -51,6 +54,9 @@ Ox.load('UI', {
|
||||||
width: window.innerWidth
|
width: window.innerWidth
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
|
open: function() {
|
||||||
|
pandora.$player.options({paused: true});
|
||||||
|
},
|
||||||
playing: checkRange,
|
playing: checkRange,
|
||||||
position: checkRange,
|
position: checkRange,
|
||||||
resolution: function(data) {
|
resolution: function(data) {
|
||||||
|
@ -120,10 +126,10 @@ Ox.load('UI', {
|
||||||
data.position < options['in'] - 0.04
|
data.position < options['in'] - 0.04
|
||||||
|| data.position > options.out
|
|| data.position > options.out
|
||||||
) {
|
) {
|
||||||
if (!pandora.player.options('paused')) {
|
if (!pandora.$player.options('paused')) {
|
||||||
pandora.player.togglePaused();
|
pandora.$player.togglePaused();
|
||||||
}
|
}
|
||||||
pandora.player.options({
|
pandora.$player.options({
|
||||||
position: options['in']
|
position: options['in']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue