mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Fix .ass subtitles not starting on mobile
This commit is contained in:
parent
5063c4f050
commit
4c74a49032
@ -162,7 +162,7 @@ define(['appSettings', 'browser', 'events'], function (appSettings, browser, eve
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function seekOnPlaybackStart(instance, element, ticks) {
|
function seekOnPlaybackStart(instance, element, ticks, onMediaReady) {
|
||||||
|
|
||||||
var seconds = (ticks || 0) / 10000000;
|
var seconds = (ticks || 0) / 10000000;
|
||||||
|
|
||||||
@ -175,6 +175,7 @@ define(['appSettings', 'browser', 'events'], function (appSettings, browser, eve
|
|||||||
if (element.duration >= seconds) {
|
if (element.duration >= seconds) {
|
||||||
// media is ready, seek immediately
|
// media is ready, seek immediately
|
||||||
setCurrentTimeIfNeeded(element, seconds);
|
setCurrentTimeIfNeeded(element, seconds);
|
||||||
|
if (onMediaReady) onMediaReady();
|
||||||
} else {
|
} else {
|
||||||
// update video player position when media is ready to be sought
|
// update video player position when media is ready to be sought
|
||||||
var events = ["durationchange", "loadeddata", "play", "loadedmetadata"];
|
var events = ["durationchange", "loadeddata", "play", "loadedmetadata"];
|
||||||
@ -189,6 +190,7 @@ define(['appSettings', 'browser', 'events'], function (appSettings, browser, eve
|
|||||||
events.map(function(name) {
|
events.map(function(name) {
|
||||||
element.removeEventListener(name, onMediaChange);
|
element.removeEventListener(name, onMediaChange);
|
||||||
});
|
});
|
||||||
|
if (onMediaReady) onMediaReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
events.map(function (name) {
|
events.map(function (name) {
|
||||||
|
@ -857,7 +857,9 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
htmlMediaHelper.seekOnPlaybackStart(self, e.target, self._currentPlayOptions.playerStartPositionTicks);
|
htmlMediaHelper.seekOnPlaybackStart(self, e.target, self._currentPlayOptions.playerStartPositionTicks, function () {
|
||||||
|
if (currentSubtitlesOctopus) currentSubtitlesOctopus.resize();
|
||||||
|
});
|
||||||
|
|
||||||
if (self._currentPlayOptions.fullscreen) {
|
if (self._currentPlayOptions.fullscreen) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user