mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
resolve moviedb issues
This commit is contained in:
parent
21c5f51bb0
commit
12f4de7741
2 changed files with 40 additions and 9 deletions
|
@ -847,7 +847,7 @@
|
||||||
|
|
||||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||||
|
|
||||||
var maxAllowedWidth = Math.max(screen.height, screen.width);
|
var maxAllowedWidth = self.getMaxPlayableWidth();
|
||||||
|
|
||||||
var options = [];
|
var options = [];
|
||||||
|
|
||||||
|
@ -1063,6 +1063,10 @@
|
||||||
EnableAutoStreamCopy: false
|
EnableAutoStreamCopy: false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (isStatic && mediaSource.Protocol == 'Http' && !mediaSource.RequiredHttpHeaders.length) {
|
||||||
|
mp4VideoUrl = mediaSource.Path;
|
||||||
|
}
|
||||||
|
|
||||||
if (isStatic) {
|
if (isStatic) {
|
||||||
mp4VideoUrl += seekParam;
|
mp4VideoUrl += seekParam;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1218,6 +1222,8 @@
|
||||||
|
|
||||||
video.one("loadedmetadata.mediaplayerevent", function (e) {
|
video.one("loadedmetadata.mediaplayerevent", function (e) {
|
||||||
|
|
||||||
|
// TODO: This is not working in chrome. Is it too early?
|
||||||
|
|
||||||
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
||||||
if (startPositionInSeekParam && this.currentSrc && this.currentSrc.toLowerCase().indexOf('.m3u8') != -1) {
|
if (startPositionInSeekParam && this.currentSrc && this.currentSrc.toLowerCase().indexOf('.m3u8') != -1) {
|
||||||
this.currentTime = startPositionInSeekParam;
|
this.currentTime = startPositionInSeekParam;
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
self.updateCanClientSeek = function (elem) {
|
self.updateCanClientSeek = function (elem) {
|
||||||
|
|
||||||
var duration = elem.duration;
|
var duration = elem.duration;
|
||||||
|
|
||||||
canClientSeek = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
|
canClientSeek = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
|
||||||
|
@ -257,11 +258,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!videoStream) {
|
if (!videoStream) {
|
||||||
|
console.log('Cannot direct play without videoStream info');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mediaSource.VideoType != "VideoFile") {
|
if (mediaSource.Protocol.toLowerCase() == "rtmp") {
|
||||||
console.log('Transcoding because the content is not a video file');
|
//console.log('Transcoding because the content is not a video file');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mediaSource.VideoType && mediaSource.VideoType != "VideoFile") {
|
||||||
|
//console.log('Transcoding because the content is not a video file');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +289,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!videoStream.Width || videoStream.Width > maxWidth) {
|
if (!videoStream.Width) {
|
||||||
|
console.log('Transcoding because resolution is unknown');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (videoStream.Width > maxWidth) {
|
||||||
console.log('Transcoding because resolution is too high');
|
console.log('Transcoding because resolution is too high');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +304,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mediaSource.Bitrate || mediaSource.Bitrate > bitrate) {
|
if (!mediaSource.Bitrate) {
|
||||||
|
console.log('Transcoding because bitrate is unknown');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mediaSource.Bitrate > bitrate) {
|
||||||
console.log('Transcoding because bitrate is too high');
|
console.log('Transcoding because bitrate is too high');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -303,6 +320,7 @@
|
||||||
|
|
||||||
// only support high, baseline variants and main variants
|
// only support high, baseline variants and main variants
|
||||||
if (isH264 && profile != 'high' && profile.indexOf('baseline') == -1 && profile.indexOf('main') == -1) {
|
if (isH264 && profile != 'high' && profile.indexOf('baseline') == -1 && profile.indexOf('main') == -1) {
|
||||||
|
console.log('Transcoding because of unsupported h264 profile');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,11 +340,11 @@
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
var audioStream = mediaStreams.filter(function (stream) {
|
var audioStream = mediaStreams.filter(function (stream) {
|
||||||
return stream.Index === audioStreamIndex;
|
return stream.Index === audioStreamIndex && stream.Type == 'Audio';
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
var subtitleStream = mediaStreams.filter(function (stream) {
|
var subtitleStream = mediaStreams.filter(function (stream) {
|
||||||
return stream.Index === subtitleStreamIndex;
|
return stream.Index === subtitleStreamIndex && stream.Type == 'Subtitle';
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
var canPlayDirect = self.canPlayVideoDirect(mediaSource, videoStream, audioStream, subtitleStream, maxWidth, bitrate);
|
var canPlayDirect = self.canPlayVideoDirect(mediaSource, videoStream, audioStream, subtitleStream, maxWidth, bitrate);
|
||||||
|
@ -445,6 +463,11 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.getMaxPlayableWidth = function () {
|
||||||
|
|
||||||
|
return Math.max(screen.height, screen.width);
|
||||||
|
};
|
||||||
|
|
||||||
self.playWithIntros = function (items, options, user) {
|
self.playWithIntros = function (items, options, user) {
|
||||||
|
|
||||||
var firstItem = items[0];
|
var firstItem = items[0];
|
||||||
|
@ -475,7 +498,7 @@
|
||||||
|
|
||||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||||
|
|
||||||
var maxAllowedWidth = Math.max(screen.height, screen.width);
|
var maxAllowedWidth = self.getMaxPlayableWidth();
|
||||||
|
|
||||||
optimalVersion = versions.filter(function (v) {
|
optimalVersion = versions.filter(function (v) {
|
||||||
|
|
||||||
|
@ -1317,6 +1340,8 @@
|
||||||
audioCodec.indexOf('mp3') == -1 &&
|
audioCodec.indexOf('mp3') == -1 &&
|
||||||
audioCodec.indexOf('mpeg') == -1) {
|
audioCodec.indexOf('mpeg') == -1) {
|
||||||
|
|
||||||
|
console.log('Cannot direct play. Unsupported audio codec');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue