forked from 0x2620/pandora
add option to select a local video file
This commit is contained in:
parent
1e0147d85b
commit
f642c010cd
2 changed files with 34 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue