bartbutenaers / node-red-dashboard-2-ui-video

A Node-RED node for playing video in dashboard D2
Apache License 2.0
1 stars 0 forks source link

Unable to set poster dynamically #21

Open bartbutenaers opened 2 months ago

bartbutenaers commented 2 months ago

Test feedback from Kevin:

In my setup, I am dynamically generating the jpeg ready poster and mp4 video. The poster is created before the video, since ffmpeg is able to output the jpeg before having enough data to create mp4 segments. I am unable to get the readyPoster to show because the video player seems to be in an errored state due to Video element error (code 4): MEDIA_ELEMENT_ERROR: Empty src attribute. It will show the error poster in that case

Kevin analyzed it afterwards and figured out it was caused by this if-statement in the mounted event handler:

     // should this be an error???
      if (!this.getProperty("url")) {
        this.videoPlaybackProblem = true
      }

Changing it to this.videoPlaybackProblem = false solves the problem. But then I get the ready poster if no url has been defined and autoplay is false, which is not correct (because then no video playback is possible)...