Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge v7.8.3 #1

Merged
merged 4 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
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/7.3.0/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/7.3.0/video.min.js"></script>
<link href="//vjs.zencdn.net/7.8.2/video-js.min.css" rel="stylesheet">
<script src="//vjs.zencdn.net/7.8.2/video.min.js"></script>
```

> For the latest version of video.js and URLs to use, check out the [Getting Started][getting-started] page on our website.
Expand All @@ -45,12 +45,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@6.11.0/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js@6.11.0/dist/video.min.js"></script>
<link href="https://unpkg.com/video.js@7.8.2/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js@7.8.2/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/6.7.3/video-js.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/6.7.3/video.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.8.1/video-js.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.8.1/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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"description": "An HTML5 video player that supports HLS and DASH with a common API and skin.",
"version": "7.8.1",
"main": "./dist/video.cjs.js",
"module": "./dist/video.es.js",
Expand All @@ -9,6 +9,7 @@
"license": "Apache-2.0",
"keywords": [
"flash",
"hls",
"html5",
"player",
"video",
Expand Down
3 changes: 2 additions & 1 deletion src/css/components/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ body.vjs-full-window {
bottom: 0;
right: 0;
}
.video-js.vjs-fullscreen {
.video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
width: 100% !important;
height: 100% !important;
// Undo any aspect ratio padding for fluid layouts
padding-top: 0 !important;
}

.video-js.vjs-fullscreen.vjs-user-inactive {
cursor: none;
}
Expand Down
9 changes: 7 additions & 2 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,13 @@ class Component {
// If inserting before a component, insert before that component's element
let refNode = null;

if (this.children_[index + 1] && this.children_[index + 1].el_) {
refNode = this.children_[index + 1].el_;
if (this.children_[index + 1]) {
// Most children are components, but the video tech is an HTML element
if (this.children_[index + 1].el_) {
refNode = this.children_[index + 1].el_;
} else if (Dom.isEl(this.children_[index + 1])) {
refNode = this.children_[index + 1];
}
}

this.contentEl().insertBefore(component.el(), refNode);
Expand Down
3 changes: 3 additions & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,9 @@ class Player extends Component {
*/
handleTechFullscreenChange_(event, data) {
if (data) {
if (data.nativeIOSFullscreen) {
this.toggleClass('vjs-ios-native-fs');
}
this.isFullscreen(data.isFullscreen);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ class Html5 extends Tech {
this.el_.webkitPresentationMode !== 'picture-in-picture') {
this.one('webkitendfullscreen', endFn);

this.trigger('fullscreenchange', { isFullscreen: true });
this.trigger('fullscreenchange', {
isFullscreen: true,
// set a flag in case another tech triggers fullscreenchange
nativeIOSFullscreen: true
});
}
};

Expand Down
20 changes: 20 additions & 0 deletions test/unit/component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,26 @@ QUnit.test('should insert element relative to the element of the component to in
/* eslint-enable no-unused-vars */
});

QUnit.test('should allow for children that are elements', function(assert) {

// for legibility of the test itself:
/* eslint-disable no-unused-vars */

const comp = new Component(getFakePlayer());
const testEl = Dom.createEl('div');

// Add element as video el gets added to player
comp.el().appendChild(testEl);
comp.children_.unshift(testEl);

const child1 = comp.addChild('component', {el: Dom.createEl('div', {}, {class: 'c1'})});
const child2 = comp.addChild('component', {el: Dom.createEl('div', {}, {class: 'c4'})}, 0);

assert.ok(child2.el_.nextSibling === testEl, 'addChild should insert el before a sibling that is an element');

/* eslint-enable no-unused-vars */
});

QUnit.test('addChild should throw if the child does not exist', function(assert) {
const comp = new Component(getFakePlayer());

Expand Down