mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
Merge pull request #2940 from thornbill/fix-direct-play
This commit is contained in:
commit
247d3f23e6
@ -618,21 +618,6 @@ function supportsDirectPlay(apiClient, item, mediaSource) {
|
||||
} else {
|
||||
return isHostReachable(mediaSource, apiClient);
|
||||
}
|
||||
} else if (mediaSource.Protocol === 'File') {
|
||||
return new Promise(function (resolve) {
|
||||
// Determine if the file can be accessed directly
|
||||
import('../../scripts/filesystem').then((filesystem) => {
|
||||
const method = isFolderRip ?
|
||||
'directoryExists' :
|
||||
'fileExists';
|
||||
|
||||
filesystem[method](mediaSource.Path).then(function () {
|
||||
resolve(true);
|
||||
}, function () {
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2481,7 +2466,7 @@ class PlaybackManager {
|
||||
// Only used for audio
|
||||
playMethod = 'Transcode';
|
||||
mediaUrl = mediaSource.StreamUrl;
|
||||
} else if (mediaSource.SupportsDirectStream) {
|
||||
} else if (mediaSource.SupportsDirectPlay || mediaSource.SupportsDirectStream) {
|
||||
directOptions = {
|
||||
Static: true,
|
||||
mediaSourceId: mediaSource.Id,
|
||||
@ -2500,7 +2485,7 @@ class PlaybackManager {
|
||||
const prefix = type === 'Video' ? 'Videos' : 'Audio';
|
||||
mediaUrl = apiClient.getUrl(prefix + '/' + item.Id + '/stream.' + mediaSourceContainer, directOptions);
|
||||
|
||||
playMethod = 'DirectStream';
|
||||
playMethod = mediaSource.SupportsDirectPlay ? 'DirectPlay' : 'DirectStream';
|
||||
} else if (mediaSource.SupportsTranscoding) {
|
||||
mediaUrl = apiClient.getUrl(mediaSource.TranscodingUrl);
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
export function fileExists(path) {
|
||||
if (window.NativeShell && window.NativeShell.FileSystem) {
|
||||
return window.NativeShell.FileSystem.fileExists(path);
|
||||
}
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
export function directoryExists(path) {
|
||||
if (window.NativeShell && window.NativeShell.FileSystem) {
|
||||
return window.NativeShell.FileSystem.directoryExists(path);
|
||||
}
|
||||
return Promise.reject();
|
||||
}
|
Loading…
Reference in New Issue
Block a user