mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update audio player
This commit is contained in:
parent
d3f216a01e
commit
84679843fe
3 changed files with 19 additions and 4 deletions
|
@ -49,6 +49,7 @@ define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], functio
|
|||
|
||||
self.play = function (options) {
|
||||
|
||||
_currentTime = null;
|
||||
var elem = createMediaElement();
|
||||
|
||||
var val = options.url;
|
||||
|
@ -87,6 +88,7 @@ define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], functio
|
|||
}
|
||||
|
||||
// Save this for when playback stops, because querying the time at that point might return 0
|
||||
var _currentTime;
|
||||
self.currentTime = function (val) {
|
||||
|
||||
if (mediaElement) {
|
||||
|
@ -95,6 +97,10 @@ define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], functio
|
|||
return;
|
||||
}
|
||||
|
||||
if (_currentTime) {
|
||||
return _currentTime * 1000;
|
||||
}
|
||||
|
||||
return (mediaElement.currentTime || 0) * 1000;
|
||||
}
|
||||
};
|
||||
|
@ -265,11 +271,16 @@ define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], functio
|
|||
};
|
||||
|
||||
events.trigger(self, 'stopped', [stopInfo]);
|
||||
|
||||
_currentTime = null;
|
||||
currentSrc = null;
|
||||
}
|
||||
|
||||
function onTimeUpdate() {
|
||||
|
||||
// Get the player position + the transcoding offset
|
||||
var time = this.currentTime;
|
||||
_currentTime = time;
|
||||
events.trigger(self, 'timeupdate');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue