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

fix: Remove img el when there's no poster source #8130

Merged
merged 2 commits into from
Feb 20, 2023

Conversation

mister-ben
Copy link
Contributor

Description

If there is no poster source, an img el can't be present as it would be invalid.

Specific Changes proposed

Use a div (again) as the top level element of the PosterImage, to keep position in the DOM. Insert/remove the picture/img els when a poster source is set/unset.
Fixes #8122

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@codecov
Copy link

codecov bot commented Feb 13, 2023

Codecov Report

Merging #8130 (4580437) into main (b306ce6) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #8130      +/-   ##
==========================================
+ Coverage   82.00%   82.02%   +0.02%     
==========================================
  Files         110      110              
  Lines        7339     7344       +5     
  Branches     1770     1773       +3     
==========================================
+ Hits         6018     6024       +6     
+ Misses       1321     1320       -1     
Impacted Files Coverage Δ
src/js/poster-image.js 78.26% <100.00%> (+2.65%) ⬆️
src/js/tracks/text-track.js 94.87% <0.00%> (+0.64%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/js/poster-image.js Show resolved Hide resolved
src/js/poster-image.js Outdated Show resolved Hide resolved
@mister-ben mister-ben merged commit a27ee05 into videojs:main Feb 20, 2023
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
* fix: No invalid img el with no poster source

* move dom changes into setSrc
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

Successfully merging this pull request may close these issues.

[v8] Empty src attribute of the img element when no poster is added
2 participants