Skip to content

Commit

Permalink
Merge branch 'main' into feat/improved-mobile-scrubbing
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-barstow authored Nov 25, 2024
2 parents 19faaaf + 62f3844 commit 7eb8889
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 30 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="8.20.0"></a>
# [8.20.0](https://github.com/videojs/video.js/compare/v8.19.2...v8.20.0) (2024-11-19)

### Chores

* Correct changelog for 8.19.2 ([#8918](https://github.com/videojs/video.js/issues/8918)) ([964c40e](https://github.com/videojs/video.js/commit/964c40e))
* **package:** Update [@videojs](https://github.com/videojs)/http-streaming to 3.16.0 ([#8921](https://github.com/videojs/video.js/issues/8921)) ([7420467](https://github.com/videojs/video.js/commit/7420467)), closes [1000#0](https://github.com/1000/issues/0)

<a name="8.19.2"></a>
## [8.19.2](https://github.com/videojs/video.js/compare/v8.19.1...v8.19.2) (2024-11-14)

### Bug Fixes

* change http to https in examples ([#8905](https://github.com/videojs/video.js/issues/8905)) ([079cbe1](https://github.com/videojs/video.js/commit/079cbe1))
* Fix Escape handling in menus ([#8916](https://github.com/videojs/video.js/issues/8916)) ([d0cf139](https://github.com/videojs/video.js/commit/d0cf139))
* **text-track-settings:** localization not correctly applied ([#8904](https://github.com/videojs/video.js/issues/8904)) ([ecef37c](https://github.com/videojs/video.js/commit/ecef37c))

<a name="8.19.1"></a>
## [8.19.1](https://github.com/videojs/video.js/compare/v8.19.0...v8.19.1) (2024-10-10)

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Video.js was started in the middle of 2010 and is now used on over ~~50,000~~ ~~
Thanks to the awesome folks over at [Fastly][fastly], there's a free, CDN hosted version of Video.js that anyone can use. Add these tags to your document's `<head>`:

```html
<link href="//vjs.zencdn.net/8.19.1/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/8.19.1/video.min.js"></script>
<link href="//vjs.zencdn.net/8.20.0/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/8.20.0/video.min.js"></script>
```

Alternatively, you can include Video.js by getting it from [npm](https://videojs.com/getting-started/#install-via-npm), downloading it from [GitHub releases](https://github.com/videojs/video.js/releases) or by including it via [unpkg](https://unpkg.com) or another JavaScript CDN, like CDNjs.
Expand All @@ -34,12 +34,12 @@ Alternatively, you can include Video.js by getting it from [npm](https://videojs
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>

<!-- unpkg : use a specific version of Video.js (change the version numbers as necessary) -->
<link href="https://unpkg.com/video.js@8.19.1/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js@8.19.1/dist/video.min.js"></script>
<link href="https://unpkg.com/video.js@8.20.0/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js@8.20.0/dist/video.min.js"></script>

<!-- cdnjs : use a specific version of Video.js (change the version numbers as necessary) -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.19.1/video-js.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.19.1/video.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.20.0/video-js.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.20.0/video.min.js"></script>
```

Next, using Video.js is as simple as creating a `<video>` element, but with an additional `data-setup` attribute. At a minimum, this attribute must have a value of `'{}'`, but it can include any Video.js [options][options] - just make sure it contains valid JSON!
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/elephantsdream/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta charset="utf-8" />
<title>Video.js Text Descriptions, Chapters &amp; Captions Example</title>

<link href="http://vjs.zencdn.net/7.0/video-js.min.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/7.0/video.min.js"></script>
<link href="https://vjs.zencdn.net/7.0/video-js.min.css" rel="stylesheet">
<script src="https://vjs.zencdn.net/7.0/video.min.js"></script>

</head>
<body>
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/simple-embed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<body>

<video id="example_video_1" class="video-js" controls preload="none" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm">
<source src="http://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
<source src="https://vjs.zencdn.net/v/oceans.webm" type="video/webm">
<source src="https://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
<track kind="captions" src="../shared/example-captions.vtt" srclang="en" label="English">
<track kind="subtitles" src="../shared/example-captions.vtt" srclang="en" label="English">
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
Expand Down
31 changes: 21 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 video player that supports HLS and DASH with a common API and skin.",
"version": "8.19.1",
"version": "8.20.0",
"main": "./dist/video.cjs.js",
"module": "./dist/video.es.js",
"style": "./dist/video-js.css",
Expand Down Expand Up @@ -86,7 +86,7 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@videojs/http-streaming": "^3.15.0",
"@videojs/http-streaming": "^3.16.0",
"@videojs/vhs-utils": "^4.1.1",
"@videojs/xhr": "2.7.0",
"aes-decrypter": "^4.0.2",
Expand Down
6 changes: 3 additions & 3 deletions src/js/menu/menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class MenuButton extends Component {
handleKeyDown(event) {

// Escape or Tab unpress the 'button'
if (event.key === 'Esc' || event.key === 'Tab') {
if (event.key === 'Escape' || event.key === 'Tab') {
if (this.buttonPressed_) {
this.unpressButton();
}
Expand Down Expand Up @@ -328,7 +328,7 @@ class MenuButton extends Component {
*/
handleMenuKeyUp(event) {
// Escape hides popup menu
if (event.key === 'Esc' || event.key === 'Tab') {
if (event.key === 'Escape' || event.key === 'Tab') {
this.removeClass('vjs-hover');
}
}
Expand Down Expand Up @@ -356,7 +356,7 @@ class MenuButton extends Component {
*/
handleSubmenuKeyDown(event) {
// Escape or Tab unpress the 'button'
if (event.key === 'Esc' || event.key === 'Tab') {
if (event.key === 'Escape' || event.key === 'Tab') {
if (this.buttonPressed_) {
this.unpressButton();
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-fieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TextTrackFieldset extends Component {
const label = Dom.createEl('label', {
id,
className: 'vjs-label',
textContent: selectConfig.label
textContent: this.localize(selectConfig.label)
});

label.setAttribute('for', guid);
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TextTrackSelect extends Component {
{
id: optionId,
value: this.localize(optionText[0]),
textContent: optionText[1]
textContent: this.localize(optionText[1])
}
);

Expand Down
20 changes: 19 additions & 1 deletion test/unit/menu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ QUnit.test('should remove old event listeners when the menu item adds to the new

assert.ok(clickListenerSpy.calledOnce, 'click event listener should be called');
assert.strictEqual(clickListenerSpy.getCall(0).args[0].target, menuItem.el(), 'event target should be the `menuItem`');
assert.ok(unpressButtonSpy.calledOnce, '`menuButton`.`unpressButtion` has been called');
assert.ok(unpressButtonSpy.calledOnce, '`menuButton`.`unpressButton` has been called');
assert.ok(focusSpy.calledOnce, '`menuButton`.`focus` has been called');

unpressButtonSpy.restore();
Expand Down Expand Up @@ -265,3 +265,21 @@ QUnit.test('should remove old event listeners when the menu item adds to the new
oldMenu.dispose();
menuButton.dispose();
});

QUnit.test('Escape should close menu', function(assert) {
const player = TestHelpers.makePlayer();
const menuButton = new MenuButton(player, {});
const unpressButtonSpy = sinon.spy(menuButton, 'unpressButton');

menuButton.createItems = () => [new MenuItem(player, {})];
menuButton.update();
menuButton.handleClick(new window.PointerEvent('click'));
menuButton.menu.children()[0].el_.dispatchEvent(new window.KeyboardEvent('keydown', {
key: 'Escape',
bubbles: true,
cancelable: true
}));

assert.ok(unpressButtonSpy.calledOnce, '`menuButton`.`unpressButton` has been called');

});
8 changes: 7 additions & 1 deletion test/unit/tracks/text-track-settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,16 @@ QUnit.test('should update on languagechange', function(assert) {
tracks
});

videojs.addLanguage('test', {'Font Size': 'FONTSIZE'});
videojs.addLanguage('test', {
'Font Size': 'FONTSIZE',
'Color': 'COLOR',
'White': 'WHITE'
});
player.language('test');

assert.equal(player.$('.vjs-font-percent legend').textContent, 'FONTSIZE', 'settings dialog updates on languagechange');
assert.equal(player.$('.vjs-text-color label').textContent, 'COLOR', 'settings dialog label updates on languagechange');
assert.equal(player.$('.vjs-text-color select option').textContent, 'WHITE', 'settings dialog select updates on languagechange');

player.dispose();
});
Expand Down

0 comments on commit 7eb8889

Please sign in to comment.