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

22 Commits

Author SHA1 Message Date
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
4134a9734b test: run tests via rollup (#5601) 2019-08-30 14:56:41 -04:00
Brandon Casey
a55c51fd59 test: restore prototype modifications and fix flaky tests (#5964) 2019-04-29 12:01:37 -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
23a36f338b test: memory leak fixes in tests (#5861) 2019-03-18 15:49:48 -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
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
9ceb4e4fe0
feat: playerresize event in all cases (#4864)
Use ResizeObserver when available for better and more performant resizing information, otherwise, fall back to a throttled resize event on an iframe that's the size of the player.
Allows a video.js user to disable this by setting resizeManager: false as an option since the component will not be initialized.

Add a debounce util.

This reverts #4800 (e0ed0b5) because we end up getting two playerresize events with the dimension methods now.
2018-01-30 13:26:21 -05:00
Gary Katsevman
82c8b80548 fix: auto-removal remote text tracks being removed when not supposed to (#4450)
We added a feature so that remote text tracks can auto-removed when a source changes. However, in 6.x we changed the source behavior to be asynchronous meaning that some text tracks were accidentally being removed when they weren't supposed to be.
For example:
```js
var player = videojs('my-player');
player.src({src: 'video.mp4', type: 'video/mp4'});
 // set second arg to false so that they get auto-removed on source change
player.addRemoteTextTrack({kind: 'captions', src: 'text.vtt', srclang: 'en'}, false);
```
Now when the player loads, this captions track is actually missing because it was removed.

Instead of adding auto-removal tracks immediately to the list, wait until we've selected a source before adding them in.


Fixes #4403 and #4315.
2017-06-28 16:38:29 +10:00
ldayananda
188ead1c81 feat: Persist caption/description choice over source changes in emulated tracks (#4295) 2017-05-25 14:09:00 -04:00
mister-ben
74eb5d4772 feat: Combine captions and subtitles tracks control (#4028) 2017-03-02 15:23:41 -05:00
Gary Katsevman
f95815bcd0 chore(tests): make tests not print out errors (#4141) 2017-03-02 15:22:59 -05:00
Gary Katsevman
34aab3f357 feat: middleware (#3788)
Add middleware support. Middleware can function as go-between between the player and the tech. For example, it can modify the duration that the tech returns to the player. In addition, middleware allow for supporting custom video sources and types.

Currently, middleware can only intercept timeline methods like duration, currentTime, and setCurrentTime.

For example,
```js
videojs.use('video/foo', {
  setSource(src, next) {
    next(null, {
      src: 'http://example.com/video.mp4',
      type: 'video/mp4'
    });
  }
});
```
Will allow you to set a source with type `video/foo` which will play back `video.mp4`.

This makes setting the source asynchronous, which aligns it with the spec a bit more. Methods like play can still be called synchronously on the player after setting the source and the player will play once the source has loaded.

`sourceOrder` option was removed as well and it will now always use source ordering.

BREAKING CHANGE: setting the source is now asynchronous. `sourceOrder` option removed and made the default.
2017-01-19 17:29:09 -05:00
Brandon Casey
49bed07039 refactor: unify all Track and TrackList APIs (#3783)
Unify all track-related usage internally.

BREAKING CHANGE: some externally accessibly functions for tracks are now private.
2017-01-19 15:16:28 -05:00
Pat O'Neill
57af15ce8b refactor: Make registerComponent only work with Components (#3802)
Prevent techs (and others) from being registered via registerComponent.
* `registerComponent` now throws if given an object that is not a subclass of Component (or Component itself).
* `registerComponent` now throws if given a non-empty string as its name argument.

BREAKING CHANGE: registerComponent now throws if no name or not a component is passed in.
2017-01-18 00:46:43 -05:00
Gary Katsevman
a7ffa34b7b fix: remote text track deprecation warnings (#3864) 2016-12-15 15:48:19 -05:00
Gary Katsevman
881cfcb346 feat(texttracks): always use emulated text tracks (#3798)
Chrome has a bug where if you add a remote text track and try to use it programmatically, you won't get any cues displayed. So, just switch to always emulated mode.

Also, add IS_SAFARI and IS_ANY_SAFARI to the browsers.
2016-12-02 16:13:33 -05:00
Jon-Carlos Rivera
f05a9271b8 feat: option to have remoteTextTracks automatically 'garbage-collected' when sources change (#3736)
Tech#addRemoteTextTrack now accepts a second parameter - a boolean named manualCleanup which defaults to true preserving backwards compatibility. When that value is set to false the text track will be removed from the video element whenever a source change occurs.
2016-11-09 16:07:59 -05:00
Richard L. Chung
af6beb21c3 @rlchung fixed tests that weren't disposing players when they finished. closes 3524 2016-08-25 10:58:42 -04:00
Pat O&#x27;Neill
72c44daaf3 @misteroneill updated tests to qunit 2.0. closes #3509 2016-08-12 13:51:31 -04:00
Brandon Casey
86068a5b45 @BrandonOCasey updates tests to pass linter 2016-08-05 11:37:12 -04:00
brandonocasey
2e2dbde4b4 @BrandonOCasey added audio and video track support. closes #3173 2016-04-22 14:31:12 -04:00