add playedit.js
This commit is contained in:
parent
6a8fca06cc
commit
5dd19505ba
2 changed files with 73 additions and 3 deletions
70
playedit.js
Normal file
70
playedit.js
Normal file
|
@ -0,0 +1,70 @@
|
|||
//open User->Preferences->Advanced->Run Script on Load and paste this script
|
||||
|
||||
(function() {
|
||||
|
||||
edit('user:example');
|
||||
|
||||
// settings and helper functions below
|
||||
var resolution = [window.innerWidth, window.innerHeight],
|
||||
outerHeight = 24 + 16 + 16 + 96, // menu bars + timeline bottom
|
||||
sidebarSize = resolution[0] - ((resolution[1] - outerHeight) * 4/3),
|
||||
tvUI = {
|
||||
clipSize: sidebarSize,
|
||||
annotationsRange: 'position',
|
||||
editView: 'annotations',
|
||||
section: 'edits',
|
||||
showAnnotations: true,
|
||||
showTimeline: true,
|
||||
showSidebar: false,
|
||||
videoLoop: true,
|
||||
videoScale: 'fit'
|
||||
};
|
||||
|
||||
function edit(edit, position) {
|
||||
pandora.UI.set({
|
||||
page: ''
|
||||
});
|
||||
position = position || 0;
|
||||
pandora.UI.set(Ox.extend({
|
||||
edit: edit
|
||||
}, tvUI, 'edits.' + edit + '.position', position));
|
||||
waitForPlayer(function(player) {
|
||||
//fixGUI();
|
||||
player.options({
|
||||
paused: false,
|
||||
position: position
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function waitForPlayer(callback) {
|
||||
var $player, player;
|
||||
if (pandora.$ui.editPanel) {
|
||||
$player = $('.OxVideoPlayer').not('.OxBar');
|
||||
var readyState = 0;
|
||||
if($player.find('video').length) {
|
||||
$player.find('video').each(function() {
|
||||
readyState = Math.max(readyState, this.readyState);
|
||||
});
|
||||
}
|
||||
if(readyState && $player.data('oxid') && Ox.$elements[$player.data('oxid')]) {
|
||||
player = Ox.$elements[$player.data('oxid')];
|
||||
}
|
||||
}
|
||||
if (player) {
|
||||
setTimeout(function() {
|
||||
callback(player, $player);
|
||||
}, 250);
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
waitForPlayer(callback);
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
function fixGUI() {
|
||||
// hide menu
|
||||
pandora.$ui.appPanel.resizeElement(0, 0);
|
||||
|
||||
|
||||
}
|
||||
})();
|
|
@ -41,10 +41,10 @@
|
|||
}
|
||||
|
||||
function edit(edit, position) {
|
||||
var resolution = [1920, 1080],
|
||||
annotationsSize = resolution[0] - (resolution[1] * 4/3),
|
||||
var resolution = [window.innerWidth, window.innerHeight],
|
||||
clipSize = resolution[0] - (resolution[1] * 4/3),
|
||||
tvUI = {
|
||||
annotationsSize: annotationsSize,
|
||||
clipSize: clipSize,
|
||||
annotationsRange: 'position',
|
||||
editView: 'annotations',
|
||||
section: 'edits',
|
||||
|
|
Loading…
Reference in a new issue