mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 10:53:39 +01:00
Fix seek to a new time in youtube video does not work when pause action happens instantly after it
This commit is contained in:
parent
126bab8146
commit
58077a60f1
@ -289,10 +289,18 @@ var et2_video = /** @class */ (function (_super) {
|
||||
* Pause video
|
||||
*/
|
||||
et2_video.prototype.pause_video = function () {
|
||||
var _this = this;
|
||||
if (this._isYoutube()) {
|
||||
if (this.youtube.pauseVideo) {
|
||||
this.youtube.pauseVideo();
|
||||
this.currentTime(this.youtube.getCurrentTime());
|
||||
if (this.youtube.getCurrentTime() != this._currentTime) {
|
||||
// give it a chance to get actual current time ready otherwise we would still get the previous time
|
||||
// unfortunately we need to rely on a timeout as the youtube seekTo not returning any promise to wait for.
|
||||
setTimeout(function (_) { _this.currentTime(_this.youtube.getCurrentTime()); }, 500);
|
||||
}
|
||||
else {
|
||||
this.currentTime(this.youtube.getCurrentTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -453,7 +453,16 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
|
||||
if (this.youtube.pauseVideo)
|
||||
{
|
||||
this.youtube.pauseVideo();
|
||||
this.currentTime(this.youtube.getCurrentTime());
|
||||
if (this.youtube.getCurrentTime() != this._currentTime)
|
||||
{
|
||||
// give it a chance to get actual current time ready otherwise we would still get the previous time
|
||||
// unfortunately we need to rely on a timeout as the youtube seekTo not returning any promise to wait for.
|
||||
setTimeout(_=>{this.currentTime(this.youtube.getCurrentTime());},500);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.currentTime(this.youtube.getCurrentTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user