1
0
Fork 0
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:
Luke Pulverenti 2014-10-07 21:37:45 -04:00
parent 21c5f51bb0
commit 12f4de7741
2 changed files with 40 additions and 9 deletions

View file

@ -847,7 +847,7 @@
var bitrateSetting = AppSettings.maxStreamingBitrate();
var maxAllowedWidth = Math.max(screen.height, screen.width);
var maxAllowedWidth = self.getMaxPlayableWidth();
var options = [];
@ -1063,6 +1063,10 @@
EnableAutoStreamCopy: false
}));
if (isStatic && mediaSource.Protocol == 'Http' && !mediaSource.RequiredHttpHeaders.length) {
mp4VideoUrl = mediaSource.Path;
}
if (isStatic) {
mp4VideoUrl += seekParam;
} else {
@ -1218,6 +1222,8 @@
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
if (startPositionInSeekParam && this.currentSrc && this.currentSrc.toLowerCase().indexOf('.m3u8') != -1) {
this.currentTime = startPositionInSeekParam;

View file

@ -38,6 +38,7 @@
};
self.updateCanClientSeek = function (elem) {
var duration = elem.duration;
canClientSeek = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
@ -257,11 +258,17 @@
}
if (!videoStream) {
console.log('Cannot direct play without videoStream info');
return false;
}
if (mediaSource.VideoType != "VideoFile") {
console.log('Transcoding because the content is not a video file');
if (mediaSource.Protocol.toLowerCase() == "rtmp") {
//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;
}
@ -282,7 +289,12 @@
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');
return false;
}
@ -292,7 +304,12 @@
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');
return false;
}
@ -303,6 +320,7 @@
// only support high, baseline variants and main variants
if (isH264 && profile != 'high' && profile.indexOf('baseline') == -1 && profile.indexOf('main') == -1) {
console.log('Transcoding because of unsupported h264 profile');
return false;
}
@ -322,11 +340,11 @@
})[0];
var audioStream = mediaStreams.filter(function (stream) {
return stream.Index === audioStreamIndex;
return stream.Index === audioStreamIndex && stream.Type == 'Audio';
})[0];
var subtitleStream = mediaStreams.filter(function (stream) {
return stream.Index === subtitleStreamIndex;
return stream.Index === subtitleStreamIndex && stream.Type == 'Subtitle';
})[0];
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) {
var firstItem = items[0];
@ -475,7 +498,7 @@
var bitrateSetting = AppSettings.maxStreamingBitrate();
var maxAllowedWidth = Math.max(screen.height, screen.width);
var maxAllowedWidth = self.getMaxPlayableWidth();
optimalVersion = versions.filter(function (v) {
@ -1317,6 +1340,8 @@
audioCodec.indexOf('mp3') == -1 &&
audioCodec.indexOf('mpeg') == -1) {
console.log('Cannot direct play. Unsupported audio codec');
return false;
}