polimediaupv/paella

Html5Video constructor nulls out its _posterFrame set by super()

Closed this issue · 0 comments

Describe the bug

Sometimes the poster frame does not show.

To Reproduce

Steps to reproduce the behavior:
Load a video that has a _stream.preview. The preview is not shown.

Additional context

The VideoElementBase sets the stream preview to the poster frame attribute. But classes that extends it sets it to null in their constructor after calling the super() on VideoElementBase.

class VideoElementBase extends paella.VideoRect {
constructor(id,stream,containerType,left,top,width,height) {
super(id, containerType, left, top, width, height);
this._stream = stream;
this._ready = false;
this._autoplay = false;
this._videoQualityStrategy = null;
if (this._stream.preview) this.setPosterFrame(this._stream.preview);
if (this.canvasData.mouseEventsSupport) {
this.disableEventCapture();
}
}

Example for Html5Video:

class Html5Video extends paella.VideoElementBase {
constructor(id,stream,left,top,width,height,streamName) {
super(id,stream,'video',left,top,width,height);
this._posterFrame = null;