Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
tsi committed Oct 5, 2023
1 parent 1894902 commit 5e3a58c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/plugins/chapters/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Todo: eslint
/* eslint-disable */
import videojs from 'video.js';

import './chapters.scss';
Expand Down Expand Up @@ -48,6 +46,7 @@ const chapters = function chapters(options) {
* Chapters
*/
const ChaptersPlugin = (function () {

/**
* Plugin class constructor, called by videojs on
* ready event.
Expand Down Expand Up @@ -85,7 +84,7 @@ const ChaptersPlugin = (function () {
*/
ChaptersPlugin.prototype.initializeChapters = function initializeChapters() {
if (this.options.url) {
var chaptersTrack = {
const chaptersTrack = {
kind: 'chapters',
src: this.options.url
};
Expand All @@ -99,10 +98,10 @@ const ChaptersPlugin = (function () {
} else {
const textTrack = this.player.addTextTrack('chapters');
const end = this.player.duration();
const cues = Object.entries(this.options).map((entry, index, obj) => {
Object.entries(this.options).forEach((entry, index, arr) => {
const cue = new VTTCue(
parseFloat(entry[0]),
parseFloat(obj[index + 1] ? obj[index + 1][0] : end),
parseFloat(arr[index + 1] ? arr[index + 1][0] : end),
entry[1]
);
textTrack.addCue(cue);
Expand Down Expand Up @@ -190,6 +189,6 @@ const ChaptersPlugin = (function () {
};

return ChaptersPlugin;
})();
}());

export default chapters;

0 comments on commit 5e3a58c

Please sign in to comment.