1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-04 10:34:51 +02:00
Commit Graph

639 Commits

Author SHA1 Message Date
Marco Del Toro Barragan
a0d09c107a
feat: trigger languagechange event on a language change (#6891) 2020-11-10 18:09:37 -05:00
Tim Gates
f22ead10f0
docs: Fix simple typo, intial -> initial (#6851)
There is a small typo in src/js/player.js, src/js/tech/html5.js, test/unit/sourceset.test.js.

Should read `initial` rather than `intial`.
2020-09-22 14:38:19 -04:00
Samuel Burbano
c4c8fc1caf fix: Better mouse position handling (#5773)
This uses offsetX and offsetY on the MouseEvents which helps account for transforms on the player. Unfortunately, this isn't available on TouchEvents, so, while this helps desktop devices with using a mouse, it doesn't help mobile devices using touch.

Fixes #6726, fixes #1102.
2020-08-31 12:32:57 -04:00
Gary Katsevman
94bea3502e
fix: limit fastSeek to Safari based browsers only (#6752)
Fixes #6722
2020-07-13 12:00:17 -04:00
Ileana Padilla
3d505ef0c5
feat: add debug mode (#6687)
When `debug(true)` is called, it will fire a `debugon` event that plugins and components can then use to do extra logging or anything else that's helpful to for debugging. It will also set the log level to debug.

When `debug(false)` is called, it will fire a `debugoff` event that plugins and components can then use to stop doing extra logging or helpful debugging. It will reset the log level to whatever it was previously.

Co-authored-by: ipadilla4 <ipadilla@brightcove.com>
2020-07-10 12:24:58 -04:00
Pat O'Neill
f6a66e62de feat: Add a default, plugin-specific logger to advanced plugins (#6693) 2020-07-10 11:59:04 -04:00
Gary Katsevman
6d2e52ab83
test: skip requestPictureInPicture test if API isn't available (#6719) 2020-06-19 15:09:25 -04:00
Brandon Casey
6e7cc75aaa feat: Add named requestAnimationFrame to prevent performance issues (#6627)
Make sure we don't create multiple rAFs particularly when in a background tab.

Fixes #5937
2020-06-19 14:50:39 -04:00
mister-ben
907d1cd730
fix: Disable PIP if tech doesn't support it (#6678)
The requestPictureInPicture API and button currently assume thta if the browser supports the PIP API, the tech supports it. This results in a broken button with certain techs, such as youtube or HTML5 with an audio el.

Checks if disablePictureInPicture is exactly false. If true it's disabled and if undefined the tech does not support it.

Fixes #6398.
2020-06-19 14:36:43 -04:00
mister-ben
0b91f74260
fix: addChild with index should allow for children that are elements (#6644)
The fix in #6297 doesn't work where the child to insert before is an element rather than a component, e.g. the video element.
Check if the child to insert before is an element, as well as checking if it has an el_
2020-05-26 17:00:23 -04:00
Gary Katsevman
a4ea1f9657
fix(text-tracks): set withCredentials on XHR if crossOrigin='use-credentials' (#6588)
Fixes #6587
2020-04-22 16:39:01 -04:00
Grzegorz Blaszczyk
dbd5203a0b
feat: adds disablePictureInPicture method to the player API. (#6378) 2020-04-22 12:41:21 -04:00
Gary Katsevman
8c66c58346
feat: support fastSeek during scrubbing if available (#6525)
This will allow us to use iframe playlists on HLS on Safari browsers and eventually, add support in VHS.
2020-04-22 12:40:26 -04:00
Brandon Casey
47ba7040b0
feat: Add a function for getting descendants from components (#6519) 2020-03-30 17:39:23 -04:00
Brandon Casey
668c7f44d6
fix(liveui): tweaks to prevent jitter (#6405) 2020-03-30 17:27:45 -04:00
Marco Garay
768adb1200
feat: Improve currentTime to allow it to be called before player is ready (#6507)
In the cases where the player isn't ready, or we are in the middle of changing sources, we will wait for `canplay` and then seek to the provided time without requiring Video.js users to handle this themselves.

Co-authored-by: Marco Garay <mgaray@brightcove.com>
2020-03-25 17:54:51 -04:00
Gary Katsevman
52c181ddb0
fix: trigger change events on remoteTextTrack when nativeTextTrack is set to true (#6410)
It seems we have never triggered change events on remoteTextTrack when we were using native text tracks. This was a problem for VHS, which exclusively uses text tracks.
This makes it so we do trigger the event. Main issue with this change is that it creates a potential for a false positive where a change event was triggered from a non-remote text track but the remoteTextTrack list still received a change event. This issue is mitigated by best practices of looping through the list looking for the modes that you care about.

Co-authored-by: Kevin Kipp <kevin.kipp@gmail.com>
Co-authored-by: Kyle Boutette <kyleveB@gmail.com>
2020-03-12 11:26:09 -04:00
Brandon Casey
47349c8e29
fix: add a threshold of 30s for the liveui to show (#6409) 2020-03-10 15:53:17 -04:00
Gary Katsevman
8a205d049e
refactor: support requestFullscreen's promise, better internal handling of events (#6422) 2020-01-31 15:59:12 -05:00
Gary Katsevman
25d15d4b14
fix(extend): super_ should be available for backwards compatibility (#6329)
Fixes #6328
2019-11-22 12:32:18 -05:00
Grzegorz Blaszczyk
ccca846da8 feat: resets pastSeekEnd_ variable. (#6249)
* feat: resets pastSeekEnd_ when its value is much higher than seeking increment.

* fixes unit tests
2019-11-15 13:44:34 -05:00
mister-ben
f7b3772e27 fix: ensure components added with an index are added in the correct location (#6297) 2019-11-14 15:22:42 -05:00
Pat O'Neill
29638b7969 fix: ensure the default ID of the first player is 'vjs_video_3' as some people have relied on this (#6216)
When a player is created without an id on the embed code, Video.js automatically assigns it one based on an auto-incrementing number (a.k.a. a GUID). For the longest time, this has happened to result in the default id of the first player being vjs_video_3.

It was never intended for users to rely on this value being consistent, but users do strange and inadvisable things.

PR #6103 had an unintended side effect in that it changed the default id to vjs_video_2, which we worry could affect some users of Video.js.
2019-11-07 17:21:52 -05:00
Brandon Casey
4134a9734b test: run tests via rollup (#5601) 2019-08-30 14:56:41 -04:00
Pat O'Neill
064fcafd44 feat: add isDisposed method to components (#6099) 2019-08-29 18:42:15 -04:00
Brandon Casey
5fa4257b91 feat: cap log history at 1000 items (#6192) 2019-08-29 17:32:34 -04:00
Brandon Casey
99b610bd92 perf: only update ui on change, wrap things in requestAnimationFrame (#6155) 2019-08-29 17:02:56 -04:00
mister-ben
f7185bad9e feat: allow a click handler to be specified in clickable component's options (#6140) 2019-08-29 16:46:49 -04:00
Grzegorz Blaszczyk
f324d1f23c Allows middleware to handle muted setter/getter (#6177) 2019-08-29 16:42:42 -04:00
Grzegorz Blaszczyk
714aba0ca8 fix: make live UI button more consistent (#6201)
Use a simple moving average for setting the seekableIncrement value, which is used to determine whether we're at the live edge of nor.
2019-08-28 13:41:32 -04:00
Pat O'Neill
51b9861d5b fix: do not handle hotkeys in contenteditable elements (#6182)
Exclude elements where `el.isContentEditable == true;` for hotkeys.
2019-08-19 14:57:15 -04:00
Brandon Casey
9d2e5f3f7a test: silence test logs (#6165) 2019-08-07 17:36:55 -04:00
Brandon Casey
5ee247762e perf: Do not add/remove listeners for each timer (#6144) 2019-08-07 16:11:24 -04:00
Brandon Casey
266cb151fa perf: Improve performance of toTitleCase, register with lower and TitleCase (#6148) 2019-08-07 16:05:41 -04:00
Brandon Casey
8610f99673 perf: Use WeakMap for dom data (#6103) 2019-08-01 14:26:59 -04:00
Grzegorz Blaszczyk
f2aedb72ec fix: Improves isSingleLeftClick() to handle mousemove (#6138)
Fixes #6132
2019-07-29 17:45:40 -04:00
Brandon Casey
3c932c5f8e refactor: use the new any event function (#6080) 2019-07-29 17:21:42 -04:00
Gary Katsevman
10ed08a15a
refactor(pip): rely only on WICG spec events (#6064)
The WICG spec calls out only two events, enterpictureinpicture and
leavepictureinpicture. We should try and only use those.
If pictureinpicturechange is still necessary, it can be re-added at a
later date.
2019-06-20 15:11:21 -04:00
mister-ben
5a538c3caf feat: add option to suppress initial error for non-playable sources (#6057)
Video.js checks whether sources are playable and both displays a message to the user and logs an error to the console. In Google's mobile friendly test and related tools, this message and error is triggered because their test browser's video element does not support any video formats. Some Video.js users are concerned about the æsthetics of the rendered preview within the tools and whether this might have an SEO impact.

Adds a suppressNotSupportedError option, defaulting to false. If set to true, if no sources are playable the error is deferred to the first human interaction (click or touchstart) but cleared if a loadstart occurs.
2019-06-20 14:00:12 -04:00
Pat O'Neill
70ba84eb6a fix(liveui): do not seek to live on first seek when autoplaying a live stream (#6062)
Before listening for the play/timeupdate combination when starting the LiveTracker, check if the player has already started playback.
2019-06-20 13:56:00 -04:00
François Beaufort
116d84af75 feat: add built-in Picture-in-Picture button (#6002)
Adds a new PictureInPictureToggle component in the controls bar of the player. It depends on videojs-font 3.2.0 (videojs/font#41) for icons.

Final spec piece from #5824.
2019-06-18 16:42:02 -04:00
Grzegorz Blaszczyk
f5fd94f610 fix: handle esc key properly inside of the CloseButton (#6050) 2019-06-18 16:23:26 -04:00
Gary Katsevman
2977d52592
refactor: switch to fullscreen.options (#6054) 2019-06-17 16:51:28 -04:00
Austin Morton
631ac3b68d feat(fs): support FullscreenOptions (#5856)
On browsers that implement the Unprefixed Fullscreen API, pass a FullscreenOptions dictionary to requestFullscreen.

Add `fullscreenOptions` option with default value of `{navigationUI: 'hide'}` to player.
See https://fullscreen.spec.whatwg.org/#dictdef-fullscreenoptions
2019-06-17 14:05:22 -04:00
Brandon Casey
2878c1d0d4 feat(events): add any function (#5977)
This new events function allows you to listen to a list of events and know that only one handler will ever be called for the group. With just one event, it'll function similarly to `.one`.
Examples:
Single event
```
const player = videojs('some-player-id');

player.any('a', (e) => console.log(e.type + ' triggered');

player.trigger('a');
// logs 'a triggered'

player.trigger('a');
// logs nothing as the listener has been removed.
```
Multiple Events
```
const player = videojs('some-player-id');

player.any(['a', 'b', 'c', 'd'], (e) => console.log(e.type + ' triggered');

player.trigger('d');
// logs 'd triggered'

player.trigger('a');
player.trigger('b');
player.trigger('c');
player.trigger('d');
// all triggers above log nothing as the listener is removed after the first 'd' trigger.
```
2019-06-17 14:04:25 -04:00
Pat O'Neill
79eadac252 fix: make sure hotkeys are not triggered outside the player or in form fields within the player (#5969) 2019-06-10 16:15:24 -04:00
Alex Barstow
5a7fe48b07 fix: group subtitles and captions when switching tracks (#6008)
This fixes a regression created by #5741.
2019-06-10 16:15:23 -04:00
Brandon Casey
a55c51fd59 test: restore prototype modifications and fix flaky tests (#5964) 2019-04-29 12:01:37 -04:00
Gary Katsevman
c59ba5f465
chore(test): upgrade to latest sinon (#5954)
Fixes #5953
2019-04-24 10:22:48 -04:00
Owen Edwards
322dae44b5 feat(middleware): allow middleware to handle volume setter and getter (#5906)
Allow middleware to handle volume setter and getter. This supports things like ducking the playback volume programmatically, without affecting the player's UI volume control.
2019-04-23 13:42:52 -04:00
Evan Farina
5973a62f67 fix: call reset if we are paused or no promises, otherwise wait for play promise to resolve (#5876)
Calling video.load while the video is trying to play (that is between play and playing event) throws an error. Instead, just wait for playback to happen before resetting.

Fixes #5875
2019-04-11 15:53:31 -04:00
Brandon Casey
ad53b80b8a fix: correctly resolve play promise when terminated via middleware (#5895) 2019-04-11 14:29:27 -04:00
Brandon Casey
3dc6fbf6e7 fix: fix audio and video track selection (#5890)
Fixes #5887
2019-03-25 12:02:33 -04:00
Brandon Casey
142cc678cb perf: Fix memory leaks in safari, edge, and ie (#5880)
1. We were not always able to clean up `resize` on the `ResizeManager`, as the iframe
contentWindow can disappear before dispose
2. Native Tracks on Safari do not have an `off` so we have to deal with
event listeners manually

Fixes #5878
2019-03-22 12:03:52 -04:00
Brandon Casey
6e173b017f test: check dom-data to verify we aren't leaking memory and event handlers (#5862) 2019-03-19 15:05:48 -04:00
Brandon Casey
23a36f338b test: memory leak fixes in tests (#5861) 2019-03-18 15:49:48 -04:00
Evan Farina
e248286fb6 fix: ensure that durationDisplay and remainingTimeDisplay exist before calling their 'updateContent' method during reset() (#5839)
The resetProgressBar_ method was calling 'updateContent' on the durationDisplay and remainingTimeDisplay controls without checking to make sure they exist

Fixes #5838
2019-03-18 14:54:14 -04:00
Gary Katsevman
f8b7dd4ed3
fix: if play is delayed till loadstart, call load (#5822)
In Safari, if we call play early and we are going to be waiting till
loadstart, it's possible this will take too long for the user activition
flag to still be available. In this case, we should call load() on the
player to prime the video element so for when loadstart happens.
2019-03-18 14:33:55 -04:00
Liu Ruen-shen
259ce71ee7 fix: remove event handlers when menu item is removed (#5748) 2019-01-25 14:26:36 -05:00
Evan Farina
d94771f9bd fix(resize-manager): Prevent tabbing into RM and hide from Screen Readers (#5754)
The ResizeManager's iframe element is able to be focused via tabbing, which results in a bad user experience for users that rely on a screen reader to navigate the video and its sibling elements. The fix is to set the tabIndex to "-1", and the aria-hidden property to true for good measure.
2019-01-22 16:36:20 -05:00
Pat O'Neill
b27f71347e fix: TextTrackMenuItem components should not disable text tracks of different kind(s). (#5741) 2019-01-10 14:24:15 -05:00
Henrique Lima
175f773253 feat: reset player ui on Player#reset (#5684)
Fixes #4683
2019-01-08 14:15:51 -05:00
dustin71728
dd63cf94d5 fix: remove child from old parent when moving to new parent via addChild (#5702)
A child component may have been assigned to another
parent before assigning that child component to the
new parent via "addChild" method. In this case, the
original parent should remove the child then it can
be safely added back to the new parent. This commit
will keep the parent's "children_" and its DOM
element's child nodes in the consistent state.
2019-01-08 14:14:46 -05:00
Pat O'Neill
4c9e09d460 fix: make sure sources, volume, and playback rate are reset along with the player (#5676)
Clear out the player cache_ on reset.

Fixes #5675
2019-01-03 15:14:54 -05:00
Tiago Fragoso
b02181b9fc feat: Add vjs-touch-enabled class for touch supporting devices (#5663)
Fixes #2999
2019-01-03 13:50:48 -05:00
Pat O'Neill
874cc21a4e feat: Add loadMedia and getMedia methods (#5652)
`loadMedia` accepts a MediaObject and an optional ready handler. It'll reset the player -- including text tracks, poster, and source -- before setting the new provided media, which include sources, poster, text tracks.
`getMedia` will return either the provided media object or the currently set values for sources, text tracks, and poster.

Fixes #4342
2019-01-03 13:49:34 -05:00
JoaoAlves
6ebc7727ef fix: Control-bar autohide when cursor placed over it #5258 (#5692)
Listen to 'mouseenter' and 'mouseleave' events when triggered in the control-bar and temporarily sets inactivity timeout to zero before restoring it.

Closes #5258
2018-12-26 13:03:36 -05:00
Brandon Casey
13b42ad05d test: verify null-checks with player and control bar children set to false (#5670) 2018-12-11 14:23:13 -05:00
Brandon Casey
dce4a2c7d4 fix(liveui): make edge detection less strict, add docs for option (#5661)
Use double the seekable increment for live edge detection.
Add liveui option.
2018-12-10 14:13:56 -05:00
Brandon Casey
831961b373 fix(liveui): seek to live should be immediate and other tweaks (#5650)
- Make sure that we seek to live playback on the first timeupdate
- Do not report that we are not live before playback has started (a timeupdate has been seen)
- Prevent negative seekable increments
- We can seek past the seekable value in the video element, so we use that to seek to live, rather than waiting for a seekable end change.
2018-12-06 15:15:18 -05:00
Brandon Casey
2974ad3db7 feat: support seeking during live playback via liveui option (#5511)
When liveui is enabled, allow seeking during the live window, add button that allows you to seek to the live edge and that indicates whether you are at the live edge or not.
2018-12-03 15:31:23 -05:00
Alex Barstow
8329e64e6f fix: default subtitles not enabled (#5608)
This is a follow-up to this fix in VHS, after which default in-manifest subtitles were still not being correctly enabled. The reason is because Video.js's text track preselection logic was running before the media groups were set up in VHS.

Text track preselection should happen on `loadedmetadata` instead of `loadstart`. According to the HTML spec, text track data is available on `loadedmetadata`, so we should be waiting until then to make preselection decisions.
2018-11-29 14:03:51 -05:00
Brandon Casey
6c1056b665 chore: fix travis build (#5627)
Disable running tests in Firefox on Travis for regular PRs as it wasn't the case previously and is broken for some reason. We'll follow up in the future in #5626.

Update .travis.yml based on their latest infrastructure and new npm caching method.

Silence logging of sourceset test sources.

Closes #5616
2018-11-28 17:25:59 -05:00
Gary Katsevman
c1cbce386d
fix(tracks): don't select tracks based on user pref if no langauge is set (#5556)
When preselecting a new track based on user preference, make sure that the language is actually set and that the track we're testing is either a captions or a subtitles track.

Fixes #5553
2018-11-06 16:36:15 -05:00
Grzegorz Blaszczyk
f1784587f6 feat: add 'replay' option to the PlayToggle component. (#5531)
The `PlayToggle` has one option `replay` which can show or hide replay icon. This can be set by passing `{replay: false}` as the default behavior replay icon is shown after video end playback.

Example of how to hide a replay icon
 ```js
let player = videojs('myplayer', {
  controlBar: {
    playToggle: {
      replay: false
    }
  }
});
```

Fixes #4802
2018-11-02 16:47:52 -04:00
Garrett Singer
0060747d5a fix: Don't remove vjs-waiting until time changes (#5533)
Sometimes the vjs-waiting class is removed prematurely after the player gets into a waiting state. This removes the graphic waiting spinner while the player is still waiting. Instead, we should make sure that the currentTime has updated before removing the spinner.
2018-11-02 16:43:32 -04:00
Brandon Casey
8bf42064f3 fix: blob urls being ignored as valid sources (#5525)
Instead of checking for blob urls in the generic updateSourceCaches method, check for blob urls inside of handleTechSourceset before updating the source cache.

Fixes #5504.
2018-10-25 18:56:56 -04:00
Pat O'Neill
6df3ac78d4 feat: Add responsive option, which enables breakpoints support. (#5496)
Follow-up for #5471

This makes the breakpoints option and `breakpoints()` method clearer and introduces the responsive option and `responsive()` method, which will turn on the breakpoints.

The return value of `currentBreakpoint()` was simplified to only ever return a string (empty if none).

Also, added convenience methods: `responsive()`, `getBreakpointClass()`, and `currentBreakpointClass()`.
2018-10-11 17:03:33 -04:00
Pat O'Neill
51bd49f4bc feat: Add breakpoints option to support toggling classes based on player width. (#5471)
This adds a breakpoints option. By default, this option is false meaning this is an opt-in feature.

When passing true, it will use a default set of breakpoints. Or custom breakpoints can be passed if users do not like our breakpoints (or previously-existing style decisions).

- Add breakpoints option.
- Adds some new (currently unused) classes: vjs-layout-medium, vjs-layout-large, vjs-layout-x-large, and vjs-layout-huge.
- Add updateCurrentBreakpoint and currentBreakpoint methods to the player.
- Update css/components/_adaptive.scss
- Add sandbox/responsive.html.example

Closes videojs/video.js#4371
2018-10-10 15:30:20 -04:00
Gary Katsevman
ca09968b7d
feat(fill): make vjs-fill a player mode (#5478)
Like fluid mode, you can enable it with the class or by calling the fill
method. Calling fill() will turn off fluid mode and calling fluid() will
turn off fill mode.

Fluid mode takes precedence over fill mode.
2018-10-05 14:28:09 -04:00
Gary Katsevman
966eb56c02
feat: createLogger for easier logging in individual modules (#5418)
Create a new createLogger module for better debugging. Each logger has its own log level and its own createLogger that will nest logs underneath them. `player.log` is also included, which logs the player id as part of the log statement. The history API also got a filter method.

For example:
```js
var log = videojs.log.createLogger('foo');
log('hello');
// > VIDEOJS: foo: hello
```
2018-09-28 16:52:58 -04:00
Pat O'Neill
ebf8d6671c docs: Update JSDoc comments, so core API docs for the videojs function are accurate. (#5385) 2018-09-28 16:21:18 -04:00
Gary Katsevman
6bff3ce779
fix(vjsstandard): update to 8.0.2 and fixup linting (#5413) 2018-09-28 14:58:15 -04:00
Gary Katsevman
15df4e16b4
fix(text-tracks): cuechange handler not triggering correctly (#5446)
We were only triggering cuechange events if a metadata track started out as not disabled or only when setting the mode to 'showing'

Fixes #5308
2018-09-25 14:42:58 -04:00
Brandon Casey
58405fdf78 fix: always return a promise from play, if supported (#5227)
If Promise is available or if Promise is polyfilled, then we'll return a new Promise from `play()` that will get fulfilled with the value returned from the `play()` method. This means that on IE11, this promise will get resolved when we call `play()` even if play doesn't succeed. We will have a follow-on PR to polyfill this behavior and resolve or reject the promise for browsers like IE11 that don't return a promise from `play()`.
2018-08-10 16:27:05 -04:00
Gary Katsevman
8c92cbfb3e
feat: async change events in TextTrackList with EventTarget#queueTrigger (#5332)
Trigger the change event on the next tick. This means that multiple changes to a track's mode will only result in a single change event on its associated TextTrackList rather than 3 events as it may be currently.

Fixes #5159
2018-07-25 17:33:30 -04:00
Gary Katsevman
781a6d87c6
feat(middleware): make setSource be optional (#5295)
setSource is useful if you care to be fiddling with the source or doing some work depending on what source is set. However, sometimes, you don't need a setSource and want the middleware to always be selected.
Now, if setSource is missing, it will implicitly be included in the middleware chain.
2018-07-06 14:16:16 -04:00
Gary Katsevman
361dc76e12
revert: "fix: Allow evented objects, such as components and plugins, to listen to the window object in addition to DOM objects. (#5255)" (#5301)
This reverts commit 7fd29b4f18.

With this change, playing back HLS content via VHS caused an infinite
event loop to be printed out. See issue #5281
2018-07-06 13:51:22 -04:00
Gary Katsevman
d7f27b7112
perf: setTimeout and requestAnimationFrame memory leak (#5294)
Our setTimeout and requestAnimationFrame methods added dispose handlers so that they get cancelled if the component is disposed before they get a chance to run. However, we were only clearing out these dispose handlers if we cleared the timeout or the rAF manually. Instead make sure that we remove the dispose handler when it is no longer needed.

Fixes #5199.
2018-07-05 16:29:03 -04:00
Darius Oleskevicius
237041698c feat: show mute toggle button if the tech supports muting volume (#5052)
Currently, VideoJS combines volume control with muted support, and these actions aren't actually the same. Muting/unmuting volume work independently from the volume control. For example, iOS doesn't support controlling volume programmatically but allows muting/unmuting volume.

This change will display the volume control panel and mute toggle button if the tech supports muting volume. The volume slider will continue to be hidden if the platform doesn't allow programmatically control volume. If neither muting nor control volume is supported, volume panel will not be displayed.

Fixes #4478.
2018-06-21 14:33:08 -04:00
Brandon Casey
e8e4fe2745 feat(autoplay): extend autoplay option for greater good (#5209)
This PR extends the `autoplay` to the player with a few options that should hopefully make working with browsers that disable unmuted autoplay by default easier.
The current boolean option will match current behavior and any unknown option will be treated as it does now. The new options are the string values `muted`, `play`, and `any`.

- `muted` will mute the element and call `play()` on `loadstart`,
- `play` will call `play()` on `loadstart()`, this is similar to the `autoplay` attribute
- `any` will call `play()` on `loadstart()` but if it fails it will try muting the video and calling `play()` again.
2018-06-21 14:32:07 -04:00
Phil Richman
e92f177ce2 feat(text-track-display): Extend the constructColor function to handle 6 digit hex codes (#5238)
When providing the TextTrackDisplay component with track settings overrides, currently colour codes with only three digits are supported. This updates it so that 6 digit hex codes are also accepted.
2018-06-21 14:20:12 -04:00
Pat O'Neill
7fd29b4f18 fix: Allow evented objects, such as components and plugins, to listen to the window object in addition to DOM objects. (#5255)
the bug is that objects using the new-ish evented mixin cannot listen to the window object, preventing things like:

```
component.on(window, 'scroll', throttledListener);
```

This fixes that so anything that's a native EventTarget works.
2018-06-20 17:05:33 -04:00
Chuck Wilson
9504a93643 fix: make sure source options are passed through (#5241)
The changes to source caching in #5156 introduced a regression where the source options were no longer available to plugins. This PR makes sure the cached source object retains any source options passed along.
2018-06-11 13:47:36 -04:00
Gary Katsevman
954f3d979f
fix(player): video-js embed missing video-js class (#5194)
When having a video-js embed with a class attribute, as part of the
changes to remove old IE support (#5041), we overwrote our addition of
the video-js class when it was missing. Instead, we want to make sure
that we don't override the class names again since they are already set
up correctly.

Fixes videojs/http-streaming#100
2018-05-22 21:44:35 -04:00
Brandon Casey
22fd327076
tests: do not throw on tech/player dispose (#5179) 2018-05-16 12:02:41 -04:00
Owen Edwards
1c74e4fa0b fix: Reduce the multiple-announcement by screen readers of the new name of a button when its text label changes. (#5158)
Move the aria-live attribute to the control text element within buttons, rather than on the whole button, so it is not affected by the change of the title attribute, only by the change of the control text.

It seems like having aria-live on the button itself means that JAWS and NVDA announce the button both when the button text changes and when the title attribute changes. NVDA speaks the new label more times because it announces the button text as the label and the title as the description, so it says, for example, "pause button pause". JAWS doesn't appear to do this, so it doesn't repeat it as many times.

Partially addresses #5023
2018-05-11 14:31:28 -04:00
Brandon Casey
c6617b24f7
feat: copy properties from <video-js> to the media el (#5039) 2018-05-09 15:55:29 -04:00
Brandon Casey
6147e5f7aa
fix: sourceset and browser behavior inconsistencies (#5054)
* We now trigger `sourceset` any time a `<source>` element is appended to a mediaEl with no source.
  * `load` should always fire a `sourceset`
  * `sourceset` should always be the absolute url.
2018-05-09 15:51:47 -04:00
Brandon Casey
ba2ae7868b
feat: update the players source cache on sourceset (#5040) 2018-05-08 17:46:46 -04:00