Skip to content

Commit

Permalink
add mobile player and fullscreen support for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjm authored and blakeblackshear committed Jun 5, 2021
1 parent c73aeba commit 88ed750
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/package-lock.json

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

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"preact-async-route": "^2.2.1",
"preact-router": "^3.2.1",
"video.js": "^7.11.8",
"videojs-mobile-ui": "^0.5.3",
"videojs-playlist": "^4.3.1",
"videojs-seek-buttons": "^2.0.0"
},
Expand Down
6 changes: 6 additions & 0 deletions web/src/components/VideoPlayer.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { h, Component } from 'preact';
import videojs from 'video.js';
import 'videojs-mobile-ui';
import 'videojs-playlist';
import 'videojs-seek-buttons';
import 'video.js/dist/video-js.css';
Expand All @@ -25,6 +26,11 @@ export default class VideoPlayer extends Component {
forward: 30,
back: 10,
});
this.player.mobileUi({
fullscreen: {
iOS: true,
},
});
}

componentWillUnmount() {
Expand Down
4 changes: 4 additions & 0 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
transform: rotate(360deg);
}
}

.video-js.vjs-has-started .vjs-touch-overlay {
display: none;
}

0 comments on commit 88ed750

Please sign in to comment.