Skip to content

Commit

Permalink
fix: chapters in Safari
Browse files Browse the repository at this point in the history
* fix: control-bar styles in Safari

* fix: chapters from object in Safari
  • Loading branch information
tsi authored Feb 12, 2024
1 parent 0d319c8 commit 54b2cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ $icon-font-path: '../icon-font' !default;
}

.vjs-control-bar {
z-index: 2;
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
z-index: 2;
font-size: 120%;
// responsive controls sizes, based on container width
// font-size: clamp(100%, 2cqw, 150%);
Expand All @@ -256,6 +257,7 @@ $icon-font-path: '../icon-font' !default;
}

.vjs-progress-control {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
position: absolute;
left: 0px;
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/chapters/chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ChaptersPlugin = (function () {
/**
* Bootstrap the plugin.
*/
ChaptersPlugin.prototype.initializeChapters = function initializeChapters() {
ChaptersPlugin.prototype.initializeChapters = async function initializeChapters() {
const chaptersUrl = this.options === true ? this.getChaptersFileUrlByName() : this.options.url;

if (chaptersUrl) {
Expand All @@ -100,6 +100,10 @@ const ChaptersPlugin = (function () {
default: true
});

// required for Safari to display the captions
// https://github.com/videojs/video.js/issues/8519
await new Promise(resolve => setTimeout(resolve, 100));

const end = this.player.duration();
Object.entries(this.options).forEach((entry, index, arr) => {
const cue = new VTTCue(
Expand Down

0 comments on commit 54b2cd2

Please sign in to comment.