Skip to content

Commit 57901d6

Browse files
committed
small fixes
1 parent b1d74e2 commit 57901d6

File tree

1 file changed

+2
-57
lines changed

1 file changed

+2
-57
lines changed

src/app/vendor/videojsplugins.js

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// VideoJS Plugins
22

33
var Button = videojs.getComponent('Button');
4-
var MenuButton = videojs.getComponent('MenuButton');
54
var SubtitlesButton = videojs.getComponent('SubtitlesButton');
65
var MenuItem = videojs.getComponent('MenuItem');
76

@@ -180,7 +179,7 @@ class CustomTrackMenuItem extends MenuItem {
180179
let vtt = this.srt2webvtt(text);
181180
return new File(
182181
[vtt],
183-
'/temp.vtt',
182+
'loaded.vtt',
184183
{type: 'text/vtt'}
185184
);
186185
}
@@ -198,7 +197,7 @@ class CustomTrackMenuItem extends MenuItem {
198197
const track = videojs('video_player').addRemoteTextTrack({
199198
kind: 'subtitles',
200199
language: '00',
201-
label: 'original',
200+
label: i18n.__('Custom...'),
202201
mode: 'showing',
203202
src: URL.createObjectURL(file)
204203
}, false);
@@ -220,57 +219,3 @@ class CustomSubtitlesButton extends SubtitlesButton
220219
}
221220
}
222221
videojs.registerComponent('customSubtitlesButton', CustomSubtitlesButton);
223-
224-
/**
225-
* Button for subtitles menu
226-
*
227-
* @extends MenuButton
228-
* @class SubtitlesButton
229-
*/
230-
class CustomButton extends MenuButton {
231-
/**
232-
* Constructor for class
233-
*
234-
* @param {Player|Object} player The player
235-
* @param {Object=} options Button options
236-
* @param {string} options.direction back or forward
237-
* @param {Int} options.seconds number of seconds to seek
238-
*/
239-
constructor(player, options) {
240-
super(player, options);
241-
if (this.options_.direction === 'forward') {
242-
this.controlText(this.localize('Seek forward {{seconds}} seconds')
243-
.replace('{{seconds}}', this.options_.seconds));
244-
} else if (this.options_.direction === 'back') {
245-
this.controlText(this.localize('Seek back {{seconds}} seconds')
246-
.replace('{{seconds}}', this.options_.seconds));
247-
}
248-
}
249-
250-
/**
251-
* Return button class names which include the seek amount.
252-
*
253-
* @return {string} css cass string
254-
*/
255-
buildCSSClass() {
256-
return `vjs-subtitles-button ${super.buildCSSClass()}`;
257-
}
258-
259-
/**
260-
* Seek with the button's configured offset
261-
*/
262-
handleClick() {
263-
console.log('click!');
264-
265-
266-
// const now = this.player_.currentTime();
267-
//
268-
// if (this.options_.direction === 'forward') {
269-
// this.player_.currentTime(now + this.options_.seconds);
270-
// } else if (this.options_.direction === 'back') {
271-
// this.player_.currentTime(now - this.options_.seconds);
272-
// }
273-
}
274-
}
275-
276-
videojs.registerComponent('customButton', CustomButton);

0 commit comments

Comments
 (0)