add option to select a local video file

This commit is contained in:
j 2015-03-26 15:42:53 +05:30
commit f642c010cd
2 changed files with 34 additions and 8 deletions

View file

@ -123,6 +123,21 @@ pandora.ui.cacheDialog = function() {
})
.appendTo($item),
$fileButton = Ox.FileButton({
title: 'Select Video...',
width: 128,
disabled: pandora.user.ui.section != 'items'
|| pandora.user.ui.item == ''
|| !!pandora.fs.getVideoURL(pandora.user.ui.item, pandora.user.ui.videoResolution, 1)
})
.css({
margin: '8px'
})
.bindEvent({
click: selectVideo
})
.appendTo($item),
$cacheListButton = Ox.Button({
title: 'Cache List...',
width: 128,
@ -285,6 +300,17 @@ pandora.ui.cacheDialog = function() {
});
}
function selectVideo(data) {
var blob = data.files[0],
name = pandora.fs.getVideoName(pandora.user.ui.item, pandora.user.ui.videoResolution, 1);
pandora.fs.storeBlob(blob, name, function() {
getCachedVideos(function(files) {
cachedVideos = Ox.api(files);
cachedVideos(data, callback);
});
});
}
function updateActiveDownloads() {
pandora.fs.getVideos(function(files) {
files.forEach(function(file) {