Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 845962ea3b |
@@ -13,8 +13,6 @@ notifications:
|
||||
on_success: never
|
||||
webhooks:
|
||||
- http://pam.videojs.com/savage/travis
|
||||
slack:
|
||||
secure: LrF8K6mCYWlUt6SvdbGHazyQZSk/opKoiB/wgoGYaGc9+3wYXkVexY0WkO1m6wBKhUqXRAMVMFszr1wqKgdcxtItmFMMj8HqTLI1MVqgKqYX4Ux3CnEHJQiwxIk0aVL7lHLsZTXV/2Y0QIOYmAnCrgy46klETrk0ZuXf5okpu2Q=
|
||||
env:
|
||||
global:
|
||||
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U=
|
||||
|
||||
-209
@@ -1,212 +1,3 @@
|
||||
<a name="5.20.2"></a>
|
||||
## [5.20.2](https://github.com/videojs/video.js/compare/v6.2.5...v5.20.2) (2017-07-26)
|
||||
|
||||
### Features
|
||||
|
||||
* add 'playsinline' player option ([#4325](https://github.com/videojs/video.js/issues/4325)) ([946f84b](https://github.com/videojs/video.js/commit/946f84b))
|
||||
* Add a version class to the player ([#4335](https://github.com/videojs/video.js/issues/4335)) ([b855bfb](https://github.com/videojs/video.js/commit/b855bfb))
|
||||
* Add getVideoPlaybackQuality API ([#4286](https://github.com/videojs/video.js/issues/4286)) ([c970474](https://github.com/videojs/video.js/commit/c970474))
|
||||
* focus play toggle from Big Play Btn on play ([#4132](https://github.com/videojs/video.js/issues/4132)) ([dcc615a](https://github.com/videojs/video.js/commit/dcc615a)), closes [#2729](https://github.com/videojs/video.js/issues/2729)
|
||||
* Make pause on open optional for ModalDialog via options ([#4187](https://github.com/videojs/video.js/issues/4187)) ([4ec3b56](https://github.com/videojs/video.js/commit/4ec3b56))
|
||||
* remove playbackRate blacklist for recent Android Chrome ([#4336](https://github.com/videojs/video.js/issues/4336)) ([3fe22e9](https://github.com/videojs/video.js/commit/3fe22e9))
|
||||
* update videojs-vtt.js and wrap native cues in TextTrack ([#4131](https://github.com/videojs/video.js/issues/4131)) ([3d4aebc](https://github.com/videojs/video.js/commit/3d4aebc)), closes [#4093](https://github.com/videojs/video.js/issues/4093)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* addChild instance names should be toTitleCased ([#4117](https://github.com/videojs/video.js/issues/4117)) ([fa97309](https://github.com/videojs/video.js/commit/fa97309))
|
||||
* adjust volume ranges so muted(true) and vol=0 do not use the same icons ([#4425](https://github.com/videojs/video.js/issues/4425)) ([b314268](https://github.com/videojs/video.js/commit/b314268))
|
||||
* cue-points with a startTime of 0 ([#4148](https://github.com/videojs/video.js/issues/4148)) ([e7d4b47](https://github.com/videojs/video.js/commit/e7d4b47))
|
||||
* make load progress buffered regions height 100% ([#4191](https://github.com/videojs/video.js/issues/4191)) ([398c6e9](https://github.com/videojs/video.js/commit/398c6e9))
|
||||
* make mergeOptions behave the same across browsers ([#4090](https://github.com/videojs/video.js/issues/4090)) ([ce19ed5](https://github.com/videojs/video.js/commit/ce19ed5))
|
||||
* make sure audio track hides with one item ([#4203](https://github.com/videojs/video.js/issues/4203)) ([c069655](https://github.com/videojs/video.js/commit/c069655))
|
||||
* make sure that cues copy over their id ([#4154](https://github.com/videojs/video.js/issues/4154)) ([072c277](https://github.com/videojs/video.js/commit/072c277))
|
||||
* not showing default text tracks over video ([#4217](https://github.com/videojs/video.js/issues/4217)) ([4653922](https://github.com/videojs/video.js/commit/4653922))
|
||||
* **vttjs:** wait till tech el in DOM before loading vttjs ([#4176](https://github.com/videojs/video.js/issues/4176)) ([ad86eec](https://github.com/videojs/video.js/commit/ad86eec))
|
||||
* only change focus from BPB if not a mouse click ([#4523](https://github.com/videojs/video.js/issues/4523)) ([d90c945](https://github.com/videojs/video.js/commit/d90c945))
|
||||
* only disable user-selection on sliders ([#4355](https://github.com/videojs/video.js/issues/4355)) ([0d60720](https://github.com/videojs/video.js/commit/0d60720))
|
||||
* Only update text track mode if changed ([#4368](https://github.com/videojs/video.js/issues/4368)) ([a1763dc](https://github.com/videojs/video.js/commit/a1763dc))
|
||||
* Patch a memory leak caused by un-removed track listener(s). ([#3975](https://github.com/videojs/video.js/issues/3975)) ([bca44c0](https://github.com/videojs/video.js/commit/bca44c0))
|
||||
* player.duration() should return NaN if duration is not known ([#4456](https://github.com/videojs/video.js/issues/4456)) ([2576eda](https://github.com/videojs/video.js/commit/2576eda))
|
||||
* prevent dupe events on enabled ClickableComponents ([#4357](https://github.com/videojs/video.js/issues/4357)) ([3faea9f](https://github.com/videojs/video.js/commit/3faea9f))
|
||||
* remove title attribute on menu items, fixes [#3699](https://github.com/videojs/video.js/issues/3699) ([#4009](https://github.com/videojs/video.js/issues/4009)) ([91874a3](https://github.com/videojs/video.js/commit/91874a3))
|
||||
* removeCue should work with native passed in cue ([#4209](https://github.com/videojs/video.js/issues/4209)) ([3974944](https://github.com/videojs/video.js/commit/3974944))
|
||||
* Safari picture-in-picture triggers fullscreenchange ([#4442](https://github.com/videojs/video.js/issues/4442)) ([c17c003](https://github.com/videojs/video.js/commit/c17c003))
|
||||
* **cues:** only copy cue props that don't exist ([#4146](https://github.com/videojs/video.js/issues/4146)) ([de08669](https://github.com/videojs/video.js/commit/de08669))
|
||||
* **cues:** only copy cue props that don't exist ([#4146](https://github.com/videojs/video.js/issues/4146)) ([841d135](https://github.com/videojs/video.js/commit/841d135))
|
||||
* **MenuButton:** Unify behavior of showing/hiding ([#3993](https://github.com/videojs/video.js/issues/3993)) ([4367c69](https://github.com/videojs/video.js/commit/4367c69))
|
||||
* set IE_VERSION correctly for IE11 ([#4280](https://github.com/videojs/video.js/issues/4280)) ([207730e](https://github.com/videojs/video.js/commit/207730e)), closes [#4278](https://github.com/videojs/video.js/issues/4278)
|
||||
* synchronously shim vtt.js when possible ([#4082](https://github.com/videojs/video.js/issues/4082)) ([b5727a6](https://github.com/videojs/video.js/commit/b5727a6))
|
||||
* Use passive event listeners for touchstart/touchmove ([#4445](https://github.com/videojs/video.js/issues/4445)) ([8599c8e](https://github.com/videojs/video.js/commit/8599c8e)), closes [#4432](https://github.com/videojs/video.js/issues/4432)
|
||||
* **playback rate menu:** playback rate menu items should be selectable ([#4150](https://github.com/videojs/video.js/issues/4150)) ([288edd1](https://github.com/videojs/video.js/commit/288edd1))
|
||||
* **sass:** import path has cwd once again ([#4076](https://github.com/videojs/video.js/issues/4076)) ([c02c6c6](https://github.com/videojs/video.js/commit/c02c6c6))
|
||||
|
||||
### Chores
|
||||
|
||||
* add a release script to makes things easier ([#4517](https://github.com/videojs/video.js/issues/4517)) ([9ca9989](https://github.com/videojs/video.js/commit/9ca9989))
|
||||
* add slack travis notifications ([#4339](https://github.com/videojs/video.js/issues/4339)) ([ab110ff](https://github.com/videojs/video.js/commit/ab110ff))
|
||||
* change accessibility test in grunt.js to remove unnecessary warning message. ([#4008](https://github.com/videojs/video.js/issues/4008)) ([daad492](https://github.com/videojs/video.js/commit/daad492))
|
||||
* **build:** lint errors only and silence webpack ([#4153](https://github.com/videojs/video.js/issues/4153)) ([b1ca344](https://github.com/videojs/video.js/commit/b1ca344))
|
||||
* **package:** pin karma to 1.3.0 for IE8 support ([#4340](https://github.com/videojs/video.js/issues/4340)) ([6cf7327](https://github.com/videojs/video.js/commit/6cf7327))
|
||||
* **package:** update swf to 5.2.0 ([#4040](https://github.com/videojs/video.js/issues/4040)) ([dab893b](https://github.com/videojs/video.js/commit/dab893b))
|
||||
* **package:** update to swf 5.4.1 ([#4516](https://github.com/videojs/video.js/issues/4516)) ([a145dd2](https://github.com/videojs/video.js/commit/a145dd2))
|
||||
* **package:** update video-js-swf to 5.3.0 ([#4161](https://github.com/videojs/video.js/issues/4161)) ([2bcfe21](https://github.com/videojs/video.js/commit/2bcfe21))
|
||||
* **package:** update videojs-vtt.js to 0.12.3 ([#4223](https://github.com/videojs/video.js/issues/4223)) ([ad770fb](https://github.com/videojs/video.js/commit/ad770fb))
|
||||
* **package:** update videojs-vtt.js to 0.12.4 ([#4364](https://github.com/videojs/video.js/issues/4364)) ([3f7e215](https://github.com/videojs/video.js/commit/3f7e215))
|
||||
* move imports up so bundlers wont trip up ([#4363](https://github.com/videojs/video.js/issues/4363)) ([0d725df](https://github.com/videojs/video.js/commit/0d725df))
|
||||
|
||||
### Tests
|
||||
|
||||
* fix playsinline test for IE8 ([#4347](https://github.com/videojs/video.js/issues/4347)) ([823f6c7](https://github.com/videojs/video.js/commit/823f6c7))
|
||||
|
||||
<a name="5.20.1"></a>
|
||||
## [5.20.1](https://github.com/videojs/video.js/compare/v5.20.0...v5.20.1) (2017-05-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* only disable user-selection on sliders ([#4355](https://github.com/videojs/video.js/issues/4355)) ([0d60720](https://github.com/videojs/video.js/commit/0d60720))
|
||||
* prevent dupe events on enabled ClickableComponents ([#4357](https://github.com/videojs/video.js/issues/4357)) ([3faea9f](https://github.com/videojs/video.js/commit/3faea9f))
|
||||
|
||||
<a name="5.20.0"></a>
|
||||
# [5.20.0](https://github.com/videojs/video.js/compare/v5.19.2...v5.20.0) (2017-05-11)
|
||||
|
||||
### Features
|
||||
|
||||
* add 'playsinline' player option ([#4325](https://github.com/videojs/video.js/issues/4325)) ([946f84b](https://github.com/videojs/video.js/commit/946f84b))
|
||||
* Add a version class to the player ([#4335](https://github.com/videojs/video.js/issues/4335)) ([b855bfb](https://github.com/videojs/video.js/commit/b855bfb))
|
||||
* Add getVideoPlaybackQuality API ([#4286](https://github.com/videojs/video.js/issues/4286)) ([c970474](https://github.com/videojs/video.js/commit/c970474))
|
||||
* remove playbackRate blacklist for recent Android Chrome ([#4336](https://github.com/videojs/video.js/issues/4336)) ([3fe22e9](https://github.com/videojs/video.js/commit/3fe22e9))
|
||||
|
||||
### Chores
|
||||
|
||||
* add slack travis notifications ([#4339](https://github.com/videojs/video.js/issues/4339)) ([ab110ff](https://github.com/videojs/video.js/commit/ab110ff))
|
||||
* **package:** pin karma to 1.3.0 for IE8 support ([#4340](https://github.com/videojs/video.js/issues/4340)) ([6cf7327](https://github.com/videojs/video.js/commit/6cf7327))
|
||||
|
||||
### Tests
|
||||
|
||||
* fix playsinline test for IE8 ([#4347](https://github.com/videojs/video.js/issues/4347)) ([823f6c7](https://github.com/videojs/video.js/commit/823f6c7))
|
||||
|
||||
<a name="5.19.2"></a>
|
||||
## [5.19.2](https://github.com/videojs/video.js/compare/v5.19.1...v5.19.2) (2017-04-13)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* set IE_VERSION correctly for IE11 ([#4280](https://github.com/videojs/video.js/issues/4280)) ([207730e](https://github.com/videojs/video.js/commit/207730e)), closes [#4278](https://github.com/videojs/video.js/issues/4278)
|
||||
|
||||
<a name="5.19.1"></a>
|
||||
## [5.19.1](https://github.com/videojs/video.js/compare/v5.19.0...v5.19.1) (2017-03-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* not showing default text tracks over video ([#4217](https://github.com/videojs/video.js/issues/4217)) ([4653922](https://github.com/videojs/video.js/commit/4653922))
|
||||
* removeCue should work with native passed in cue ([#4209](https://github.com/videojs/video.js/issues/4209)) ([3974944](https://github.com/videojs/video.js/commit/3974944))
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** update videojs-vtt.js to 0.12.3 ([#4223](https://github.com/videojs/video.js/issues/4223)) ([ad770fb](https://github.com/videojs/video.js/commit/ad770fb))
|
||||
|
||||
<a name="5.19.0"></a>
|
||||
# [5.19.0](https://github.com/videojs/video.js/compare/v5.18.4...v5.19.0) (2017-03-15)
|
||||
|
||||
### Features
|
||||
|
||||
* Make pause on open optional for ModalDialog via options ([#4187](https://github.com/videojs/video.js/issues/4187)) ([4ec3b56](https://github.com/videojs/video.js/commit/4ec3b56))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make load progress buffered regions height 100% ([#4191](https://github.com/videojs/video.js/issues/4191)) ([398c6e9](https://github.com/videojs/video.js/commit/398c6e9))
|
||||
* make sure audio track hides with one item ([#4203](https://github.com/videojs/video.js/issues/4203)) ([c069655](https://github.com/videojs/video.js/commit/c069655))
|
||||
|
||||
<a name="5.18.4"></a>
|
||||
## [5.18.4](https://github.com/videojs/video.js/compare/v5.18.3...v5.18.4) (2017-03-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **vttjs:** wait till tech el in DOM before loading vttjs ([#4176](https://github.com/videojs/video.js/issues/4176)) ([ad86eec](https://github.com/videojs/video.js/commit/ad86eec))
|
||||
|
||||
<a name="5.18.3"></a>
|
||||
## [5.18.3](https://github.com/videojs/video.js/compare/v5.18.2...v5.18.3) (2017-03-06)
|
||||
|
||||
<a name="5.18.1"></a>
|
||||
## [5.18.1](https://github.com/videojs/video.js/compare/v5.18.0...v5.18.1) (2017-03-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cues:** only copy cue props that don't exist ([#4146](https://github.com/videojs/video.js/issues/4146)) ([de08669](https://github.com/videojs/video.js/commit/de08669))
|
||||
* cue-points with a startTime of 0 ([#4148](https://github.com/videojs/video.js/issues/4148)) ([e7d4b47](https://github.com/videojs/video.js/commit/e7d4b47))
|
||||
* make sure that cues copy over their id ([#4154](https://github.com/videojs/video.js/issues/4154)) ([072c277](https://github.com/videojs/video.js/commit/072c277))
|
||||
* **MenuButton:** Unify behavior of showing/hiding ([#3993](https://github.com/videojs/video.js/issues/3993)) ([4367c69](https://github.com/videojs/video.js/commit/4367c69))
|
||||
* **playback rate menu:** playback rate menu items should be selectable ([#4150](https://github.com/videojs/video.js/issues/4150)) ([288edd1](https://github.com/videojs/video.js/commit/288edd1))
|
||||
|
||||
### Chores
|
||||
|
||||
* **build:** lint errors only and silence webpack ([#4153](https://github.com/videojs/video.js/issues/4153)) ([b1ca344](https://github.com/videojs/video.js/commit/b1ca344))
|
||||
* **package:** update video-js-swf to 5.3.0 ([#4161](https://github.com/videojs/video.js/issues/4161)) ([2bcfe21](https://github.com/videojs/video.js/commit/2bcfe21))
|
||||
|
||||
<a name="5.18.0"></a>
|
||||
# [5.18.0](https://github.com/videojs/video.js/compare/v5.17.0...v5.18.0) (2017-02-27)
|
||||
|
||||
### Features
|
||||
|
||||
* focus play toggle from Big Play Btn on play ([#4132](https://github.com/videojs/video.js/issues/4132)) ([dcc615a](https://github.com/videojs/video.js/commit/dcc615a)), closes [#2729](https://github.com/videojs/video.js/issues/2729)
|
||||
* update videojs-vtt.js and wrap native cues in TextTrack ([#4131](https://github.com/videojs/video.js/issues/4131)) ([3d4aebc](https://github.com/videojs/video.js/commit/3d4aebc)), closes [#4093](https://github.com/videojs/video.js/issues/4093)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sass:** import path has cwd once again ([#4076](https://github.com/videojs/video.js/issues/4076)) ([c02c6c6](https://github.com/videojs/video.js/commit/c02c6c6))
|
||||
* addChild instance names should be toTitleCased ([#4117](https://github.com/videojs/video.js/issues/4117)) ([fa97309](https://github.com/videojs/video.js/commit/fa97309))
|
||||
* make mergeOptions behave the same across browsers ([#4090](https://github.com/videojs/video.js/issues/4090)) ([ce19ed5](https://github.com/videojs/video.js/commit/ce19ed5))
|
||||
* synchronously shim vtt.js when possible ([#4082](https://github.com/videojs/video.js/issues/4082)) ([b5727a6](https://github.com/videojs/video.js/commit/b5727a6))
|
||||
|
||||
<a name="5.17.0"></a>
|
||||
# [5.17.0](https://github.com/videojs/video.js/compare/v5.16.0...v5.17.0) (2017-02-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Patch a memory leak caused by un-removed track listener(s). ([#3975](https://github.com/videojs/video.js/issues/3975)) ([bca44c0](https://github.com/videojs/video.js/commit/bca44c0))
|
||||
* remove title attribute on menu items, fixes [#3699](https://github.com/videojs/video.js/issues/3699) ([#4009](https://github.com/videojs/video.js/issues/4009)) ([91874a3](https://github.com/videojs/video.js/commit/91874a3))
|
||||
|
||||
### Chores
|
||||
|
||||
* change accessibility test in grunt.js to remove unnecessary warning message. ([#4008](https://github.com/videojs/video.js/issues/4008)) ([daad492](https://github.com/videojs/video.js/commit/daad492))
|
||||
* **package:** update swf to 5.2.0 ([#4040](https://github.com/videojs/video.js/issues/4040)) ([dab893b](https://github.com/videojs/video.js/commit/dab893b))
|
||||
|
||||
### Documentation
|
||||
|
||||
* minor fix to currentTime() comment: "setting" not "getting" ([#3944](https://github.com/videojs/video.js/issues/3944)) ([6578ed9](https://github.com/videojs/video.js/commit/6578ed9))
|
||||
|
||||
<a name="5.16.0"></a>
|
||||
# [5.16.0](https://github.com/videojs/video.js/compare/v5.15.1...v5.16.0) (2017-01-12)
|
||||
|
||||
### Features
|
||||
|
||||
* Show big play button on pause if specified ([#3892](https://github.com/videojs/video.js/issues/3892)) ([b547214](https://github.com/videojs/video.js/commit/b547214))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* give techs a name ([#3934](https://github.com/videojs/video.js/issues/3934)) ([94fd5c1](https://github.com/videojs/video.js/commit/94fd5c1)), closes [#1786](https://github.com/videojs/video.js/issues/1786)
|
||||
* Pause player before seeking in seek bar mousedown ([#3921](https://github.com/videojs/video.js/issues/3921)) ([2ceed0a](https://github.com/videojs/video.js/commit/2ceed0a)), closes [#3839](https://github.com/videojs/video.js/issues/3839) [#3886](https://github.com/videojs/video.js/issues/3886)
|
||||
* player el ingest when parent doesn't have `hasAttribute` method ([#3929](https://github.com/videojs/video.js/issues/3929)) ([bbe8253](https://github.com/videojs/video.js/commit/bbe8253))
|
||||
* showing custom poster with controls disabled ([#3933](https://github.com/videojs/video.js/issues/3933)) ([305e5ea](https://github.com/videojs/video.js/commit/305e5ea)), closes [#1625](https://github.com/videojs/video.js/issues/1625)
|
||||
|
||||
### Chores
|
||||
|
||||
* better dev experience ([#3896](https://github.com/videojs/video.js/issues/3896)) ([9ec5587](https://github.com/videojs/video.js/commit/9ec5587))
|
||||
* don't run tests on travis if only docs were changed ([#3908](https://github.com/videojs/video.js/issues/3908)) ([c239bd5](https://github.com/videojs/video.js/commit/c239bd5))
|
||||
* **development:** fix `npm start` file watching ([#3922](https://github.com/videojs/video.js/issues/3922)) ([02da697](https://github.com/videojs/video.js/commit/02da697))
|
||||
* **release:** add es5 folder to the tagged commit ([#3913](https://github.com/videojs/video.js/issues/3913)) ([d120ea2](https://github.com/videojs/video.js/commit/d120ea2))
|
||||
* **sass:** upgrade to latest version of grunt-sass ([#3897](https://github.com/videojs/video.js/issues/3897)) ([83d453b](https://github.com/videojs/video.js/commit/83d453b)), closes [#3692](https://github.com/videojs/video.js/issues/3692)
|
||||
* fix typo in collaborator guide ([#3931](https://github.com/videojs/video.js/issues/3931)) ([f35de1c](https://github.com/videojs/video.js/commit/f35de1c))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* require `videojs-vtt.js` via require rather than concat ([#3919](https://github.com/videojs/video.js/issues/3919)) ([d290db1](https://github.com/videojs/video.js/commit/d290db1))
|
||||
|
||||
### Documentation
|
||||
|
||||
* **faq:** add a question about autoplay ([#3898](https://github.com/videojs/video.js/issues/3898)) ([e5a240a](https://github.com/videojs/video.js/commit/e5a240a))
|
||||
* **faq:** add FAQ question about RTMP url ([#3899](https://github.com/videojs/video.js/issues/3899)) ([9c74116](https://github.com/videojs/video.js/commit/9c74116))
|
||||
* **troubleshooting:** updates to troubleshooting doc ([#3912](https://github.com/videojs/video.js/issues/3912)) ([0ce7cd4](https://github.com/videojs/video.js/commit/0ce7cd4))
|
||||
|
||||
<a name="5.15.1"></a>
|
||||
## [5.15.1](https://github.com/videojs/video.js/compare/v5.15.0...v5.15.1) (2016-12-23)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
## Issues and Pull Requests
|
||||
|
||||
Full courtesy should always be shown in video.js projects.
|
||||
Full courtesey should always be shown in video.js projects.
|
||||
|
||||
Collaborators may manage issues they feel qualified to handle, being mindful of our guidelines.
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Release Type?"
|
||||
read -rp "> " rtype
|
||||
|
||||
echo grunt version:${rtype}
|
||||
grunt version:${rtype}
|
||||
version=$(./build/bin/version)
|
||||
|
||||
echo New version is $version
|
||||
|
||||
# echo grunt chg-release:$version
|
||||
# grunt chg-release:$version
|
||||
npm run changelog
|
||||
|
||||
echo git commit -am "v$version"
|
||||
git commit -am "v$version"
|
||||
|
||||
echo git checkout temp-release-branch
|
||||
git checkout -b temp-release-branch
|
||||
|
||||
echo grunt dist
|
||||
grunt dist
|
||||
|
||||
echo git add -f dist
|
||||
git add -f dist
|
||||
|
||||
echo git commit -m "v$version dist"
|
||||
git commit -m "v$version dist"
|
||||
|
||||
echo git tag -a "v$version" -m "v$version"
|
||||
git tag -a "v$version" -m "v$version"
|
||||
|
||||
echo git show
|
||||
git show
|
||||
|
||||
|
||||
read -p "publish? " -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo git push upstream
|
||||
git push upstream --tags
|
||||
git push origin --tags
|
||||
|
||||
echo npm publish --tag next-5
|
||||
npm publish --tag next-5
|
||||
|
||||
echo grunt github-release:prereleease
|
||||
grunt github-release:prerelease
|
||||
|
||||
echo git checkout -
|
||||
git checkout -
|
||||
|
||||
echo git branch -D temp-release-branch
|
||||
git branch -D temp-release-branch
|
||||
@@ -1,19 +0,0 @@
|
||||
import sh from 'shelljs';
|
||||
import path from 'path';
|
||||
|
||||
|
||||
export default function(commit, commitRange) {
|
||||
const SINGLE_COMMIT = `git diff-tree --no-commit-id --name-only -r ${commit}`;
|
||||
const COMMIT_RANGE = `git diff --name-only ${commitRange}`;
|
||||
|
||||
let command = SINGLE_COMMIT;
|
||||
|
||||
if (commitRange) {
|
||||
command = COMMIT_RANGE
|
||||
}
|
||||
|
||||
const output = sh.exec(command, {async: false, silent: true}).stdout;
|
||||
|
||||
const files = output.split('\n').filter(Boolean);
|
||||
return files.every((file) => file.startsWith('docs') || path.extname(file) === '.md');
|
||||
};
|
||||
+61
-76
@@ -1,7 +1,6 @@
|
||||
import {gruntCustomizer, gruntOptionsMaker} from './options-customizer.js';
|
||||
import chg from 'chg';
|
||||
import npmRun from 'npm-run';
|
||||
import isDocsOnly from './docs-only.js';
|
||||
|
||||
module.exports = function(grunt) {
|
||||
require('time-grunt')(grunt);
|
||||
@@ -128,14 +127,9 @@ module.exports = function(grunt) {
|
||||
},
|
||||
dist: {},
|
||||
watch: {
|
||||
dist: {
|
||||
files: [
|
||||
'build/temp/video.js',
|
||||
'build/temp/alt/video.novtt.js',
|
||||
'build/temp/video-js.css',
|
||||
'build/temp/alt/video-js-cdn.css'
|
||||
],
|
||||
tasks: ['copy:dist']
|
||||
novtt: {
|
||||
files: ['build/temp/video.js'],
|
||||
tasks: ['concat:novtt']
|
||||
},
|
||||
minify: {
|
||||
files: ['build/temp/video.js'],
|
||||
@@ -145,6 +139,14 @@ module.exports = function(grunt) {
|
||||
files: ['src/css/**/*'],
|
||||
tasks: ['skin']
|
||||
},
|
||||
babel: {
|
||||
files: ['src/js/**/*.js'],
|
||||
tasks: ['babel:es5']
|
||||
},
|
||||
jshint: {
|
||||
files: ['src/**/*', 'test/unit/**/*.js', 'Gruntfile.js'],
|
||||
tasks: 'jshint'
|
||||
}
|
||||
},
|
||||
connect: {
|
||||
dev: {
|
||||
@@ -318,41 +320,34 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
browserify: {
|
||||
options: browserifyGruntOptions(),
|
||||
build: {
|
||||
options: browserifyGruntOptions(),
|
||||
files: {
|
||||
'build/temp/video.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
buildnovtt: {
|
||||
options: browserifyGruntOptions({transform: [
|
||||
['aliasify', {aliases: {'videojs-vtt.js': false}}]
|
||||
]}),
|
||||
dist: {
|
||||
options: browserifyGruntOptions({
|
||||
transform: [
|
||||
['browserify-versionify', {
|
||||
placeholder: '../node_modules/videojs-vtt.js/dist/vtt.js',
|
||||
version: 'https://cdn.rawgit.com/gkatsev/vtt.js/vjs-v0.12.1/dist/vtt.min.js'
|
||||
}],
|
||||
]
|
||||
}),
|
||||
files: {
|
||||
'build/temp/alt/video.novtt.js': ['es5/video.js']
|
||||
'build/temp/video.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: browserifyGruntOptions({
|
||||
options: {
|
||||
watch: true,
|
||||
keepAlive: true,
|
||||
}),
|
||||
keepAlive: true
|
||||
},
|
||||
files: {
|
||||
'build/temp/video.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
watchnovtt: {
|
||||
options: browserifyGruntOptions({
|
||||
transform: [
|
||||
['aliasify', {aliases: {'videojs-vtt.js': false}}]
|
||||
],
|
||||
watch: true,
|
||||
keepAlive: true,
|
||||
}),
|
||||
files: {
|
||||
'build/temp/alt/video.novtt.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
tests: {
|
||||
options: {
|
||||
browserifyOptions: {
|
||||
@@ -389,6 +384,14 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
separator: '\n'
|
||||
},
|
||||
novtt: {
|
||||
src: ['build/temp/video.js'],
|
||||
dest: 'build/temp/alt/video.novtt.js'
|
||||
},
|
||||
vtt: {
|
||||
src: ['build/temp/video.js', 'node_modules/videojs-vtt.js/dist/vtt.js'],
|
||||
dest: 'build/temp/video.js'
|
||||
},
|
||||
ie8_addition: {
|
||||
src: ['build/temp/video-js.css', 'src/css/ie8.css'],
|
||||
dest: 'build/temp/video-js.css'
|
||||
@@ -399,23 +402,14 @@ module.exports = function(grunt) {
|
||||
logConcurrentOutput: true
|
||||
},
|
||||
tests: [
|
||||
'shell:babel',
|
||||
'watch:babel',
|
||||
'browserify:tests'
|
||||
],
|
||||
dev: [
|
||||
'shell:babel',
|
||||
'browserify:watch',
|
||||
'browserify:watchnovtt',
|
||||
'browserify:tests',
|
||||
'watch:skin',
|
||||
'watch:dist'
|
||||
],
|
||||
// Run multiple watch tasks in parallel
|
||||
// Needed so watchify can cache intelligently
|
||||
watchAll: [
|
||||
'watch',
|
||||
'browserify:watch',
|
||||
'browserify:watchnovtt',
|
||||
'browserify:tests',
|
||||
'karma:watch'
|
||||
],
|
||||
@@ -443,14 +437,8 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
shell: {
|
||||
babel: {
|
||||
command: 'npm run babel -- --watch',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
lint: {
|
||||
command: 'npm run lint -- --errors',
|
||||
command: 'npm run lint',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
@@ -468,7 +456,7 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
webpack: {
|
||||
command: 'webpack --hide-modules test/require/webpack.js build/temp/webpack.js',
|
||||
command: 'webpack test/require/webpack.js build/temp/webpack.js',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
@@ -483,8 +471,8 @@ module.exports = function(grunt) {
|
||||
error: true
|
||||
},
|
||||
ignore: [
|
||||
// Ignore warning about contrast of the "vjs-no-js" fallback link
|
||||
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.BgImage'
|
||||
// Ignore the warning about needing <optgroup> elements
|
||||
'WCAG2AA.Principle1.Guideline1_3.1_3_1.H85.2'
|
||||
]
|
||||
|
||||
},
|
||||
@@ -498,15 +486,17 @@ module.exports = function(grunt) {
|
||||
require('load-grunt-tasks')(grunt);
|
||||
grunt.loadNpmTasks('videojs-doc-generator');
|
||||
grunt.loadNpmTasks('chg');
|
||||
grunt.loadNpmTasks('gkatsev-grunt-sass');
|
||||
grunt.loadNpmTasks('grunt-accessibility');
|
||||
|
||||
grunt.registerTask('build', [
|
||||
const buildDependents = [
|
||||
'shell:lint',
|
||||
'clean:build',
|
||||
|
||||
'babel:es5',
|
||||
'browserify:build',
|
||||
'browserify:buildnovtt',
|
||||
'concat:novtt',
|
||||
'concat:vtt',
|
||||
'usebanner:novtt',
|
||||
'usebanner:vtt',
|
||||
'uglify',
|
||||
@@ -519,11 +509,18 @@ module.exports = function(grunt) {
|
||||
'copy:swf',
|
||||
'copy:ie8',
|
||||
'vjslanguages'
|
||||
]);
|
||||
];
|
||||
|
||||
grunt.registerTask('build', buildDependents);
|
||||
|
||||
grunt.registerTask(
|
||||
'build:dist',
|
||||
buildDependents.map(task => task === 'browserify:build' ? 'browserify:dist' : task)
|
||||
);
|
||||
|
||||
grunt.registerTask('dist', [
|
||||
'clean:dist',
|
||||
'build',
|
||||
'build:dist',
|
||||
'copy:dist',
|
||||
'copy:examples',
|
||||
'zip:dist'
|
||||
@@ -535,31 +532,19 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask('default', ['test']);
|
||||
|
||||
// The test script includes coveralls only when the TRAVIS env var is set.
|
||||
grunt.registerTask('test', function() {
|
||||
const tasks = [
|
||||
'build',
|
||||
'shell:noderequire',
|
||||
'shell:browserify',
|
||||
'shell:webpack',
|
||||
'karma:defaults',
|
||||
'test-a11y'
|
||||
];
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
if (isDocsOnly(process.env.TRAVIS_COMMIT, process.env.TRAVIS_COMMIT_RANGE)) {
|
||||
grunt.log.write('Not running any tests because only docs were changed');
|
||||
return;
|
||||
}
|
||||
|
||||
tasks.concat(process.env.TRAVIS && 'coveralls').filter(Boolean);
|
||||
}
|
||||
|
||||
grunt.task.run(tasks);
|
||||
});
|
||||
grunt.registerTask('test', [
|
||||
'build',
|
||||
'shell:noderequire',
|
||||
'shell:browserify',
|
||||
'shell:webpack',
|
||||
'karma:defaults',
|
||||
'test-a11y'].concat(process.env.TRAVIS && 'coveralls').filter(Boolean));
|
||||
|
||||
// Run while developing
|
||||
grunt.registerTask('dev', ['connect:dev', 'concurrent:dev']);
|
||||
grunt.registerTask('dev', ['build', 'connect:dev', 'concurrent:watchSandbox']);
|
||||
|
||||
grunt.registerTask('watchAll', ['build', 'connect:dev', 'concurrent:watchAll']);
|
||||
|
||||
grunt.registerTask('test-a11y', ['copy:a11y', 'accessibility']);
|
||||
|
||||
// Pick your testing, or run both in different terminals
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "5.20.2",
|
||||
"version": "5.15.1",
|
||||
"keywords": [
|
||||
"videojs",
|
||||
"html5",
|
||||
|
||||
+2
-2
@@ -287,7 +287,7 @@
|
||||
[ "git push upstream master", "Push the dev branch changes to the repo" ],
|
||||
[ "git checkout temp-release-branch", "Checkout the temp branch again" ],
|
||||
[ "grunt dist", "Build the dist" ],
|
||||
[ "git add es5 dist --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "git add dist --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "git commit -m 'v{{version}} dist'", "Commit the dist changes" ],
|
||||
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the release" ],
|
||||
[ "git push upstream --tags", "Push the new tag to the repo" ],
|
||||
@@ -311,7 +311,7 @@
|
||||
[ "git push upstream stable", "Push the release branch changes to the repo" ],
|
||||
[ "git checkout -b temp-release-branch stable","Create a temporary branch for the dist" ],
|
||||
[ "grunt dist", "Build the dist" ],
|
||||
[ "git add es5 dist --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "git add dist --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "git commit -m 'v{{version}} dist'", "Commit the dist changes" ],
|
||||
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the release" ],
|
||||
[ "git push upstream --tags", "Push the new tag to the repo" ],
|
||||
|
||||
externo
+9
-9
@@ -248,7 +248,11 @@
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-family: Arial, Helvetica, sans-serif; }
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.video-js:-moz-full-screen {
|
||||
position: absolute; }
|
||||
.video-js:-webkit-full-screen {
|
||||
@@ -397,9 +401,6 @@ body.vjs-full-window {
|
||||
.vjs-error .vjs-big-play-button {
|
||||
display: none; }
|
||||
|
||||
.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {
|
||||
display: block; }
|
||||
|
||||
.video-js button {
|
||||
background: none;
|
||||
border: none;
|
||||
@@ -686,7 +687,7 @@ body.vjs-full-window {
|
||||
.video-js .vjs-progress-holder .vjs-load-progress div {
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
height: 0.3em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 0;
|
||||
@@ -790,10 +791,6 @@ body.vjs-full-window {
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
margin: 0 0.45em 0 0.45em;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-color: #73859f;
|
||||
background-color: rgba(115, 133, 159, 0.5); }
|
||||
|
||||
@@ -934,6 +931,9 @@ body.vjs-full-window {
|
||||
.vjs-audio.vjs-has-started .vjs-poster {
|
||||
display: block; }
|
||||
|
||||
.vjs-controls-disabled .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
.vjs-using-native-controls .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
|
||||
externo
+1
-1
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
externo
+482
-800
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
+9
-9
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Arquivo binário não exibido.
externo
+9
-9
@@ -248,7 +248,11 @@
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-family: Arial, Helvetica, sans-serif; }
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.video-js:-moz-full-screen {
|
||||
position: absolute; }
|
||||
.video-js:-webkit-full-screen {
|
||||
@@ -397,9 +401,6 @@ body.vjs-full-window {
|
||||
.vjs-error .vjs-big-play-button {
|
||||
display: none; }
|
||||
|
||||
.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {
|
||||
display: block; }
|
||||
|
||||
.video-js button {
|
||||
background: none;
|
||||
border: none;
|
||||
@@ -686,7 +687,7 @@ body.vjs-full-window {
|
||||
.video-js .vjs-progress-holder .vjs-load-progress div {
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
height: 0.3em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 0;
|
||||
@@ -790,10 +791,6 @@ body.vjs-full-window {
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
margin: 0 0.45em 0 0.45em;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-color: #73859f;
|
||||
background-color: rgba(115, 133, 159, 0.5); }
|
||||
|
||||
@@ -934,6 +931,9 @@ body.vjs-full-window {
|
||||
.vjs-audio.vjs-has-started .vjs-poster {
|
||||
display: block; }
|
||||
|
||||
.vjs-controls-disabled .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
.vjs-using-native-controls .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
|
||||
externo
+1
-1
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
externo
BIN
Arquivo binário não exibido.
externo
+2448
-2659
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
+9
-9
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
@@ -15,9 +15,6 @@
|
||||
* [If you don't think you can fix the issue or add the feature](#if-you-dont-think-you-can-fix-the-issue-or-add-the-feature)
|
||||
* [Q: What is a reduced test case?](#q-what-is-a-reduced-test-case)
|
||||
* [Q: What media formats does video.js support?](#q-what-media-formats-does-videojs-support)
|
||||
* [Q: How to I autoplay the video?](#q-how-to-i-autoplay-the-video)
|
||||
* [Q: How can I autoplay a video on a mobile device?](#q-how-can-i-autoplay-a-video-on-a-mobile-device)
|
||||
* [Q: How can I play RTMP video in video.js?](#q-how-can-i-play-rtmp-video-in-videojs)
|
||||
* [Q: How can I hide the links to my video/subtitles/audio/tracks?](#q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks)
|
||||
* [Q: What is a plugin?](#q-what-is-a-plugin)
|
||||
* [Q: How do I make a plugin for video.js?](#q-how-do-i-make-a-plugin-for-videojs)
|
||||
@@ -119,48 +116,6 @@ techs made available to video.js. For example, video.js 5 includes the Flash tec
|
||||
enables the playback of FLV video where the Flash plugin is available. For more information
|
||||
on media formats see the [troubleshooting guide][troubleshooting].
|
||||
|
||||
## Q: How to I autoplay the video?
|
||||
|
||||
Video.js supports the standard html5 `autoplay` attribute on the video element.
|
||||
It also supports it as an option to video.js or as a method invocation on the player.
|
||||
|
||||
```html
|
||||
<video autoplay controls class="video-js">
|
||||
```
|
||||
|
||||
```js
|
||||
var player = videojs('my-video', {
|
||||
autoplay: true
|
||||
});
|
||||
|
||||
// or
|
||||
|
||||
player.autoplay(true);
|
||||
```
|
||||
|
||||
### Q: How can I autoplay a video on a mobile device?
|
||||
|
||||
Most mobile devices have blocked autoplaying videos until recently.
|
||||
For mobile devices that don't support autoplaying, autoplay isn't supported by video.js.
|
||||
For those devices that support autoplaying, like iOS10 and Chrome for Android 53+,
|
||||
you must mute the video or have a video without audio tracks to be able to play it.
|
||||
For example:
|
||||
|
||||
```html
|
||||
<video muted autoplay playsinline>
|
||||
```
|
||||
|
||||
Will make an inline, muted, autoplaying video on an iPhone with iOS10.
|
||||
|
||||
## Q: How can I play RTMP video in video.js?
|
||||
|
||||
Make sure that the Flash tech is available -- RTMP is not playable on browsers without Flash including mobile. Then, just set the rtmp source with
|
||||
an appropriate type -- `rtmp/mp4` or `rtmp/flv`.
|
||||
The main thing to be aware of is that video.js splits the connection url and stream name with the `&` character.
|
||||
So, you'd want to update the url to follow that format. For example: `rtmp://example.com/live&foo` or `rtmp://example.com/fms&mp4:path/to/file.mp4`.
|
||||
|
||||
If the server requires query parameters for authentication, these should be added to the connection part url, for example `rtmp://example.com/live?token=1234&foo`.
|
||||
|
||||
## Q: How can I hide the links to my video/subtitles/audio/tracks?
|
||||
|
||||
It's impossible to hide the network requests a browser makes and difficult to
|
||||
|
||||
+13
-13
@@ -6,13 +6,13 @@
|
||||
* [Choosing a video format](#choosing-a-video-format)
|
||||
* [I want to have a single source and don't care about live/adaptive streaming:](#i-want-to-have-a-single-source-and-dont-care-about-liveadaptive-streaming)
|
||||
* [I need adaptive streaming or live streaming](#i-need-adaptive-streaming-or-live-streaming)
|
||||
* [Make sure you are using formats that Video.js can play:](#make-sure-you-are-using-formats-that-videojs-can-play)
|
||||
* [Make sure that the codec used in the file container is supported:](#make-sure-that-the-codec-used-in-the-file-container-is-supported)
|
||||
* [Make sure you are using formats that video.js can play:](#make-sure-you-are-using-formats-that-videojs-can-play)
|
||||
* [Make sure that the codec for that is being used in the file container is supported:](#make-sure-that-the-codec-for-that-is-being-used-in-the-file-container-is-supported)
|
||||
* [If you are using Flash videos:](#if-you-are-using-flash-videos)
|
||||
* [Problems when hosting media](#problems-when-hosting-media)
|
||||
* [Problems with fullscreen](#problems-with-fullscreen)
|
||||
* [Problems with Fullscreen](#problems-with-fullscreen)
|
||||
* [Problems with playback](#problems-with-playback)
|
||||
* [Video.js Errors](#videojs-errors)
|
||||
* [video.js Errors](#videojs-errors)
|
||||
* [vdata123456 errors](#vdata123456-errors)
|
||||
|
||||
## Problems with media formats
|
||||
@@ -22,7 +22,7 @@
|
||||
#### I want to have a single source and don't care about live/adaptive streaming:
|
||||
|
||||
Most browsers now play MP4 with h264 video. If you want to have a single source, and neither live streaming
|
||||
nor adaptive streaming is a consideration, MP4 with h264 video and acc audio is a good choice.
|
||||
nor adaptive streaming is a consideration, MP4 is a good choice.
|
||||
|
||||
#### I need adaptive streaming or live streaming
|
||||
|
||||
@@ -30,17 +30,17 @@ Use HLS with [videojs-contrib-hls][hls] or
|
||||
Use Dash with [videojs-contrib-dash][dash].
|
||||
HLS is more convenient as mobile browsers have native support.
|
||||
|
||||
### Make sure you are using formats that Video.js can play:
|
||||
### Make sure you are using formats that video.js can play:
|
||||
|
||||
* Does your browser/OS support the type of media that you are trying to play?
|
||||
* Do you have a Video.js plugin that will add support for a media format to Video.js? For example:
|
||||
* Do you have a video.js plugin that will add support for a media format to video.js? For Example:
|
||||
* [videojs-youtube][youtube]
|
||||
* [videojs-contrib-hls][hls]
|
||||
* [videojs-contrib-dash][dash]
|
||||
* Verify that you are using the correct [mime-type/content-type][media-types] for your videos.
|
||||
This is used to determine if Video.js can play a certain type of media.
|
||||
This is used to determine if video.js can play a certain type of media.
|
||||
|
||||
### Make sure that the codec used in the file container is supported:
|
||||
### Make sure that the codec for that is being used in the file container is supported:
|
||||
|
||||
* MP4 in browsers typically only supports h264 video and MP3 or AAC audio
|
||||
* Some low end phones save video in 3GP format but give it an MP4 extension. These files will not play.
|
||||
@@ -48,7 +48,7 @@ HLS is more convenient as mobile browsers have native support.
|
||||
### If you are using Flash videos:
|
||||
|
||||
* Make sure that Flash is installed
|
||||
* Make sure the Flash tech is included with Video.js (in `video.js >= v6.0.0` it won't be by default, see [videojs-flash][flash])
|
||||
* Make sure the Flash tech is included with video.js (in `video.js >= v6.0.0` it won't be, see [videojs-flash][flash])
|
||||
* Flash media include RTMP streams and FLV format media.
|
||||
* SWF is not a media format
|
||||
|
||||
@@ -63,7 +63,7 @@ HLS is more convenient as mobile browsers have native support.
|
||||
* You are using [videojs-contrib-hls][hls], [videojs-contrib-dash][dash] and your media is served from a different domain than your page.
|
||||
* You are using [text tracks][text-tracks] (captions, subtitles, etc.) and they are being served from a different domain than your page.
|
||||
|
||||
## Problems with fullscreen
|
||||
## Problems with Fullscreen
|
||||
|
||||
* If your player is in an iframe, the parent iframes must have the following attributes for fullscreen to be allowed:
|
||||
* `allowfullscreen`
|
||||
@@ -72,13 +72,13 @@ HLS is more convenient as mobile browsers have native support.
|
||||
|
||||
## Problems with playback
|
||||
|
||||
* Make sure that the media host supports byte-range requests, this could be breaking playback. See [Problems when hosting media][hosting-media] for more info.
|
||||
* Make sure that the media host supports byte-range requests, this could be breaking playback. See [Problems when Hosting media][hosting-media] for more info.
|
||||
* If your media is taking a long time to start playback or the entire mediadownloads before playback:
|
||||
* It is likely that metadata for the media has not been included at the start of the media. In MP4 terms this is called
|
||||
the "moov atom". Many encoders are configured to do this by default, others may require you to choose
|
||||
a "fast start" or "optimize for streaming" option.
|
||||
|
||||
## Video.js Errors
|
||||
## video.js Errors
|
||||
|
||||
### vdata123456 errors
|
||||
|
||||
|
||||
+7
-10
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "5.20.2",
|
||||
"version": "5.15.1",
|
||||
"main": "./es5/video.js",
|
||||
"style": "./dist/video-js.css",
|
||||
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
|
||||
@@ -22,13 +22,12 @@
|
||||
"clean": "grunt clean",
|
||||
"grunt": "grunt",
|
||||
"lint": "vjsstandard",
|
||||
"start": "grunt dev",
|
||||
"start": "grunt watchAll",
|
||||
"test": "grunt test",
|
||||
"docs": "npm run docs:lint && npm run docs:api",
|
||||
"docs:api": "jsdoc -r src/js -d docs/api -c .jsdoc.json",
|
||||
"docs:lint": "remark -- './**/*.md'",
|
||||
"docs:fix": "remark --output -- './**/*.md'",
|
||||
"babel": "babel src/js -d es5"
|
||||
"docs:fix": "remark --output -- './**/*.md'"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -41,12 +40,11 @@
|
||||
"tsml": "1.0.1",
|
||||
"videojs-font": "2.0.0",
|
||||
"videojs-ie8": "1.1.2",
|
||||
"videojs-swf": "5.4.1",
|
||||
"videojs-vtt.js": "0.12.4",
|
||||
"videojs-swf": "5.1.0",
|
||||
"videojs-vtt.js": "0.12.1",
|
||||
"xhr": "2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"aliasify": "^2.1.0",
|
||||
"babel-cli": "^6.11.4",
|
||||
"babel-plugin-inline-json": "^1.1.1",
|
||||
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
|
||||
@@ -66,6 +64,7 @@
|
||||
"es5-shim": "^4.1.3",
|
||||
"es6-shim": "^0.35.1",
|
||||
"ghooks": "^1.3.2",
|
||||
"gkatsev-grunt-sass": "^1.1.1",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-accessibility": "^5.0.0",
|
||||
"grunt-babel": "^6.0.0",
|
||||
@@ -84,14 +83,13 @@
|
||||
"grunt-fastly": "^0.1.3",
|
||||
"grunt-github-releaser": "^0.1.17",
|
||||
"grunt-karma": "^2.0.0",
|
||||
"grunt-sass": "^2.0.0",
|
||||
"grunt-shell": "^2.0.0",
|
||||
"grunt-version": "~1.1.1",
|
||||
"grunt-videojs-languages": "0.0.4",
|
||||
"grunt-zip": "0.17.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"jsdoc": "^3.4.2",
|
||||
"karma": "1.3.0",
|
||||
"karma": "^1.2.0",
|
||||
"karma-browserify": "^5.1.0",
|
||||
"karma-browserstack-launcher": "^1.0.1",
|
||||
"karma-chrome-launcher": "^2.0.0",
|
||||
@@ -113,7 +111,6 @@
|
||||
"remark-lint": "^5.2.0",
|
||||
"remark-toc": "^3.1.0",
|
||||
"remark-validate-links": "^5.0.0",
|
||||
"shelljs": "^0.7.5",
|
||||
"sinon": "^1.16.1",
|
||||
"time-grunt": "^1.1.1",
|
||||
"uglify-js": "~2.7.3",
|
||||
|
||||
@@ -50,8 +50,3 @@
|
||||
.vjs-error .vjs-big-play-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Show big play button if video is paused and .vjs-show-big-play-button-on-pause is set on video element
|
||||
.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
// Avoiding helvetica: issue #376
|
||||
font-family: $text-font-family;
|
||||
|
||||
@include user-select(none);
|
||||
|
||||
// Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when
|
||||
// checking fullScreenEnabled.
|
||||
&:-moz-full-screen { position: absolute; }
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
// Hide the poster when controls are disabled because it's clickable
|
||||
// and the native poster can take over
|
||||
.vjs-controls-disabled .vjs-poster {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Hide the poster when native controls are used otherwise it covers them
|
||||
.vjs-using-native-controls .vjs-poster {
|
||||
display: none;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
.video-js .vjs-progress-holder .vjs-load-progress div {
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
height: 0.3em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
// updated by javascript during playback
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
padding: 0;
|
||||
margin: 0 0.45em 0 0.45em;
|
||||
|
||||
@include user-select(none);
|
||||
|
||||
@include background-color-with-alpha($secondary-background-color, $secondary-background-transparency);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,6 @@ import Component from './component.js';
|
||||
* @extends Button
|
||||
*/
|
||||
class BigPlayButton extends Button {
|
||||
constructor(player, options) {
|
||||
super(player, options);
|
||||
|
||||
this.mouseused_ = false;
|
||||
|
||||
this.on('mousedown', this.handleMouseDown);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the default DOM `className`.
|
||||
@@ -41,40 +34,7 @@ class BigPlayButton extends Button {
|
||||
* @listens click
|
||||
*/
|
||||
handleClick(event) {
|
||||
const playPromise = this.player_.play();
|
||||
|
||||
// exit early if clicked via the mouse
|
||||
if (this.mouseused_ && event.clientX && event.clientY) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cb = this.player_.getChild('controlBar');
|
||||
const playToggle = cb && cb.getChild('playToggle');
|
||||
|
||||
if (!playToggle) {
|
||||
this.player_.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
const playFocus = () => playToggle.focus();
|
||||
|
||||
if (playPromise && playPromise.then) {
|
||||
const ignoreRejectedPlayPromise = () => {};
|
||||
|
||||
playPromise.then(playFocus, ignoreRejectedPlayPromise);
|
||||
} else {
|
||||
this.setTimeout(playFocus, 1);
|
||||
}
|
||||
}
|
||||
|
||||
handleKeyPress(event) {
|
||||
this.mouseused_ = false;
|
||||
|
||||
super.handleKeyPress(event);
|
||||
}
|
||||
|
||||
handleMouseDown(event) {
|
||||
this.mouseused_ = true;
|
||||
this.player_.play();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,11 +121,7 @@ class ClickableComponent extends Component {
|
||||
|
||||
this.controlText_ = text;
|
||||
this.controlTextEl_.innerHTML = localizedText;
|
||||
|
||||
if (!this.nonIconControl) {
|
||||
// Set title attribute if only an icon is shown
|
||||
el.setAttribute('title', localizedText);
|
||||
}
|
||||
el.setAttribute('title', localizedText);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -152,10 +148,8 @@ class ClickableComponent extends Component {
|
||||
if (typeof this.tabIndex_ !== 'undefined') {
|
||||
this.el_.setAttribute('tabIndex', this.tabIndex_);
|
||||
}
|
||||
this.off(['tap', 'click'], this.handleClick);
|
||||
this.off('focus', this.handleFocus);
|
||||
this.off('blur', this.handleBlur);
|
||||
this.on(['tap', 'click'], this.handleClick);
|
||||
this.on('tap', this.handleClick);
|
||||
this.on('click', this.handleClick);
|
||||
this.on('focus', this.handleFocus);
|
||||
this.on('blur', this.handleBlur);
|
||||
return this;
|
||||
@@ -173,7 +167,8 @@ class ClickableComponent extends Component {
|
||||
if (typeof this.tabIndex_ !== 'undefined') {
|
||||
this.el_.removeAttribute('tabIndex');
|
||||
}
|
||||
this.off(['tap', 'click'], this.handleClick);
|
||||
this.off('tap', this.handleClick);
|
||||
this.off('click', this.handleClick);
|
||||
this.off('focus', this.handleFocus);
|
||||
this.off('blur', this.handleBlur);
|
||||
return this;
|
||||
|
||||
+1
-15
@@ -392,7 +392,7 @@ class Component {
|
||||
|
||||
// If a name wasn't used to create the component, check if we can use the
|
||||
// name function of the component
|
||||
componentName = componentName || (component.name && toTitleCase(component.name()));
|
||||
componentName = componentName || (component.name && component.name());
|
||||
|
||||
if (componentName) {
|
||||
this.childNameIndex_[componentName] = component;
|
||||
@@ -1232,20 +1232,6 @@ class Component {
|
||||
return this.currentDimension('height');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the focus to this component
|
||||
*/
|
||||
focus() {
|
||||
this.el_.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the focus from this component
|
||||
*/
|
||||
blur() {
|
||||
this.el_.blur();
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit a 'tap' events when touch event support gets detected. This gets used to
|
||||
* support toggling the controls through a tap on the video. They get enabled
|
||||
|
||||
@@ -49,9 +49,6 @@ class AudioTrackButton extends TrackButton {
|
||||
* An array of menu items
|
||||
*/
|
||||
createItems(items = []) {
|
||||
// if there's only one audio track, there no point in showing it
|
||||
this.hideThreshold_ = 1;
|
||||
|
||||
const tracks = this.player_.audioTracks && this.player_.audioTracks();
|
||||
|
||||
if (!tracks) {
|
||||
|
||||
@@ -81,7 +81,7 @@ class MuteToggle extends Button {
|
||||
const vol = this.player_.volume();
|
||||
let level = 3;
|
||||
|
||||
if (this.player_.muted()) {
|
||||
if (vol === 0 || this.player_.muted()) {
|
||||
level = 0;
|
||||
} else if (vol < 0.33) {
|
||||
level = 1;
|
||||
|
||||
@@ -27,8 +27,6 @@ class PlaybackRateMenuItem extends MenuItem {
|
||||
// Modify options for parent MenuItem class's init.
|
||||
options.label = label;
|
||||
options.selected = rate === 1;
|
||||
options.selectable = true;
|
||||
|
||||
super(player, options);
|
||||
|
||||
this.label = label;
|
||||
|
||||
@@ -122,12 +122,15 @@ class SeekBar extends Slider {
|
||||
* @listens mousedown
|
||||
*/
|
||||
handleMouseDown(event) {
|
||||
super.handleMouseDown(event);
|
||||
|
||||
this.player_.scrubbing(true);
|
||||
|
||||
this.videoWasPlaying = !this.player_.paused();
|
||||
this.player_.pause();
|
||||
|
||||
super.handleMouseDown(event);
|
||||
this.pauseTimer_ = this.setTimeout(function() {
|
||||
this.player_.pause();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +151,11 @@ class SeekBar extends Slider {
|
||||
|
||||
// Set new time (tell player to seek to new time)
|
||||
this.player_.currentTime(newTime);
|
||||
|
||||
if (event.type === 'mousemove') {
|
||||
this.clearTimeout(this.pauseTimer_);
|
||||
this.player_.pause();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,6 +169,8 @@ class SeekBar extends Slider {
|
||||
handleMouseUp(event) {
|
||||
super.handleMouseUp(event);
|
||||
|
||||
this.clearTimeout(this.pauseTimer_);
|
||||
|
||||
this.player_.scrubbing(false);
|
||||
if (this.videoWasPlaying) {
|
||||
this.player_.play();
|
||||
|
||||
@@ -39,6 +39,33 @@ class CaptionsButton extends TextTrackButton {
|
||||
return `vjs-captions-button ${super.buildCSSClass()}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update caption menu items
|
||||
*
|
||||
* @param {EventTarget~Event} [event]
|
||||
* The `addtrack` or `removetrack` event that caused this function to be
|
||||
* called.
|
||||
*
|
||||
* @listens TextTrackList#addtrack
|
||||
* @listens TextTrackList#removetrack
|
||||
*/
|
||||
update(event) {
|
||||
let threshold = 2;
|
||||
|
||||
super.update();
|
||||
|
||||
// if native, then threshold is 1 because no settings button
|
||||
if (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) {
|
||||
threshold = 1;
|
||||
}
|
||||
|
||||
if (this.items && this.items.length > threshold) {
|
||||
this.show();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create caption menu items
|
||||
*
|
||||
@@ -50,8 +77,6 @@ class CaptionsButton extends TextTrackButton {
|
||||
|
||||
if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks)) {
|
||||
items.push(new CaptionSettingsMenuItem(this.player_, {kind: this.kind_}));
|
||||
|
||||
this.hideThreshold_ += 1;
|
||||
}
|
||||
|
||||
return super.createItems(items);
|
||||
|
||||
@@ -40,7 +40,6 @@ class TextTrackButton extends TrackButton {
|
||||
createItems(items = []) {
|
||||
// Add an OFF menu item to turn all tracks off
|
||||
items.push(new OffTextTrackMenuItem(this.player_, {kind: this.kind_}));
|
||||
this.hideThreshold_ += 1;
|
||||
|
||||
const tracks = this.player_.textTracks();
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ class TextTrackMenuItem extends MenuItem {
|
||||
if (tracks) {
|
||||
const changeHandler = Fn.bind(this, this.handleTracksChange);
|
||||
|
||||
player.on(['loadstart', 'texttrackchange'], changeHandler);
|
||||
tracks.addEventListener('change', changeHandler);
|
||||
this.on('dispose', function() {
|
||||
tracks.removeEventListener('change', changeHandler);
|
||||
@@ -103,10 +102,8 @@ class TextTrackMenuItem extends MenuItem {
|
||||
}
|
||||
|
||||
if (track === this.track) {
|
||||
if (track.mode !== 'showing') {
|
||||
track.mode = 'showing';
|
||||
}
|
||||
} else if (track.mode !== 'disabled') {
|
||||
track.mode = 'showing';
|
||||
} else {
|
||||
track.mode = 'disabled';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ class ErrorDisplay extends ModalDialog {
|
||||
* @private
|
||||
*/
|
||||
ErrorDisplay.prototype.options_ = mergeOptions(ModalDialog.prototype.options_, {
|
||||
pauseOnOpen: false,
|
||||
fillAlways: true,
|
||||
temporary: false,
|
||||
uncloseable: true
|
||||
|
||||
@@ -58,9 +58,9 @@ class MenuButton extends ClickableComponent {
|
||||
this.buttonPressed_ = false;
|
||||
this.el_.setAttribute('aria-expanded', 'false');
|
||||
|
||||
if (this.items && this.items.length <= this.hideThreshold_) {
|
||||
if (this.items && this.items.length === 0) {
|
||||
this.hide();
|
||||
} else {
|
||||
} else if (this.items && this.items.length > 1) {
|
||||
this.show();
|
||||
}
|
||||
}
|
||||
@@ -74,16 +74,6 @@ class MenuButton extends ClickableComponent {
|
||||
createMenu() {
|
||||
const menu = new Menu(this.player_);
|
||||
|
||||
/**
|
||||
* Hide the menu if the number of items is less than or equal to this threshold. This defaults
|
||||
* to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list
|
||||
* it here because every time we run `createMenu` we need to reset the value.
|
||||
*
|
||||
* @protected
|
||||
* @type {Number}
|
||||
*/
|
||||
this.hideThreshold_ = 0;
|
||||
|
||||
// Add a title list item to the top
|
||||
if (this.options_.title) {
|
||||
const title = Dom.createEl('li', {
|
||||
@@ -92,8 +82,6 @@ class MenuButton extends ClickableComponent {
|
||||
tabIndex: -1
|
||||
});
|
||||
|
||||
this.hideThreshold_ += 1;
|
||||
|
||||
menu.children_.unshift(title);
|
||||
Dom.insertElFirst(title, menu.contentEl());
|
||||
}
|
||||
|
||||
@@ -54,9 +54,6 @@ class MenuItem extends ClickableComponent {
|
||||
* The element that gets created.
|
||||
*/
|
||||
createEl(type, props, attrs) {
|
||||
// The control is textual, not just an icon
|
||||
this.nonIconControl = true;
|
||||
|
||||
return super.createEl('li', assign({
|
||||
className: 'vjs-menu-item',
|
||||
innerHTML: this.localize(this.options_.label),
|
||||
|
||||
@@ -180,7 +180,7 @@ class ModalDialog extends Component {
|
||||
// playing state.
|
||||
this.wasPlaying_ = !player.paused();
|
||||
|
||||
if (this.options_.pauseOnOpen && this.wasPlaying_) {
|
||||
if (this.wasPlaying_) {
|
||||
player.pause();
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ class ModalDialog extends Component {
|
||||
this.trigger('beforemodalclose');
|
||||
this.opened_ = false;
|
||||
|
||||
if (this.wasPlaying_ && this.options_.pauseOnOpen) {
|
||||
if (this.wasPlaying_) {
|
||||
player.play();
|
||||
}
|
||||
|
||||
@@ -427,7 +427,6 @@ class ModalDialog extends Component {
|
||||
* @private
|
||||
*/
|
||||
ModalDialog.prototype.options_ = {
|
||||
pauseOnOpen: true,
|
||||
temporary: true
|
||||
};
|
||||
|
||||
|
||||
+5
-53
@@ -413,11 +413,6 @@ class Player extends Component {
|
||||
// Make player easily findable by ID
|
||||
Player.players[this.id_] = this;
|
||||
|
||||
// Add a major version class to aid css in plugins
|
||||
const majorVersion = require('../../package.json').version.split('.')[0];
|
||||
|
||||
this.addClass(`vjs-v${majorVersion}`);
|
||||
|
||||
// When the player is first initialized, trigger activity so components
|
||||
// like the control bar show themselves if needed
|
||||
this.userActive(true);
|
||||
@@ -478,7 +473,7 @@ class Player extends Component {
|
||||
createEl() {
|
||||
const tag = this.tag;
|
||||
let el;
|
||||
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute('data-vjs-player');
|
||||
|
||||
if (playerElIngest) {
|
||||
el = this.el_ = tag.parentNode;
|
||||
@@ -486,9 +481,6 @@ class Player extends Component {
|
||||
el = this.el_ = super.createEl('div');
|
||||
}
|
||||
|
||||
// set tabindex to -1 so we could focus on the player element
|
||||
tag.setAttribute('tabindex', '-1');
|
||||
|
||||
// Remove width/height attrs from tag so CSS can make it 100% width/height
|
||||
tag.removeAttribute('width');
|
||||
tag.removeAttribute('height');
|
||||
@@ -827,7 +819,6 @@ class Player extends Component {
|
||||
'textTracks': this.textTracks_,
|
||||
'audioTracks': this.audioTracks_,
|
||||
'autoplay': this.options_.autoplay,
|
||||
'playsinline': this.options_.playsinline,
|
||||
'preload': this.options_.preload,
|
||||
'loop': this.options_.loop,
|
||||
'muted': this.options_.muted,
|
||||
@@ -1654,7 +1645,8 @@ class Player extends Component {
|
||||
*
|
||||
* @return {Player|number}
|
||||
* - the current time in seconds when getting
|
||||
* - a reference to the current player object when setting
|
||||
* - a reference to the current player object when
|
||||
* getting
|
||||
*/
|
||||
currentTime(seconds) {
|
||||
if (seconds !== undefined) {
|
||||
@@ -1694,11 +1686,10 @@ class Player extends Component {
|
||||
*/
|
||||
duration(seconds) {
|
||||
if (seconds === undefined) {
|
||||
// return NaN if the duration is not known
|
||||
return this.cache_.duration !== undefined ? this.cache_.duration : NaN;
|
||||
return this.cache_.duration || 0;
|
||||
}
|
||||
|
||||
seconds = parseFloat(seconds);
|
||||
seconds = parseFloat(seconds) || 0;
|
||||
|
||||
// Standardize on Inifity for signaling video is live
|
||||
if (seconds < 0) {
|
||||
@@ -2387,31 +2378,6 @@ class Player extends Component {
|
||||
return this.techGet_('autoplay', value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set or unset the playsinline attribute.
|
||||
* Playsinline tells the browser that non-fullscreen playback is preferred.
|
||||
*
|
||||
* @param {boolean} [value]
|
||||
* - true means that we should try to play inline by default
|
||||
* - false means that we should use the browser's default playback mode,
|
||||
* which in most cases is inline. iOS Safari is a notable exception
|
||||
* and plays fullscreen by default.
|
||||
*
|
||||
* @return {string|Player}
|
||||
* - the current value of playsinline
|
||||
* - the player when setting
|
||||
*
|
||||
* @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
|
||||
*/
|
||||
playsinline(value) {
|
||||
if (value !== undefined) {
|
||||
this.techCall_('setPlaysinline', value);
|
||||
this.options_.playsinline = value;
|
||||
return this;
|
||||
}
|
||||
return this.techGet_('playsinline');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or set the loop attribute on the video element.
|
||||
*
|
||||
@@ -3020,20 +2986,6 @@ class Player extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets available media playback quality metrics as specified by the W3C's Media
|
||||
* Playback Quality API.
|
||||
*
|
||||
* @see [Spec]{@link https://wicg.github.io/media-playback-quality}
|
||||
*
|
||||
* @return {Object|undefined}
|
||||
* An object with supported media playback quality metrics or undefined if there
|
||||
* is no tech or the tech does not support it.
|
||||
*/
|
||||
getVideoPlaybackQuality() {
|
||||
return this.techGet_('getVideoPlaybackQuality');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get video width
|
||||
*
|
||||
|
||||
@@ -121,10 +121,7 @@ class PosterImage extends ClickableComponent {
|
||||
*/
|
||||
handleClick(event) {
|
||||
// We don't want a click to trigger playback when controls are disabled
|
||||
if (!this.player_.controls()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// but CSS should be hiding the poster to prevent that from happening
|
||||
if (this.player_.paused()) {
|
||||
this.player_.play();
|
||||
} else {
|
||||
|
||||
@@ -341,29 +341,6 @@ class Flash extends Tech {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets available media playback quality metrics as specified by the W3C's Media
|
||||
* Playback Quality API.
|
||||
*
|
||||
* @see [Spec]{@link https://wicg.github.io/media-playback-quality}
|
||||
*
|
||||
* @return {Object}
|
||||
* An object with supported media playback quality metrics
|
||||
*/
|
||||
getVideoPlaybackQuality() {
|
||||
const videoPlaybackQuality = this.el_.vjs_getProperty('getVideoPlaybackQuality');
|
||||
|
||||
if (window.performance && typeof window.performance.now === 'function') {
|
||||
videoPlaybackQuality.creationTime = window.performance.now();
|
||||
} else if (window.performance &&
|
||||
window.performance.timing &&
|
||||
typeof window.performance.timing.navigationStart === 'number') {
|
||||
videoPlaybackQuality.creationTime =
|
||||
window.Date.now() - window.performance.timing.navigationStart;
|
||||
}
|
||||
|
||||
return videoPlaybackQuality;
|
||||
}
|
||||
}
|
||||
|
||||
// Create setters and getters for attributes
|
||||
|
||||
+4
-78
@@ -223,7 +223,7 @@ class Html5 extends Tech {
|
||||
}
|
||||
|
||||
// Update specific tag settings, in case they were overridden
|
||||
const settingsAttrs = ['autoplay', 'preload', 'loop', 'muted', 'playsinline'];
|
||||
const settingsAttrs = ['autoplay', 'preload', 'loop', 'muted'];
|
||||
|
||||
for (let i = settingsAttrs.length - 1; i >= 0; i--) {
|
||||
const attr = settingsAttrs[i];
|
||||
@@ -557,12 +557,9 @@ class Html5 extends Tech {
|
||||
};
|
||||
|
||||
const beginFn = function() {
|
||||
if ('webkitPresentationMode' in this.el_ &&
|
||||
this.el_.webkitPresentationMode !== 'picture-in-picture') {
|
||||
this.one('webkitendfullscreen', endFn);
|
||||
this.one('webkitendfullscreen', endFn);
|
||||
|
||||
this.trigger('fullscreenchange', { isFullscreen: true });
|
||||
}
|
||||
this.trigger('fullscreenchange', { isFullscreen: true });
|
||||
};
|
||||
|
||||
this.on('webkitbeginfullscreen', beginFn);
|
||||
@@ -797,77 +794,6 @@ class Html5 extends Tech {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of `playsinline` from the media element. `playsinline` indicates
|
||||
* to the browser that non-fullscreen playback is preferred when fullscreen
|
||||
* playback is the native default, such as in iOS Safari.
|
||||
*
|
||||
* @method Html5#playsinline
|
||||
* @return {boolean}
|
||||
* - The value of `playsinline` from the media element.
|
||||
* - True indicates that the media should play inline.
|
||||
* - False indicates that the media should not play inline.
|
||||
*
|
||||
* @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
|
||||
*/
|
||||
playsinline() {
|
||||
return this.el_.hasAttribute('playsinline');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of `playsinline` from the media element. `playsinline` indicates
|
||||
* to the browser that non-fullscreen playback is preferred when fullscreen
|
||||
* playback is the native default, such as in iOS Safari.
|
||||
*
|
||||
* @method Html5#setPlaysinline
|
||||
* @param {boolean} playsinline
|
||||
* - True indicates that the media should play inline.
|
||||
* - False indicates that the media should not play inline.
|
||||
*
|
||||
* @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
|
||||
*/
|
||||
setPlaysinline(value) {
|
||||
if (value) {
|
||||
this.el_.setAttribute('playsinline', 'playsinline');
|
||||
} else {
|
||||
this.el_.removeAttribute('playsinline');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets available media playback quality metrics as specified by the W3C's Media
|
||||
* Playback Quality API.
|
||||
*
|
||||
* @see [Spec]{@link https://wicg.github.io/media-playback-quality}
|
||||
*
|
||||
* @return {Object}
|
||||
* An object with supported media playback quality metrics
|
||||
*/
|
||||
getVideoPlaybackQuality() {
|
||||
if (typeof this.el().getVideoPlaybackQuality === 'function') {
|
||||
return this.el().getVideoPlaybackQuality();
|
||||
}
|
||||
|
||||
const videoPlaybackQuality = {};
|
||||
|
||||
if (typeof this.el().webkitDroppedFrameCount !== 'undefined' &&
|
||||
typeof this.el().webkitDecodedFrameCount !== 'undefined') {
|
||||
videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
|
||||
videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
|
||||
}
|
||||
|
||||
if (window.performance && typeof window.performance.now === 'function') {
|
||||
videoPlaybackQuality.creationTime = window.performance.now();
|
||||
} else if (window.performance &&
|
||||
window.performance.timing &&
|
||||
typeof window.performance.timing.navigationStart === 'number') {
|
||||
videoPlaybackQuality.creationTime =
|
||||
window.Date.now() - window.performance.timing.navigationStart;
|
||||
}
|
||||
|
||||
return videoPlaybackQuality;
|
||||
}
|
||||
}
|
||||
|
||||
/* HTML5 Support Testing ---------------------------------------------------- */
|
||||
@@ -939,7 +865,7 @@ Html5.canControlVolume = function() {
|
||||
Html5.canControlPlaybackRate = function() {
|
||||
// Playback rate API is implemented in Android Chrome, but doesn't do anything
|
||||
// https://github.com/videojs/video.js/issues/3180
|
||||
if (browser.IS_ANDROID && browser.IS_CHROME && browser.CHROME_VERSION < 58) {
|
||||
if (browser.IS_ANDROID && browser.IS_CHROME) {
|
||||
return false;
|
||||
}
|
||||
// IE will error if Windows Media Player not installed #3315
|
||||
|
||||
+13
-77
@@ -17,7 +17,6 @@ import { bufferedPercent } from '../utils/buffer.js';
|
||||
import MediaError from '../media-error.js';
|
||||
import window from 'global/window';
|
||||
import document from 'global/document';
|
||||
import {isPlain} from '../utils/obj';
|
||||
|
||||
/**
|
||||
* An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string
|
||||
@@ -145,10 +144,6 @@ class Tech extends Component {
|
||||
if (!options.nativeControlsForTouch) {
|
||||
this.emitTapEvents();
|
||||
}
|
||||
|
||||
if (this.constructor) {
|
||||
this.name_ = this.constructor.name || 'Unknown Tech';
|
||||
}
|
||||
}
|
||||
|
||||
/* Fallbacks for unsupported event types
|
||||
@@ -527,31 +522,13 @@ class Tech extends Component {
|
||||
*
|
||||
* @fires Tech#vttjsloaded
|
||||
* @fires Tech#vttjserror
|
||||
* @fires Tech#texttrackchange
|
||||
*/
|
||||
addWebVttScript_() {
|
||||
if (window.WebVTT) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initially, Tech.el_ is a child of a dummy-div wait until the Component system
|
||||
// signals that the Tech is ready at which point Tech.el_ is part of the DOM
|
||||
// before inserting the WebVTT script
|
||||
if (document.body.contains(this.el())) {
|
||||
const vtt = require('videojs-vtt.js');
|
||||
|
||||
// load via require if available and vtt.js script location was not passed in
|
||||
// as an option. novtt builds will turn the above require call into an empty object
|
||||
// which will cause this if check to always fail.
|
||||
if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) {
|
||||
this.trigger('vttjsloaded');
|
||||
return;
|
||||
}
|
||||
|
||||
// load vtt.js via the script location option or the cdn of no location was
|
||||
// passed in
|
||||
if (!window.WebVTT && this.el().parentNode !== null && this.el().parentNode !== undefined) {
|
||||
const script = document.createElement('script');
|
||||
|
||||
script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js';
|
||||
script.src = this.options_['vtt.js'] || '../node_modules/videojs-vtt.js/dist/vtt.js';
|
||||
script.onload = () => {
|
||||
/**
|
||||
* Fired when vtt.js is loaded.
|
||||
@@ -578,10 +555,7 @@ class Tech extends Component {
|
||||
// we don't overwrite the injected window.WebVTT if it loads right away
|
||||
window.WebVTT = true;
|
||||
this.el().parentNode.appendChild(script);
|
||||
} else {
|
||||
this.ready(this.addWebVttScript_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -596,17 +570,20 @@ class Tech extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const remoteTracks = this.remoteTextTracks();
|
||||
const handleAddTrack = (e) => tracks.addTrack_(e.track);
|
||||
const handleRemoveTrack = (e) => tracks.removeTrack_(e.track);
|
||||
this.remoteTextTracks().on('addtrack', (e) => {
|
||||
this.textTracks().addTrack_(e.track);
|
||||
});
|
||||
|
||||
remoteTracks.on('addtrack', handleAddTrack);
|
||||
remoteTracks.on('removetrack', handleRemoveTrack);
|
||||
this.remoteTextTracks().on('removetrack', (e) => {
|
||||
this.textTracks().removeTrack_(e.track);
|
||||
});
|
||||
|
||||
this.addWebVttScript_();
|
||||
// Initially, Tech.el_ is a child of a dummy-div wait until the Component system
|
||||
// signals that the Tech is ready at which point Tech.el_ is part of the DOM
|
||||
// before inserting the WebVTT script
|
||||
this.on('ready', this.addWebVttScript_);
|
||||
|
||||
const updateDisplay = () => this.trigger('texttrackchange');
|
||||
|
||||
const textTracksChanges = () => {
|
||||
updateDisplay();
|
||||
|
||||
@@ -622,21 +599,9 @@ class Tech extends Component {
|
||||
|
||||
textTracksChanges();
|
||||
tracks.addEventListener('change', textTracksChanges);
|
||||
tracks.addEventListener('addtrack', textTracksChanges);
|
||||
tracks.addEventListener('removetrack', textTracksChanges);
|
||||
|
||||
this.on('dispose', function() {
|
||||
remoteTracks.off('addtrack', handleAddTrack);
|
||||
remoteTracks.off('removetrack', handleRemoveTrack);
|
||||
tracks.removeEventListener('change', textTracksChanges);
|
||||
tracks.removeEventListener('addtrack', textTracksChanges);
|
||||
tracks.removeEventListener('removetrack', textTracksChanges);
|
||||
|
||||
for (let i = 0; i < tracks.length; i++) {
|
||||
const track = tracks[i];
|
||||
|
||||
track.removeEventListener('cuechange', updateDisplay);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -805,21 +770,6 @@ class Tech extends Component {
|
||||
this.autoRemoteTextTracks_.removeTrack_(track);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets available media playback quality metrics as specified by the W3C's Media
|
||||
* Playback Quality API.
|
||||
*
|
||||
* @see [Spec]{@link https://wicg.github.io/media-playback-quality}
|
||||
*
|
||||
* @return {Object}
|
||||
* An object with supported media playback quality metrics
|
||||
*
|
||||
* @abstract
|
||||
*/
|
||||
getVideoPlaybackQuality() {
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* A method to set a poster from a `Tech`.
|
||||
*
|
||||
@@ -827,20 +777,6 @@ class Tech extends Component {
|
||||
*/
|
||||
setPoster() {}
|
||||
|
||||
/**
|
||||
* A method to check for the presence of the 'playsinine' <video> attribute.
|
||||
*
|
||||
* @abstract
|
||||
*/
|
||||
playsinline() {}
|
||||
|
||||
/**
|
||||
* A method to set or unset the 'playsinine' <video> attribute.
|
||||
*
|
||||
* @abstract
|
||||
*/
|
||||
setPlaysinline() {}
|
||||
|
||||
/*
|
||||
* Check if the tech can support the given mime-type.
|
||||
*
|
||||
|
||||
@@ -198,9 +198,7 @@ class TextTrack extends Track {
|
||||
});
|
||||
|
||||
if (mode !== 'disabled') {
|
||||
tt.tech_.ready(() => {
|
||||
tt.tech_.on('timeupdate', timeupdateHandler);
|
||||
}, true);
|
||||
tt.tech_.on('timeupdate', timeupdateHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,9 +232,7 @@ class TextTrack extends Track {
|
||||
}
|
||||
mode = newMode;
|
||||
if (mode === 'showing') {
|
||||
this.tech_.ready(() => {
|
||||
this.tech_.on('timeupdate', timeupdateHandler);
|
||||
}, true);
|
||||
this.tech_.on('timeupdate', timeupdateHandler);
|
||||
}
|
||||
/**
|
||||
* An event that fires when mode changes on this track. This allows
|
||||
@@ -332,23 +328,7 @@ class TextTrack extends Track {
|
||||
* @param {TextTrack~Cue} cue
|
||||
* The cue to add to our internal list
|
||||
*/
|
||||
addCue(originalCue) {
|
||||
let cue = originalCue;
|
||||
|
||||
if (window.vttjs && !(originalCue instanceof window.vttjs.VTTCue)) {
|
||||
cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
|
||||
|
||||
for (const prop in originalCue) {
|
||||
if (!(prop in cue)) {
|
||||
cue[prop] = originalCue[prop];
|
||||
}
|
||||
}
|
||||
|
||||
// make sure that `id` is copied over
|
||||
cue.id = originalCue.id;
|
||||
cue.originalCue_ = originalCue;
|
||||
}
|
||||
|
||||
addCue(cue) {
|
||||
const tracks = this.tech_.textTracks();
|
||||
|
||||
if (tracks) {
|
||||
@@ -370,17 +350,20 @@ class TextTrack extends Track {
|
||||
* The cue to remove from our internal list
|
||||
*/
|
||||
removeCue(removeCue) {
|
||||
let i = this.cues_.length;
|
||||
let removed = false;
|
||||
|
||||
while (i--) {
|
||||
for (let i = 0, l = this.cues_.length; i < l; i++) {
|
||||
const cue = this.cues_[i];
|
||||
|
||||
if (cue === removeCue || (cue.originalCue_ && cue.originalCue_ === removeCue)) {
|
||||
if (cue === removeCue) {
|
||||
this.cues_.splice(i, 1);
|
||||
this.cues.setCues_(this.cues_);
|
||||
break;
|
||||
removed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (removed) {
|
||||
this.cues.setCues_(this.cues_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,26 +62,10 @@ export const IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebki
|
||||
export const IS_FIREFOX = (/Firefox/i).test(USER_AGENT);
|
||||
export const IS_EDGE = (/Edge/i).test(USER_AGENT);
|
||||
export const IS_CHROME = !IS_EDGE && (/Chrome/i).test(USER_AGENT);
|
||||
export const CHROME_VERSION = (function() {
|
||||
const match = USER_AGENT.match(/Chrome\/(\d+)/);
|
||||
|
||||
if (match && match[1]) {
|
||||
return parseFloat(match[1]);
|
||||
}
|
||||
return null;
|
||||
}());
|
||||
export const IS_IE8 = (/MSIE\s8\.0/).test(USER_AGENT);
|
||||
export const IE_VERSION = (function() {
|
||||
const result = (/MSIE\s(\d+)\.\d/).exec(USER_AGENT);
|
||||
let version = result && parseFloat(result[1]);
|
||||
|
||||
if (!version && (/Trident\/7.0/i).test(USER_AGENT) && (/rv:11.0/).test(USER_AGENT)) {
|
||||
// IE 11 has a different user agent string than other IE versions
|
||||
version = 11.0;
|
||||
}
|
||||
|
||||
return version;
|
||||
}());
|
||||
export const IE_VERSION = (function(result) {
|
||||
return result && parseFloat(result[1]);
|
||||
}((/MSIE\s(\d+)\.\d/).exec(USER_AGENT)));
|
||||
|
||||
export const IS_SAFARI = (/Safari/i).test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;
|
||||
export const IS_ANY_SAFARI = IS_SAFARI || IS_IOS;
|
||||
|
||||
@@ -202,33 +202,6 @@ export function fixEvent(event) {
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether passive event listeners are supported
|
||||
*/
|
||||
let _supportsPassive = false;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
const opts = Object.defineProperty({}, 'passive', {
|
||||
get() {
|
||||
_supportsPassive = true;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('test', null, opts);
|
||||
} catch (e) {
|
||||
// disregard
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* Touch events Chrome expects to be passive
|
||||
*/
|
||||
const passiveEvents = [
|
||||
'touchstart',
|
||||
'touchmove'
|
||||
];
|
||||
|
||||
/**
|
||||
* Add an event listener to element
|
||||
* It stores the handler function in a separate cache object
|
||||
@@ -300,13 +273,7 @@ export function on(elem, type, fn) {
|
||||
|
||||
if (data.handlers[type].length === 1) {
|
||||
if (elem.addEventListener) {
|
||||
let options = false;
|
||||
|
||||
if (_supportsPassive &&
|
||||
passiveEvents.indexOf(type) > -1) {
|
||||
options = {passive: true};
|
||||
}
|
||||
elem.addEventListener(type, data.dispatcher, options);
|
||||
elem.addEventListener(type, data.dispatcher, false);
|
||||
} else if (elem.attachEvent) {
|
||||
elem.attachEvent('on' + type, data.dispatcher);
|
||||
}
|
||||
|
||||
+2
-18
@@ -30,22 +30,6 @@
|
||||
*/
|
||||
const toString = Object.prototype.toString;
|
||||
|
||||
/**
|
||||
* Get the keys of an Object
|
||||
*
|
||||
* @param {Object}
|
||||
* The Object to get the keys from
|
||||
*
|
||||
* @return {string[]}
|
||||
* An array of the keys from the object. Returns an empty array if the
|
||||
* object passed in was invalid or had no keys.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
const keys = function(object) {
|
||||
return isObject(object) ? Object.keys(object) : [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Array-like iteration for objects.
|
||||
*
|
||||
@@ -56,7 +40,7 @@ const keys = function(object) {
|
||||
* The callback function which is called for each key in the object.
|
||||
*/
|
||||
export function each(object, fn) {
|
||||
keys(object).forEach(key => fn(object[key], key));
|
||||
Object.keys(object).forEach(key => fn(object[key], key));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +61,7 @@ export function each(object, fn) {
|
||||
* The final accumulated value.
|
||||
*/
|
||||
export function reduce(object, fn, initial = 0) {
|
||||
return keys(object).reduce(
|
||||
return Object.keys(object).reduce(
|
||||
(accum, key) => fn(accum, object[key], key), initial);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -7,8 +7,6 @@
|
||||
|
||||
import window from 'global/window';
|
||||
import document from 'global/document';
|
||||
import * as browser from './utils/browser.js';
|
||||
import * as Dom from './utils/dom.js';
|
||||
import * as setup from './setup';
|
||||
import * as stylesheet from './utils/stylesheet.js';
|
||||
import Component from './component';
|
||||
@@ -25,6 +23,8 @@ import VideoTrack from './tracks/video-track.js';
|
||||
import { createTimeRanges } from './utils/time-ranges.js';
|
||||
import formatTime from './utils/format-time.js';
|
||||
import log from './utils/log.js';
|
||||
import * as Dom from './utils/dom.js';
|
||||
import * as browser from './utils/browser.js';
|
||||
import * as Url from './utils/url.js';
|
||||
import {isObject} from './utils/obj';
|
||||
import computedStyle from './utils/computed-style.js';
|
||||
|
||||
@@ -59,7 +59,6 @@ QUnit.test('should be able to access expected player API methods', function(asse
|
||||
assert.ok(player.userActive, 'userActive exists');
|
||||
assert.ok(player.usingNativeControls, 'usingNativeControls exists');
|
||||
assert.ok(player.isFullscreen, 'isFullscreen exists');
|
||||
assert.ok(player.getVideoPlaybackQuality, 'getVideoPlaybackQuality exists');
|
||||
|
||||
// Track methods
|
||||
assert.ok(player.audioTracks, 'audioTracks exists');
|
||||
|
||||
@@ -71,25 +71,3 @@ QUnit.test('handleClick should not be triggered when disabled', function() {
|
||||
testClickableComponent.dispose();
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('handleClick should not be triggered more than once when enabled', function() {
|
||||
let clicks = 0;
|
||||
|
||||
class TestClickableComponent extends ClickableComponent {
|
||||
handleClick() {
|
||||
clicks++;
|
||||
}
|
||||
}
|
||||
|
||||
const player = TestHelpers.makePlayer({});
|
||||
const testClickableComponent = new TestClickableComponent(player);
|
||||
const el = testClickableComponent.el();
|
||||
|
||||
testClickableComponent.enable();
|
||||
// Click should still be handled just once
|
||||
Events.trigger(el, 'click');
|
||||
QUnit.equal(clicks, 1, 'no additional click handler when already enabled ClickableComponent has been enabled again');
|
||||
|
||||
testClickableComponent.dispose();
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
@@ -99,19 +99,6 @@ QUnit.test('addChild should throw if the child does not exist', function(assert)
|
||||
|
||||
});
|
||||
|
||||
QUnit.test('addChild with instance should allow getting child correctly', function(assert) {
|
||||
const comp = new Component(getFakePlayer());
|
||||
const comp2 = new Component(getFakePlayer());
|
||||
|
||||
comp2.name = function() {
|
||||
return 'foo';
|
||||
};
|
||||
|
||||
comp.addChild(comp2);
|
||||
assert.ok(comp.getChild('foo'), 'we can get child with camelCase');
|
||||
assert.ok(comp.getChild('Foo'), 'we can get child with TitleCase');
|
||||
});
|
||||
|
||||
QUnit.test('should add a child component with title case name', function(assert) {
|
||||
const comp = new Component(getFakePlayer());
|
||||
|
||||
|
||||
@@ -208,35 +208,6 @@ QUnit.test('open() pauses playback, close() resumes', function(assert) {
|
||||
assert.strictEqual(playSpy.callCount, 1, 'player is resumed when the modal closes');
|
||||
});
|
||||
|
||||
QUnit.test('open() does not pause, close() does not play() with pauseOnOpen set to false', function(assert) {
|
||||
const playSpy = sinon.spy();
|
||||
const pauseSpy = sinon.spy();
|
||||
|
||||
// don't pause the video on modal open
|
||||
this.modal.options_.pauseOnOpen = false;
|
||||
|
||||
// Quick and dirty; make it looks like the player is playing.
|
||||
this.player.paused = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.player.play = function() {
|
||||
playSpy();
|
||||
};
|
||||
|
||||
this.player.pause = function() {
|
||||
pauseSpy();
|
||||
};
|
||||
|
||||
this.modal.open();
|
||||
|
||||
assert.expect(2);
|
||||
assert.strictEqual(pauseSpy.callCount, 0, 'player remains playing when the modal opens');
|
||||
|
||||
this.modal.close();
|
||||
assert.strictEqual(playSpy.callCount, 0, 'player is resumed when the modal closes');
|
||||
});
|
||||
|
||||
QUnit.test('open() hides controls, close() shows controls', function(assert) {
|
||||
this.modal.open();
|
||||
|
||||
|
||||
@@ -830,35 +830,6 @@ QUnit.test('should restore attributes from the original video tag when creating
|
||||
assert.equal(el.getAttribute('webkit-playsinline'), '', 'webkit-playsinline attribute was set properly');
|
||||
});
|
||||
|
||||
if (Html5.isSupported()) {
|
||||
QUnit.test('player.playsinline() should be able to get/set playsinline attribute', function(assert) {
|
||||
assert.expect(5);
|
||||
|
||||
const video = document.createElement('video');
|
||||
const player = TestHelpers.makePlayer({techOrder: ['html5']}, video);
|
||||
|
||||
// test setter
|
||||
assert.ok(!player.tech_.el().hasAttribute('playsinline'), 'playsinline has not yet been added');
|
||||
|
||||
player.playsinline(true);
|
||||
|
||||
assert.ok(player.tech_.el().hasAttribute('playsinline'), 'playsinline attribute added');
|
||||
|
||||
player.playsinline(false);
|
||||
|
||||
assert.ok(!player.tech_.el().hasAttribute('playsinline'), 'playsinline attribute removed');
|
||||
|
||||
// test getter
|
||||
player.tech_.el().setAttribute('playsinline', 'playsinline');
|
||||
|
||||
assert.ok(player.playsinline(), 'correctly detects playsinline attribute');
|
||||
|
||||
player.tech_.el().removeAttribute('playsinline');
|
||||
|
||||
assert.ok(!player.playsinline(), 'correctly detects absence of playsinline attribute');
|
||||
});
|
||||
}
|
||||
|
||||
QUnit.test('if tag exists and movingMediaElementInDOM, re-use the tag', function(assert) {
|
||||
// simulate attributes stored from the original tag
|
||||
const tag = Dom.createEl('video');
|
||||
@@ -1416,40 +1387,3 @@ QUnit.test('should not allow to register custom player when any player has been
|
||||
// reset the Player to the original value;
|
||||
videojs.registerComponent('Player', Player);
|
||||
});
|
||||
|
||||
QUnit.test('should add a class with major version', function(assert) {
|
||||
const majorVersion = require('../../package.json').version.split('.')[0];
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
assert.ok(player.hasClass('vjs-v' + majorVersion), 'the version class should be added to the player');
|
||||
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('player.duration() returns NaN if player.cache_.duration is undefined', function(assert) {
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
player.cache_.duration = undefined;
|
||||
assert.ok(Number.isNaN(player.duration()), 'returned NaN for unkown duration');
|
||||
});
|
||||
|
||||
QUnit.test('player.duration() returns player.cache_.duration if it is defined', function(assert) {
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
player.cache_.duration = 200;
|
||||
assert.equal(player.duration(), 200, 'returned correct integer duration');
|
||||
player.cache_.duration = 942;
|
||||
assert.equal(player.duration(), 942, 'returned correct integer duration');
|
||||
});
|
||||
|
||||
QUnit.test('player.duration() sets the value of player.cache_.duration', function(assert) {
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
// set an arbitrary initial cached duration value for testing the setter functionality
|
||||
player.cache_.duration = 1;
|
||||
|
||||
player.duration(NaN);
|
||||
assert.ok(Number.isNaN(player.duration()), 'duration() set and get NaN duration value');
|
||||
player.duration(200);
|
||||
assert.equal(player.duration(), 200, 'duration() set and get integer duration value');
|
||||
});
|
||||
|
||||
@@ -7,13 +7,12 @@ QUnit.test('should set options from data-setup even if autoSetup is not called b
|
||||
const el = TestHelpers.makeTag();
|
||||
|
||||
el.setAttribute('data-setup',
|
||||
'{"controls": true, "autoplay": false, "preload": "auto", "playsinline": true}');
|
||||
'{"controls": true, "autoplay": false, "preload": "auto"}');
|
||||
|
||||
const player = TestHelpers.makePlayer({}, el);
|
||||
|
||||
assert.ok(player.options_.controls === true);
|
||||
assert.ok(player.options_.autoplay === false);
|
||||
assert.ok(player.options_.preload === 'auto');
|
||||
assert.ok(player.options_.playsinline === true);
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import Flash from '../../../src/js/tech/flash.js';
|
||||
import { createTimeRange } from '../../../src/js/utils/time-ranges.js';
|
||||
import document from 'global/document';
|
||||
import window from 'global/window';
|
||||
import sinon from 'sinon';
|
||||
|
||||
// fake out the <object> interaction but leave all the other logic intact
|
||||
@@ -262,78 +261,3 @@ QUnit.test('duration returns NaN, Infinity or duration according to the HTML sta
|
||||
'duration returns duration property when readyState' +
|
||||
' and duration property are both higher than 0');
|
||||
});
|
||||
|
||||
QUnit.test('getVideoPlaybackQuality API exists', function(assert) {
|
||||
const propertyCalls = [];
|
||||
const videoPlaybackQuality = { test: 'test' };
|
||||
const mockFlash = {
|
||||
el_: {
|
||||
/* eslint-disable camelcase */
|
||||
vjs_getProperty(attr) {
|
||||
propertyCalls.push(attr);
|
||||
return videoPlaybackQuality;
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
}
|
||||
};
|
||||
|
||||
assert.deepEqual(Flash.prototype.getVideoPlaybackQuality.call(mockFlash),
|
||||
videoPlaybackQuality,
|
||||
'called to get property from flash');
|
||||
assert.equal(propertyCalls.length, 1, 'only one property call');
|
||||
assert.equal(propertyCalls[0],
|
||||
'getVideoPlaybackQuality',
|
||||
'called for getVideoPlaybackQuality');
|
||||
});
|
||||
|
||||
QUnit.test('getVideoPlaybackQuality uses best available creationTime', function(assert) {
|
||||
const origPerformance = window.performance;
|
||||
const origDate = window.Date;
|
||||
const videoPlaybackQuality = {};
|
||||
const mockFlash = {
|
||||
el_: {
|
||||
/* eslint-disable camelcase */
|
||||
vjs_getProperty(attr) {
|
||||
return videoPlaybackQuality;
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
}
|
||||
};
|
||||
|
||||
window.performance = void 0;
|
||||
assert.notOk(Flash.prototype.getVideoPlaybackQuality.call(mockFlash).creationTime,
|
||||
'no creationTime when no performance API available');
|
||||
|
||||
window.performance = {
|
||||
timing: {}
|
||||
};
|
||||
assert.notOk(Flash.prototype.getVideoPlaybackQuality.call(mockFlash).creationTime,
|
||||
'no creationTime when performance API insufficient');
|
||||
|
||||
window.performance = {
|
||||
now: () => 4
|
||||
};
|
||||
assert.equal(Flash.prototype.getVideoPlaybackQuality.call(mockFlash).creationTime,
|
||||
4,
|
||||
'creationTime is performance.now when available');
|
||||
|
||||
window.Date = {
|
||||
now: () => 10
|
||||
};
|
||||
window.performance = {
|
||||
timing: {
|
||||
navigationStart: 3
|
||||
}
|
||||
};
|
||||
assert.equal(Flash.prototype.getVideoPlaybackQuality.call(mockFlash).creationTime,
|
||||
7,
|
||||
'creationTime uses Date.now() - navigationStart when available');
|
||||
|
||||
window.performance.now = () => 4;
|
||||
assert.equal(Flash.prototype.getVideoPlaybackQuality.call(mockFlash).creationTime,
|
||||
4,
|
||||
'creationTime prioritizes performance.now when available');
|
||||
|
||||
window.Date = origDate;
|
||||
window.performance = origPerformance;
|
||||
});
|
||||
|
||||
@@ -50,19 +50,6 @@ QUnit.module('HTML5', {
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test('should be able to set playsinline attribute', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
tech.createEl();
|
||||
tech.setPlaysinline(true);
|
||||
|
||||
assert.ok(tech.el().hasAttribute('playsinline'), 'playsinline attribute was added');
|
||||
|
||||
tech.setPlaysinline(false);
|
||||
|
||||
assert.ok(!tech.el().hasAttribute('playsinline'), 'playsinline attribute was removed');
|
||||
});
|
||||
|
||||
QUnit.test('should detect whether the volume can be changed', function(assert) {
|
||||
|
||||
if (!{}.__defineSetter__) {
|
||||
@@ -97,32 +84,6 @@ QUnit.test('test playbackRate', function(assert) {
|
||||
assert.strictEqual(tech.playbackRate(), 0.75);
|
||||
});
|
||||
|
||||
QUnit.test('blacklist playbackRate support on older verisons of Chrome on Android', function(assert) {
|
||||
if (!Html5.canControlPlaybackRate()) {
|
||||
assert.ok(true, 'playbackRate is not supported');
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset playbackrate - Firefox's rounding of playbackRate causes the rate not to change in canControlPlaybackRate() after a few instances
|
||||
Html5.TEST_VID.playbackRate = 1;
|
||||
|
||||
const oldIsAndroid = browser.IS_ANDROID;
|
||||
const oldIsChrome = browser.IS_CHROME;
|
||||
const oldChromeVersion = browser.CHROME_VERSION;
|
||||
|
||||
browser.IS_ANDROID = true;
|
||||
browser.IS_CHROME = true;
|
||||
browser.CHROME_VERSION = 50;
|
||||
assert.strictEqual(Html5.canControlPlaybackRate(), false, 'canControlPlaybackRate should return false on older Chrome');
|
||||
|
||||
browser.CHROME_VERSION = 58;
|
||||
assert.strictEqual(Html5.canControlPlaybackRate(), true, 'canControlPlaybackRate should return true on newer Chrome');
|
||||
|
||||
browser.IS_ANDROID = oldIsAndroid;
|
||||
browser.IS_CHROME = oldIsChrome;
|
||||
browser.CHROME_VERSION = oldChromeVersion;
|
||||
});
|
||||
|
||||
QUnit.test('should export played', function(assert) {
|
||||
tech.createEl();
|
||||
assert.deepEqual(tech.played(), tech.el().played, 'returns the played attribute');
|
||||
@@ -680,83 +641,3 @@ test('When Android Chrome reports Infinity duration with currentTime 0, return N
|
||||
browser.IS_CHROME = oldIsChrome;
|
||||
tech.el_ = oldEl;
|
||||
});
|
||||
|
||||
QUnit.test('supports getting available media playback quality metrics', function(assert) {
|
||||
const origPerformance = window.performance;
|
||||
const origDate = window.Date;
|
||||
const oldEl = tech.el_;
|
||||
const videoPlaybackQuality = {
|
||||
creationTime: 1,
|
||||
corruptedVideoFrames: 2,
|
||||
droppedVideoFrames: 3,
|
||||
totalVideoFrames: 5
|
||||
};
|
||||
|
||||
tech.el_ = {
|
||||
getVideoPlaybackQuality: () => videoPlaybackQuality
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
videoPlaybackQuality,
|
||||
'uses native implementation when supported');
|
||||
|
||||
tech.el_ = {
|
||||
webkitDroppedFrameCount: 1,
|
||||
webkitDecodedFrameCount: 2
|
||||
};
|
||||
window.performance = {
|
||||
now: () => 4
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
{ droppedVideoFrames: 1, totalVideoFrames: 2, creationTime: 4 },
|
||||
'uses webkit prefixed metrics and performance.now when supported');
|
||||
|
||||
tech.el_ = {
|
||||
webkitDroppedFrameCount: 1,
|
||||
webkitDecodedFrameCount: 2
|
||||
};
|
||||
window.Date = {
|
||||
now: () => 10
|
||||
};
|
||||
window.performance = {
|
||||
timing: {
|
||||
navigationStart: 3
|
||||
}
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
{ droppedVideoFrames: 1, totalVideoFrames: 2, creationTime: 7 },
|
||||
'uses webkit prefixed metrics and Date.now() - navigationStart when ' +
|
||||
'supported');
|
||||
|
||||
tech.el_ = {};
|
||||
window.performance = void 0;
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(), {}, 'empty object when not supported');
|
||||
|
||||
window.performance = {
|
||||
now: () => 5
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
{ creationTime: 5 },
|
||||
'only creation time when it\'s the only piece available');
|
||||
|
||||
window.performance = {
|
||||
timing: {
|
||||
navigationStart: 3
|
||||
}
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
{ creationTime: 7 },
|
||||
'only creation time when it\'s the only piece available');
|
||||
|
||||
tech.el_ = {
|
||||
getVideoPlaybackQuality: () => videoPlaybackQuality,
|
||||
webkitDroppedFrameCount: 1,
|
||||
webkitDecodedFrameCount: 2
|
||||
};
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(),
|
||||
videoPlaybackQuality,
|
||||
'prefers native implementation when supported');
|
||||
|
||||
tech.el_ = oldEl;
|
||||
window.performance = origPerformance;
|
||||
window.Date = origDate;
|
||||
});
|
||||
|
||||
@@ -9,10 +9,7 @@ class TechFaker extends Tech {
|
||||
|
||||
constructor(options, handleReady) {
|
||||
super(options, handleReady);
|
||||
|
||||
if (!options || options.autoReady !== false) {
|
||||
this.triggerReady();
|
||||
}
|
||||
this.triggerReady();
|
||||
}
|
||||
|
||||
createEl() {
|
||||
|
||||
@@ -631,9 +631,3 @@ QUnit.test('setSource after previous setSource should dispose source handler onc
|
||||
|
||||
});
|
||||
|
||||
QUnit.test('returns an empty object for getVideoPlaybackQuality', function(assert) {
|
||||
const tech = new Tech();
|
||||
|
||||
assert.deepEqual(tech.getVideoPlaybackQuality(), {}, 'returns an empty object');
|
||||
});
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
/* eslint-env qunit */
|
||||
import HTMLTrackElement from '../../../src/js/tracks/html-track-element.js';
|
||||
import TechFaker from '../tech/tech-faker';
|
||||
|
||||
QUnit.module('HTML Track Element', {
|
||||
beforeEach() {
|
||||
this.tech = new TechFaker();
|
||||
},
|
||||
afterEach() {
|
||||
this.tech.dispose();
|
||||
this.tech = null;
|
||||
}
|
||||
});
|
||||
const defaultTech = {
|
||||
textTracks() {},
|
||||
on() {},
|
||||
off() {},
|
||||
currentTime() {}
|
||||
};
|
||||
|
||||
QUnit.module('HTML Track Element');
|
||||
|
||||
QUnit.test('html track element requires a tech', function(assert) {
|
||||
assert.throws(
|
||||
@@ -33,7 +31,7 @@ QUnit.test('can create a html track element with various properties', function(a
|
||||
label,
|
||||
language,
|
||||
src,
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
assert.equal(typeof htmlTrackElement.default, 'undefined', 'we have a default');
|
||||
@@ -47,7 +45,7 @@ QUnit.test('can create a html track element with various properties', function(a
|
||||
|
||||
QUnit.test('defaults when items not provided', function(assert) {
|
||||
const htmlTrackElement = new HTMLTrackElement({
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
assert.equal(typeof htmlTrackElement.default, 'undefined', 'we have a default');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import TextTrackList from '../../../src/js/tracks/text-track-list.js';
|
||||
import TextTrack from '../../../src/js/tracks/text-track.js';
|
||||
import EventTarget from '../../../src/js/event-target.js';
|
||||
import TechFaker from '../tech/tech-faker.js';
|
||||
|
||||
QUnit.module('Text Track List');
|
||||
QUnit.test('trigger "change" event when "modechange" is fired on a track', function(assert) {
|
||||
@@ -24,7 +23,11 @@ QUnit.test('trigger "change" event when "modechange" is fired on a track', funct
|
||||
});
|
||||
|
||||
QUnit.test('trigger "change" event when mode changes on a TextTrack', function(assert) {
|
||||
const tt = new TextTrack({tech: new TechFaker()});
|
||||
const tt = new TextTrack({
|
||||
tech: {
|
||||
on() {}
|
||||
}
|
||||
});
|
||||
const ttl = new TextTrackList([tt]);
|
||||
let changes = 0;
|
||||
const changeHandler = function() {
|
||||
|
||||
@@ -9,16 +9,14 @@ import proxyquireify from 'proxyquireify';
|
||||
import sinon from 'sinon';
|
||||
|
||||
const proxyquire = proxyquireify(require);
|
||||
const defaultTech = {
|
||||
textTracks() {},
|
||||
on() {},
|
||||
off() {},
|
||||
currentTime() {}
|
||||
};
|
||||
|
||||
QUnit.module('Text Track', {
|
||||
beforeEach() {
|
||||
this.tech = new TechFaker();
|
||||
},
|
||||
afterEach() {
|
||||
this.tech.dispose();
|
||||
this.tech = null;
|
||||
}
|
||||
});
|
||||
QUnit.module('Text Track');
|
||||
|
||||
// do baseline track testing
|
||||
TrackBaseline(TextTrack, {
|
||||
@@ -27,7 +25,7 @@ TrackBaseline(TextTrack, {
|
||||
mode: 'disabled',
|
||||
label: 'English',
|
||||
language: 'en',
|
||||
tech: new TechFaker()
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
QUnit.test('requires a tech', function(assert) {
|
||||
@@ -41,7 +39,7 @@ QUnit.test('can create a TextTrack with a mode property', function(assert) {
|
||||
const mode = 'disabled';
|
||||
const tt = new TextTrack({
|
||||
mode,
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
assert.equal(tt.mode, mode, 'we have a mode');
|
||||
@@ -49,7 +47,7 @@ QUnit.test('can create a TextTrack with a mode property', function(assert) {
|
||||
|
||||
QUnit.test('defaults when items not provided', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
tech: TechFaker
|
||||
});
|
||||
|
||||
assert.equal(tt.kind, 'subtitles', 'kind defaulted to subtitles');
|
||||
@@ -60,7 +58,7 @@ QUnit.test('defaults when items not provided', function(assert) {
|
||||
|
||||
QUnit.test('kind can only be one of several options, defaults to subtitles', function(assert) {
|
||||
let tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'foo'
|
||||
});
|
||||
|
||||
@@ -68,35 +66,35 @@ QUnit.test('kind can only be one of several options, defaults to subtitles', fun
|
||||
assert.notEqual(tt.kind, 'foo', 'the kind is set to subtitles, not foo');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'subtitles'
|
||||
});
|
||||
|
||||
assert.equal(tt.kind, 'subtitles', 'the kind is set to subtitles');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'captions'
|
||||
});
|
||||
|
||||
assert.equal(tt.kind, 'captions', 'the kind is set to captions');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'descriptions'
|
||||
});
|
||||
|
||||
assert.equal(tt.kind, 'descriptions', 'the kind is set to descriptions');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'chapters'
|
||||
});
|
||||
|
||||
assert.equal(tt.kind, 'chapters', 'the kind is set to chapters');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
kind: 'metadata'
|
||||
});
|
||||
|
||||
@@ -105,7 +103,7 @@ QUnit.test('kind can only be one of several options, defaults to subtitles', fun
|
||||
|
||||
QUnit.test('mode can only be one of several options, defaults to disabled', function(assert) {
|
||||
let tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
mode: 'foo'
|
||||
});
|
||||
|
||||
@@ -113,21 +111,21 @@ QUnit.test('mode can only be one of several options, defaults to disabled', func
|
||||
assert.notEqual(tt.mode, 'foo', 'the mode is set to disabld, not foo');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
mode: 'disabled'
|
||||
});
|
||||
|
||||
assert.equal(tt.mode, 'disabled', 'the mode is set to disabled');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
mode: 'hidden'
|
||||
});
|
||||
|
||||
assert.equal(tt.mode, 'hidden', 'the mode is set to hidden');
|
||||
|
||||
tt = new TextTrack({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
mode: 'showing'
|
||||
});
|
||||
|
||||
@@ -138,7 +136,7 @@ QUnit.test('cue and activeCues are read only', function(assert) {
|
||||
const mode = 'disabled';
|
||||
const tt = new TextTrack({
|
||||
mode,
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
tt.cues = 'foo';
|
||||
@@ -150,7 +148,7 @@ QUnit.test('cue and activeCues are read only', function(assert) {
|
||||
|
||||
QUnit.test('mode can only be set to a few options', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
tt.mode = 'foo';
|
||||
@@ -175,7 +173,7 @@ QUnit.test('mode can only be set to a few options', function(assert) {
|
||||
|
||||
QUnit.test('cues and activeCues return a TextTrackCueList', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
|
||||
assert.ok(tt.cues.getCueById, 'cues are a TextTrackCueList');
|
||||
@@ -184,7 +182,7 @@ QUnit.test('cues and activeCues return a TextTrackCueList', function(assert) {
|
||||
|
||||
QUnit.test('cues can be added and removed from a TextTrack', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
tech: defaultTech
|
||||
});
|
||||
const cues = tt.cues;
|
||||
|
||||
@@ -205,46 +203,6 @@ QUnit.test('cues can be added and removed from a TextTrack', function(assert) {
|
||||
assert.equal(cues.length, 3, 'we now have 3 cues');
|
||||
});
|
||||
|
||||
QUnit.test('original cue can be used to remove cue from cues list', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
});
|
||||
const Cue = window.VTTCue ||
|
||||
window.vttjs && window.vttjs.VTTCue ||
|
||||
window.TextTrackCue;
|
||||
|
||||
const cue1 = new Cue(0, 1, 'some-cue');
|
||||
|
||||
assert.equal(tt.cues.length, 0, 'start with zero cues');
|
||||
tt.addCue(cue1);
|
||||
assert.equal(tt.cues.length, 1, 'we have one cue');
|
||||
|
||||
tt.removeCue(cue1);
|
||||
assert.equal(tt.cues.length, 0, 'we have removed cue1');
|
||||
});
|
||||
|
||||
QUnit.test('can only remove one cue at a time', function(assert) {
|
||||
const tt = new TextTrack({
|
||||
tech: this.tech
|
||||
});
|
||||
const Cue = window.VTTCue ||
|
||||
window.vttjs && window.vttjs.VTTCue ||
|
||||
window.TextTrackCue;
|
||||
|
||||
const cue1 = new Cue(0, 1, 'some-cue');
|
||||
|
||||
assert.equal(tt.cues.length, 0, 'start with zero cues');
|
||||
tt.addCue(cue1);
|
||||
tt.addCue(cue1);
|
||||
assert.equal(tt.cues.length, 2, 'we have two cues');
|
||||
|
||||
tt.removeCue(cue1);
|
||||
assert.equal(tt.cues.length, 1, 'we have removed one instance of cue1');
|
||||
|
||||
tt.removeCue(cue1);
|
||||
assert.equal(tt.cues.length, 0, 'we have removed the other instance of cue1');
|
||||
});
|
||||
|
||||
QUnit.test('fires cuechange when cues become active and inactive', function(assert) {
|
||||
const player = TestHelpers.makePlayer();
|
||||
let changes = 0;
|
||||
@@ -284,49 +242,6 @@ QUnit.test('fires cuechange when cues become active and inactive', function(asse
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('does not fire cuechange before Tech is ready', function(assert) {
|
||||
const done = assert.async();
|
||||
const player = TestHelpers.makePlayer({techfaker: {autoReady: false}});
|
||||
let changes = 0;
|
||||
const tt = new TextTrack({
|
||||
tech: player.tech_,
|
||||
mode: 'showing'
|
||||
});
|
||||
const cuechangeHandler = function() {
|
||||
changes++;
|
||||
};
|
||||
|
||||
tt.addCue({
|
||||
id: '1',
|
||||
startTime: 0,
|
||||
endTime: 5
|
||||
});
|
||||
|
||||
tt.oncuechange = cuechangeHandler;
|
||||
tt.addEventListener('cuechange', cuechangeHandler);
|
||||
|
||||
player.tech_.currentTime = function() {
|
||||
return 0;
|
||||
};
|
||||
|
||||
player.tech_.trigger('timeupdate');
|
||||
assert.equal(changes, 0, 'a cuechange event is not triggered');
|
||||
|
||||
player.tech_.on('ready', function() {
|
||||
player.tech_.currentTime = function() {
|
||||
return 0.2;
|
||||
};
|
||||
|
||||
player.tech_.trigger('timeupdate');
|
||||
|
||||
assert.equal(changes, 2, 'a cuechange event trigger addEventListener and oncuechange');
|
||||
|
||||
player.dispose();
|
||||
done();
|
||||
});
|
||||
player.tech_.triggerReady();
|
||||
});
|
||||
|
||||
QUnit.test('tracks are parsed if vttjs is loaded', function(assert) {
|
||||
const clock = sinon.useFakeTimers();
|
||||
const oldVTT = window.WebVTT;
|
||||
@@ -355,7 +270,7 @@ QUnit.test('tracks are parsed if vttjs is loaded', function(assert) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
const tt = new TextTrack_({
|
||||
tech: this.tech,
|
||||
tech: defaultTech,
|
||||
src: 'http://example.com'
|
||||
});
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import mergeOptions from '../../../src/js/utils/merge-options.js';
|
||||
|
||||
QUnit.module('merge-options');
|
||||
|
||||
QUnit.test('should merge options objects', function(assert) {
|
||||
const ob1 = {
|
||||
a: true,
|
||||
@@ -28,9 +27,3 @@ QUnit.test('should merge options objects', function(assert) {
|
||||
d: true
|
||||
}, 'options objects merged correctly');
|
||||
});
|
||||
|
||||
QUnit.test('should ignore non-objects', function(assert) {
|
||||
const obj = { a: 1 };
|
||||
|
||||
assert.deepEqual(mergeOptions(obj, true), obj, 'ignored non-object input');
|
||||
});
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário