1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update hls playback

This commit is contained in:
Luke Pulverenti 2016-04-20 14:51:47 -04:00
parent 7919706532
commit 396b125d66
27 changed files with 438 additions and 728 deletions

View file

@ -975,12 +975,13 @@
self.createStreamInfo('Video', item, mediaSource, startPosition).then(function (streamInfo) {
var isHls = streamInfo.url.toLowerCase().indexOf('.m3u8') != -1;
var urlLower = streamInfo.url.toLowerCase();
var isHls = urlLower.indexOf('.m3u8') != -1;
// Huge hack alert. Safari doesn't seem to like if the segments aren't available right away when playback starts
// This will start the transcoding process before actually feeding the video url into the player
// Edit: Also seeing stalls from hls.js
if (!mediaSource.RunTimeTicks && isHls) {
if ((!mediaSource.RunTimeTicks) && isHls) {
Dashboard.showLoadingMsg();
var hlsPlaylistUrl = streamInfo.url.replace('master.m3u8', 'live.m3u8');
@ -990,11 +991,11 @@
url: hlsPlaylistUrl
}).then(function () {
Dashboard.hideLoadingMsg();
streamInfo.url = hlsPlaylistUrl;
// add a delay to continue building up the buffer. without this we see failures in safari mobile
setTimeout(function () {
Dashboard.hideLoadingMsg();
self.playVideoInternal(item, mediaSource, startPosition, streamInfo, callback);
}, 2000);

View file

@ -275,9 +275,7 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use
var currentSrc = (self.getCurrentSrc(mediaRenderer) || '').toLowerCase();
if (currentSrc.indexOf('.m3u8') != -1) {
if (currentSrc.indexOf('forcelivestream=true') == -1) {
return true;
}
return true;
} else {
var duration = mediaRenderer.duration();
return duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
@ -747,11 +745,6 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use
if (mediaSource.TranscodingSubProtocol == 'hls') {
if (mediaUrl.toLowerCase().indexOf('forcelivestream=true') != -1) {
startPositionInSeekParam = 0;
startTimeTicksOffset = startPosition || 0;
}
contentType = 'application/x-mpegURL';
} else {