-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Audio button #3223
Audio button #3223
Conversation
import * as Fn from '../../utils/fn.js'; | ||
import AudioTrackMenuItem from './audio-track-menu-item.js'; | ||
|
||
class AudioTrackButton extends MenuButton { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about having this button extend TrackButton
and refactor TextTrackButton
into a TrackButton
? it already does the removetrack
addtracker
listening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea.
c7f6d6e
to
6f80d79
Compare
Added audio icon Extract TrackButton from Audio and TextTrack buttons Add document comments
*/ | ||
class AudioTrackButton extends TrackButton { | ||
constructor(player, options = {}) { | ||
options.tracks = player.audioTracks && player.audioTracks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is, in the TrackButton, missed it.
items.push(new AudioTrackMenuItem(this.player_, { | ||
// MenuItem is selectable | ||
'selectable': true, | ||
'track': track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object literal could be simplified to:
{
track,
selectable: true
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To elaborate, I feel like we should start writing code that will pass the video.js linter even if the project at large won't pass it.
LGTM |
This PR adds an audio button for audio track selection. It depends on
videojs/font#13and#3137