mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
resolve live tv with ios
This commit is contained in:
parent
1ad8c6e955
commit
77fb2070f5
3 changed files with 33 additions and 40 deletions
|
@ -69,9 +69,6 @@
|
||||||
|
|
||||||
ApiClient.reportPlaybackStopped(stopInfo);
|
ApiClient.reportPlaybackStopped(stopInfo);
|
||||||
|
|
||||||
}).on('positionchange.mediacontroller', function (e, state) {
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -931,6 +931,31 @@
|
||||||
|
|
||||||
var streamInfo = self.createStreamInfo('Video', item, mediaSource, startPosition);
|
var streamInfo = self.createStreamInfo('Video', item, mediaSource, startPosition);
|
||||||
|
|
||||||
|
// 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
|
||||||
|
if ($.browser.safari && !mediaSource.RunTimeTicks) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
ApiClient.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: streamInfo.url.replace('master.m3u8', 'live.m3u8')
|
||||||
|
}).always(function () {
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
|
||||||
|
}).done(function () {
|
||||||
|
self.playVideoInternal(item, mediaSource, startPosition, streamInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
self.playVideoInternal(item, mediaSource, startPosition, streamInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
self.playVideoInternal = function (item, mediaSource, startPosition, streamInfo) {
|
||||||
|
|
||||||
var videoUrl = streamInfo.url;
|
var videoUrl = streamInfo.url;
|
||||||
var contentType = streamInfo.contentType;
|
var contentType = streamInfo.contentType;
|
||||||
var startPositionInSeekParam = streamInfo.startPositionInSeekParam;
|
var startPositionInSeekParam = streamInfo.startPositionInSeekParam;
|
||||||
|
@ -975,8 +1000,9 @@
|
||||||
|
|
||||||
// Can't autoplay in these browsers so we need to use the full controls
|
// Can't autoplay in these browsers so we need to use the full controls
|
||||||
if (requiresNativeControls) {
|
if (requiresNativeControls) {
|
||||||
html += '<video class="itemVideo" id="itemVideo" preload="none" autoplay="autoplay" crossorigin="anonymous" controls="controls"' + posterCode + '>';
|
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="anonymous" controls="controls"' + posterCode + '>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
// Chrome 35 won't play with preload none
|
// Chrome 35 won't play with preload none
|
||||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" crossorigin="anonymous" autoplay' + posterCode + '>';
|
html += '<video class="itemVideo" id="itemVideo" preload="metadata" crossorigin="anonymous" autoplay' + posterCode + '>';
|
||||||
|
@ -1167,7 +1193,10 @@
|
||||||
|
|
||||||
$('body').addClass('bodyWithPopupOpen');
|
$('body').addClass('bodyWithPopupOpen');
|
||||||
|
|
||||||
return video[0];
|
self.currentMediaElement = video[0];
|
||||||
|
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||||
|
|
||||||
|
self.updateNowPlayingInfo(item);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.updatePlaylistUi = function () {
|
self.updatePlaylistUi = function () {
|
||||||
|
|
|
@ -379,36 +379,6 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getVideoTranscodingExtension = function (currentSrc) {
|
|
||||||
|
|
||||||
if (currentSrc) {
|
|
||||||
return self.getCurrentMediaExtension(currentSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// safari
|
|
||||||
if (self.canPlayHls()) {
|
|
||||||
return '.m3u8';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chrome, Firefox or IE with plugin installed
|
|
||||||
// For some reason in chrome pausing mp4 is causing the video to fail.
|
|
||||||
// So for now it will have to prioritize webm
|
|
||||||
if (self.canPlayWebm()) {
|
|
||||||
|
|
||||||
if ($.browser.msie) {
|
|
||||||
return '.webm';
|
|
||||||
}
|
|
||||||
if ($.browser.chrome) {
|
|
||||||
return '.webm';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Firefox suddenly having trouble with our webm
|
|
||||||
return '.webm';
|
|
||||||
}
|
|
||||||
|
|
||||||
return '.mp4';
|
|
||||||
};
|
|
||||||
|
|
||||||
self.changeStream = function (ticks, params) {
|
self.changeStream = function (ticks, params) {
|
||||||
|
|
||||||
var element = self.currentMediaElement;
|
var element = self.currentMediaElement;
|
||||||
|
@ -895,10 +865,7 @@
|
||||||
|
|
||||||
if (item.MediaType === "Video") {
|
if (item.MediaType === "Video") {
|
||||||
|
|
||||||
self.currentMediaElement = self.playVideo(item, self.currentMediaSource, startPosition);
|
self.playVideo(item, self.currentMediaSource, startPosition);
|
||||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
|
||||||
|
|
||||||
self.updateNowPlayingInfo(item);
|
|
||||||
|
|
||||||
} else if (item.MediaType === "Audio") {
|
} else if (item.MediaType === "Audio") {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue