mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
audio fixes for ie10
This commit is contained in:
parent
05a4cb13a3
commit
cac0ffef2f
2 changed files with 82 additions and 23 deletions
|
@ -42,6 +42,7 @@
|
|||
|
||||
function onPlaybackStopped() {
|
||||
|
||||
console.log('ended');
|
||||
currentTimeElement.hide();
|
||||
|
||||
var endTime = this.currentTime;
|
||||
|
@ -65,13 +66,19 @@
|
|||
|
||||
currentProgressInterval = setInterval(function () {
|
||||
|
||||
var position = Math.floor(10000000 * currentMediaElement.currentTime) + startTimeTicksOffset;
|
||||
|
||||
ApiClient.reportPlaybackProgress(Dashboard.getCurrentUserId(), itemId, position);
|
||||
if (currentMediaElement) {
|
||||
sendProgressUpdate(itemId);
|
||||
}
|
||||
|
||||
}, intervalTime);
|
||||
}
|
||||
|
||||
function sendProgressUpdate(itemId) {
|
||||
var position = Math.floor(10000000 * currentMediaElement.currentTime) + startTimeTicksOffset;
|
||||
|
||||
ApiClient.reportPlaybackProgress(Dashboard.getCurrentUserId(), itemId, position);
|
||||
}
|
||||
|
||||
function clearProgressInterval() {
|
||||
|
||||
if (currentProgressInterval) {
|
||||
|
@ -94,6 +101,8 @@
|
|||
currentMediaElement.volume = vol;
|
||||
});
|
||||
|
||||
$(".jqueryuislider").slider({ orientation: "horizontal" });
|
||||
|
||||
positionSlider = $(".positionSlider").on('change', function () {
|
||||
|
||||
isPositionSliderActive = true;
|
||||
|
@ -132,6 +141,7 @@
|
|||
|
||||
$(this).off('play.onceafterseek').on('ended.playbackstopped', onPlaybackStopped);
|
||||
startProgressInterval(currentItem.Id);
|
||||
sendProgressUpdate(currentItem.Id);
|
||||
|
||||
});
|
||||
startTimeTicksOffset = newPositionTicks;
|
||||
|
@ -252,10 +262,15 @@
|
|||
|
||||
var audioElement = $("audio", nowPlayingBar);
|
||||
|
||||
var initialVolume = localStorage.getItem("volume") || 0.5;
|
||||
|
||||
audioElement.each(function () {
|
||||
this.volume = localStorage.getItem("volume") || 0.5;
|
||||
this.volume = initialVolume;
|
||||
});
|
||||
|
||||
volumeSlider.val(initialVolume);
|
||||
updateVolumeButtons(initialVolume);
|
||||
|
||||
audioElement.on("volumechange", function () {
|
||||
|
||||
var vol = this.volume;
|
||||
|
@ -270,9 +285,8 @@
|
|||
isStaticStream = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
|
||||
|
||||
currentTimeElement.show();
|
||||
audioElement.removeAttr('controls').hide().off("play.once");
|
||||
|
||||
updateVolumeButtons(this.volume);
|
||||
audioElement.removeAttr('controls').hide().off("play.once");
|
||||
|
||||
ApiClient.reportPlaybackStart(Dashboard.getCurrentUserId(), item.Id);
|
||||
|
||||
|
@ -293,7 +307,7 @@
|
|||
if (!isPositionSliderActive) {
|
||||
|
||||
var ticks = startTimeTicksOffset + this.currentTime * 1000 * 10000;
|
||||
|
||||
|
||||
setCurrentTime(ticks, item, true);
|
||||
}
|
||||
|
||||
|
@ -698,6 +712,8 @@
|
|||
player.destroy();
|
||||
} else {
|
||||
elem.pause();
|
||||
|
||||
$(elem).trigger('ended');
|
||||
elem.src = "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue