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

Player error overwritten by empty poster error on Chromium browsers #8409

Closed
amtins opened this issue Aug 20, 2023 · 0 comments · Fixed by #8410
Closed

Player error overwritten by empty poster error on Chromium browsers #8409

amtins opened this issue Aug 20, 2023 · 0 comments · Fixed by #8410
Labels
needs: triage This issue needs to be reviewed

Comments

@amtins
Copy link
Contributor

amtins commented Aug 20, 2023

Description

On Chromium-based browsers, when the poster is not accessible, the media element returns an empty error.

As a result, when both the media URL and the poster return a response other than 200. The media error is overwritten by an empty error, leaving the player in an inconsistent state.

Two use cases generate this behavior:

  • When the resource selection algorithm is unable to determine the resource type. For example, this will be the case for resources coming from Azure Media Services Sample Streams, if the type is not specified
  • When a middleware is used for dynamic resource resolution

Steps to reproduce

  1. Open the URL
  2. Open the developer console
  3. Copy/paste/execute one of the cases below
// Case 1
player.on(player.tech(true).el(), 'error', ()=>console.log('Video Element Error', player.tech(true).el().error));
player.src('http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf)');
player.poster('https://vjs.zencdn.net/v/oceans.wrong.png');


// Case 2
videojs.use('fake/md', (player)=>{
  return {
    setSource(srcObj, next) {
      src = null; // Error calling the server            
      next(true, src);
    }
  }    
});

player.on(player.tech(true).el(), 'error', ()=>console.log('Video Element Error', player.tech(true).el().error));
player.src({src:'1337', type:'fake/md'});
player.poster('https://vjs.zencdn.net/v/oceans.wrong.png');

Errors

No response

What version of Video.js are you using?

v7.x, v8.x

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Chromium based browsers

What OS(es) and version(s) does this occur with?

All

@amtins amtins added the needs: triage This issue needs to be reviewed label Aug 20, 2023
amtins added a commit to amtins/video.js that referenced this issue Aug 20, 2023
When both the media URL and the poster return a response other than 200.
The media error is overwritten by an empty error, leaving the player in an inconsistent state.

- add a condition to `handleTechError_` to ensure that the `error` is truthy
- add a test case

Fixes videojs#8409
mister-ben pushed a commit that referenced this issue Sep 27, 2023
When both the media URL and the poster return a response other than 200.
The media error is overwritten by an empty error, leaving the player in an inconsistent state.

- add a condition to `handleTechError_` to ensure that the `error` is truthy
- add a test case

Fixes #8409
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: triage This issue needs to be reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant