1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-21 01:39:04 +02:00
video.js/test/unit
Alex Barstow eddda97eeb
feat: Add methods to add and remove <source> elements (#8886)
## Description
It is useful to have methods for appending and removing `<source>`
elements to the `<video>` element, as they are sometimes required to
enable certain playback features, for example, using [Airplay with
MSE](https://webkit.org/blog/15036/how-to-use-media-source-extensions-with-airplay).

## Specific Changes proposed
Add new methods-- `addSourceElement()` and `removeSourceElement()` to
the player and tech. The former will take a source object and create and
append a new `<source>` element to the `<video>` element, and the latter
will take a source url and remove any `<source>` element with a matching
`src`.

## 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](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
2024-10-09 12:16:04 -04:00
..
control-bar fix(skip-forward): error when clicking after player reset (#8258) 2023-05-31 10:30:49 -04:00
mixins Fix several typos in docs and comments (#8110) 2023-03-22 15:00:01 +01:00
tech feat: Add methods to add and remove <source> elements (#8886) 2024-10-09 12:16:04 -04:00
tracks fix: allow captions in devices that use old chrome to be shown (#8826) 2024-08-26 13:32:20 -06:00
utils fix(dom): handle slotted parent transform position (#8158) 2024-05-03 14:23:30 +02:00
autoplay.test.js feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761) 2022-11-23 09:49:23 -05:00
button.test.js fix: Reduce the multiple-announcement by screen readers of the new name of a button when its text label changes. (#5158) 2018-05-11 14:31:28 -04:00
clickable-component.test.js feat: easier configuration of buttons and components via options (#7611) 2022-03-21 12:21:26 -04:00
close-button.test.js refactor: Replace keycode dependency with event.key (#8735) 2024-05-23 18:50:23 +02:00
component.test.js fix: Change requestNamedAnimationFrame to apply last change per frame instead of first (#8799) 2024-08-13 10:54:53 +02:00
controls.test.js fix: progress bar sometimes is not filled on 100% (#8633) 2024-05-03 13:57:32 +02:00
error-display.test.js fix: error-display (#8529) 2024-01-30 11:32:58 -05:00
event-target.test.js test: memory leak fixes in tests (#5861) 2019-03-18 15:49:48 -04:00
events.test.js fix(jsdoc): corrections to jsdoc (#8277) 2023-05-31 11:12:57 -04:00
live-tracker.test.js feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761) 2022-11-23 09:49:23 -05:00
loading-spinner.test.js fix: Ensure additional components update on languagechange (#8175) 2023-04-04 16:54:36 -04:00
media-error.test.js feat: improved error interface (#8564) 2024-01-25 08:57:16 -06:00
menu.test.js feat: Add useSVGIcons option (#8260) 2023-06-12 13:31:06 -05:00
modal-dialog.test.js refactor: Replace keycode dependency with event.key (#8735) 2024-05-23 18:50:23 +02:00
play.test.js Fix several typos in docs and comments (#8110) 2023-03-22 15:00:01 +01:00
player-breakpoints.test.js feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761) 2022-11-23 09:49:23 -05:00
player-fullscreen.test.js refactor: Replace keycode dependency with event.key (#8735) 2024-05-23 18:50:23 +02:00
player-loadmedia.test.js feat: Add loadMedia and getMedia methods (#5652) 2019-01-03 13:49:34 -05:00
player-play.test.js fix: replay button broken for native playback (#8142) 2023-03-06 10:32:14 -08:00
player-user-actions.test.js fix: Don't request fullscreen from document PIP window (#8881) 2024-10-06 07:50:03 +02:00
player.test.js feat: Add methods to add and remove <source> elements (#8886) 2024-10-09 12:16:04 -04:00
plugin-advanced.test.js feat: Add a default, plugin-specific logger to advanced plugins (#6693) 2020-07-10 11:59:04 -04:00
plugin-basic.test.js feat: Add 'beforepluginsetup' event and named plugin setup events (e.g. 'pluginsetup:foo') (#4255) 2017-05-11 17:13:22 -04:00
plugin-static.test.js chore(test): silence plugin warning from test (#4173) 2017-03-07 14:13:19 -05:00
poster.test.js fix: Remove img el when there's no poster source (#8130) 2023-02-20 10:04:39 +01:00
reset-ui.test.js fix(title-bar): component remains displayed after player reset (#8481) 2023-11-29 10:36:56 +01:00
resize-manager.test.js fix(resize-manager): Prevent tabbing into RM and hide from Screen Readers (#5754) 2019-01-22 16:36:20 -05:00
seek-to-live.test.js feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761) 2022-11-23 09:49:23 -05:00
setup.test.js chore: Remove safe-json-parse (#8790) 2024-08-11 08:21:10 +02:00
sourceset.test.js fix(player): techGet is undefined (#8256) 2023-05-31 10:29:35 -04:00
spatial-navigation.test.js fix: ensure spatial navigation starts without error without an ErrorD… (#8830) 2024-08-22 17:07:41 +02:00
test-helpers.js fix: Improves isSingleLeftClick() to handle mousemove (#6138) 2019-07-29 17:45:40 -04:00
title-bar.test.js feat: add a new title bar component (#7788) 2022-11-23 09:49:25 -05:00
transient-button.test.js feat: Adds a transient button component (#8629) 2024-07-06 07:40:31 +01:00
video.test.js fix: make compatible with chrome 53 (#8354) 2023-07-12 19:43:17 +02:00
videojs-hooks.test.js Fix several typos in docs and comments (#8110) 2023-03-22 15:00:01 +01:00
videojs-integration.test.js refactor: rename fn.bind to fn.bind_ to strongly indicate it should not be used externally (#7940) 2022-11-23 09:49:32 -05:00