Closed icyield closed 5 years ago
this._endOnLastSourceEnd
is set via the option: options.endOnLastSourceEnd
Are you finding that you can't set that option?
I can set the option and of course it works. But the default option is ignored.
Ah yes, I see what you mean.
The constructor has defaults for each options, which are only used if no options are passed
constructor(
...
options = {
preserveDrawingBuffer: true,
manualUpdate: false,
endOnLastSourceEnd: true,
useVideoElementCache: true,
videoElementCacheSize: 6,
webglContextAttributes: {
preserveDrawingBuffer: true,
alpha: false
}
}
)
A member endOnLastSourceEnd
is set to true, but not used internal to this class and not updated for users of this class [bug number 1]
{
this._canvas = canvas;
let manualUpdate = false;
this.endOnLastSourceEnd = true;
...
options.endOnLastSourceEnd
is set internallyoptions
are provided a default is usedoptions.endOnLastSourceEnd
is undefined (defaults to falsey) [bug number 2]
...
if ("manualUpdate" in options) manualUpdate = options.manualUpdate;
if ("endOnLastSourceEnd" in options) this._endOnLastSourceEnd = options.endOnLastSourceEnd;
And you're experiencing bug number 2?
I opened a PR to update how the options default are handled. #139
Awesome, thanks @gsouquet
@icyield Did that solve your issue? I guess we can close this issue now.
Shall close now. Feel free to reopen @icyield
I presume that this._endOnLastSourceEnd in videocontext.js (line 880) should in fact be this.endOnLastSourceEnd.
this._currentTime += dt * this._playbackRate; if (this._currentTime > this.duration && this._endOnLastSourceEnd) { //Do an update od the sourcenodes in case anything in the "ended" callbacks modifes currentTime and sources haven't had a chance to stop.