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

54 Commits

Author SHA1 Message Date
Brandon Casey
f2b5a057fe fix: removeCue should work with native passed in cue (#4208) 2017-03-23 14:31:41 -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
Brandon Casey
a2b1a33606 fix: cues at startTime 0 do not fire (#4152)
Previously timeupdate would fire before the video was playing, and the tech was not ready. This caused issues when preload was set to auto, because cuechange would fire before the video was even started for cues with a startTime of 0.

Wait for tech to be ready before watching for timeupdate
update unit tests to use TechFaker
Add a unit test to verify that we wait for Tech to be ready.
2017-03-02 14:35:45 -05:00
Gary Katsevman
0f57341e38 fix(cues): only copy cue props that don't exist (#4145) 2017-03-02 11:16:12 -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
8d1653aebc feat: Advanced Class-based Plugins for 6.0 (#3690) 2017-01-18 01:52:23 -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
Gary Katsevman
b4ebd9ba00 test: fix tests on older IE (#3800) 2016-12-02 14:17:36 -05:00
Zoltán Tamási
41bd855e19 feat: Refactoring chapters button handling and fixing several issues (#3472)
* Refactored ChaptersButton, broke logic into several methods.
* Fixed the issues in #3447 about in some browsers tracks have an empty cues array instead of null. * Now we always subscribe to load event, and force an update. Also, track changes are handled, so chapters track can now be changed at runtime.
* Fixed the issue in #3447 about chapters menu items are not selectable. Now automatic update of the selected item based on player time works fine.
* Implemented the usage of the chapters track's label attribute as menu title, if it's present. If not, we fall back to the localized "Chapters" title.
* Refined the menu styling, so that vjs-menu-title telement won't get the hover effect, It would confuse users, because they might believe that the title item is a clickable item too.
2016-11-23 13:54:48 -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
Pat O'Neill
fb74c71ba6 refactor(texttracksettings): DRYer code and remove massive HTML blob (#3679)
* DRYer code while keeping tests passing
* Replace massive HTML blob with DOM methods
* Create obj util and implement it
2016-11-04 13:45:51 -04: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
Gary Katsevman
955185379f @gkatsev updated build system to open es5 folder for bundles and dist folder other users. closes #3445 2016-08-17 17:16:41 -04:00
Pat O'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
Brandon Casey
c89b75699e first half of the test/unit/tracks directory (#3483) 2016-08-03 15:27:47 -04:00
Owen Edwards
238c752aee @OwenEdwards fixed caption settings dialog labels for accessibility. closes #3281 2016-07-19 00:19:36 -04:00
Pat O'Neill
13d349b0da @misteroneill improved Logging for IE < 11. closes #3356 2016-07-18 14:32:31 -04:00
brandonocasey
2e2dbde4b4 @BrandonOCasey added audio and video track support. closes #3173 2016-04-22 14:31:12 -04:00
Gary Katsevman
264e53fb5b @gkatsev fixed text track tests for older IEs. closes #3269 2016-04-19 17:09:53 -04:00
Gary Katsevman
d3b368ccce @gkatsev fixed removeRemoteTextTracks not working with return value from addRemoteTextTracks. closes #3253 2016-04-19 15:46:33 -04:00
Gary Katsevman
ff83aa6573 @gkatsev made the first emulated text track enabled by default. closes #3248 2016-04-19 15:18:21 -04:00
Owen Edwards
41bc481597 @OwenEdwards added basic descriptions track support. closes #3098 2016-03-25 14:16:56 -04:00
Gary Katsevman
dbdc411dc2 @gkatsev cleared vttjs script handlers on dispose. Fixed tests. closes #3189 2016-03-17 18:56:25 -04:00
Gary Katsevman
e2c8c125a2 @gkatsev changed emulated tracks to in novtt to wait for vttjs to load or error before parsing. closes #3181 2016-03-17 14:53:00 -04:00
brandonocasey
c1112b74fe @BrandonOCasey updated text track unit tests to use full es6 syntax. closes #3148 2016-03-07 14:54:32 -05:00
jforbes
c8646aa02b @forbesjo updated emulated tracks to have listeners removed when they are removed. closes #3046 2016-02-02 14:29:31 -05:00
Carey Hinoki
8f2bc92412 @chemoish emulated HTMLTrackElement to enable track load events. closes #2804 2015-12-08 11:24:51 -05:00
Garrett Singer
72f77d77c9 @gesinger fixed handler explosion for cuechange events. closes #2849 2015-11-25 16:13:23 -05:00
Garrett Singer
7171ea8d42 @gesinger checked for track changes before tech started listening. closes #2835 2015-11-25 16:00:49 -05:00
Gary Katsevman
0da23c1d8d @gkatsev fixed usage of textTracksToJson. closes #2797 2015-11-10 15:30:09 -05:00
Pat O'Neill
f2fa8f8687 @misteroneill exposed DOM helpers. closes #2754 2015-11-09 17:43:17 -05:00
Gary Katsevman
ab88bcdde3 @gkatsev fixes track tests and ignored empty properties in tracks converter. closes #2744 2015-10-27 15:54:48 -04:00
David LaPalomento
24cdbdefff Use Raynos/xhr for XMLHttpRequests
- Get rid of our custom XHR shim. Export it as videojs.xhr.
- Updated XHR to be stubbed everywhere in tests to prevent errors.
- Added npm install to the review process

closes #2318
closes #2594
2015-09-15 15:25:11 -07:00
heff
f7466af956 Made tech related functions clearly private in the player
This is important for enforcing the model that techs should
work the same for everything.

closes #2590
fixes #2060

- Made techGet and techCall private functions
- Made loadTech, techName, and unloadTech private
- Cleaned up all other private method naming in the player
- Removed some unneeded comments
2015-09-15 12:54:26 -07:00
heff
4d97dd4d29 Fixed a number of errors in the log after testing
- Fixed a console error in dom tests from loading a track source
- Switched to non-fetching poster urls in tests to prevent errors
- Stubbed XHR for TextTrack tests to prevent log errors
- Fixed text track console errors that stubbing async didn't catch
    because there's some async happening in tracks that makes it so
- XHR isn't even used until the test is complete
- Removed extra code
- Added player.dispose more places and fixed attributes test
2015-08-31 16:36:11 -07:00
heff
f7d1289593 @heff fixed cross-platform track tests by switching to a fake tech. closes #2496 2015-08-24 12:48:42 -07:00
Gary Katsevman
4ec82d647d @gkatsev fixed text track errors on dispose and in cross-browser testing. closes #2466 2015-08-12 16:04:31 -07:00
Gary Katsevman
2dfd315ac1 @gkatsev always use emulated TextTrackLists so tracks survive tech switches. closes #2425 2015-08-03 15:19:36 -04:00
Pat O'Neill
8aa61d3b1a @misteroneill restore some 4.x utilities and remove deprecated functionality. closes #2406 2015-07-30 14:11:31 -04:00
heff
a5758019e5 Updated the ready event to always be async
closes #1667

Fix text track tests.
Now that ready is async, we need to tick the clock so the ready handler
fires.

Remove unneeded ready test
2015-05-22 17:27:15 -07:00
heff
a8ff970d4a Broke up Lib and Util into smaller libraries of functions
Broke out bind, guid, and element data functions from Lib

Separated out more dom functions in to dom.js

Broke out URL functions into url.js

Removed setLocalStorage since it wasn't being used

Moved browser tests out of lib

Moved log functions into their own file

Removed trim() since it wasn't being used

Moved formatTime into its own file

Moved round into its own file and renamed roundFloat()

Moved capitalize into its own file and renamed as toTitleCase()

Moved createTimeRange into its own file

Removed Lib.arr.forEach infavor of the native forEach

Removed Lib.obj.create in favor of native Object.create (ES6-sham)

Removed obj.each in favor of native Object.getOwnPropertyNames().forEach()

Removed obj.merge and copy. Using lodash.assign instead.

Replaced Lib.obj.isPlain with lodash.isPlainObject

Removed Lib.obj.isArray in favor of the native Array.isArray

Also removed the lib.js tests file as all tests have been moved
or removed.

Removed Lib.isEmpty in favor of !Object.getOwnPropertyNames().length

Switched Util.mergeOptions and deepMerge to use new mergeOptions()

Moved Lib.TEST_VID to Html5.TEST_VID

Removed Lib references everywhere. Woo!

Attempting to fix sourcemap test errors by setting grunt-browserify version

Switched to object.assign from lodash.assign

Removed unused 'inherits' dependency

Reorganzied test files and added '.test' to file names

Combined js/core.js and js/video.js

Moved events.js into the utils directory
2015-05-15 18:20:35 -07:00
eXon
e5595b1e38 @eXon began Tech 2.0 work, improved how tech events are handled by the player. closes #2057
closes #1485
2015-05-06 14:02:01 -04:00
Deirdre Connolly
c62aa10637 @dconnolly replaced JSON.parse with a safe non-eval JSON parse. closes #2077 2015-04-27 17:05:39 -07:00
heff
a02ee27802 @heff converted all classes to use ES6 classes. closes #1993 2015-04-14 13:08:32 -07:00
Matthew McClure
0c9d53321f Report test coverage analytics during test runs 2015-04-02 11:33:50 -07:00