Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paella 7 can fail is there is no default Image set #190

Closed
mliradelc opened this issue Mar 8, 2023 · 1 comment
Closed

Paella 7 can fail is there is no default Image set #190

mliradelc opened this issue Mar 8, 2023 · 1 comment

Comments

@mliradelc
Copy link
Contributor

mliradelc commented Mar 8, 2023

Hi,

We found this bug in Opencast*, but after research. I found that the code in paella core also is affected over this potential error.

*Live streaming is not load in Paella 7 because there is no default preview image.

What is the error,

If the media doesn't have videoPreviewand videoPreviewPortrait and is not set in config.json a default value (defaultVideoPreviewPortrait and defaultVideoPreview) paella will fail to load the media.

The potential error is here:

function buildPreview() {
const preview = (this.videoManifest?.metadata?.preview && resolveResourcePath(this, this.videoManifest?.metadata?.preview)) || this.defaultVideoPreview;
const previewPortrait = (this.videoManifest?.metadata?.previewPortrait && resolveResourcePath(this, this.videoManifest?.metadata?.previewPortrait)) || this.defaultVideoPreviewPortrait;
this._previewContainer = new PreviewContainer(this, this._containerElement, preview, previewPortrait);
}

Suggested fixes:

  1. Add a catch to continue with the player load even if the preview image are not available.
  2. Add a function to generate a preview SVG file if there is manifest data (Title, author, etc).

I think the two suggestions can be implemented simultaneously. What are your thoughts?

@ferserc1
Copy link
Collaborator

As stated in the documentation, this is not a bug, it is the normal behaviour. It is mandatory to always have a preview image, because due to browser security settings, autoplay may not be available, even for live videos.

The first solution you propose is not feasible, because if the browser blocks autoplay, in some situations it can cause usability problems.

As for the second solution, I don't understand why you find this option better than simply defining a default image in the configuration, as the solution you propose also depends on having metadata available, whereas the default preview image always works.

If you are still interested in implementing the second option, you could do so without modifying paella-core, by overriding some of the initialisation functions to provide a data URL in the defaultVideoPreview and defaultVideoPreviewPortrait fields. It is easy to generate an image from text using an HTML Canvas, from which you can get a data URL that you could place in these fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants