Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Audio button #3223

wants to merge 1 commit into from

Conversation

forbesjo
Copy link
Contributor

@forbesjo forbesjo commented Mar 29, 2016

This PR adds an audio button for audio track selection. It depends on videojs/font#13 and #3137

import * as Fn from '../../utils/fn.js';
import AudioTrackMenuItem from './audio-track-menu-item.js';

class AudioTrackButton extends MenuButton {
Copy link
Member

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.

Copy link
Contributor Author

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.

@forbesjo forbesjo force-pushed the audio-button branch 3 times, most recently from c7f6d6e to 6f80d79 Compare April 20, 2016 18:19
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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used anywhere?

Copy link
Member

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.

@gkatsev gkatsev added minor This PR can be added to a minor release. It should not be added to a patch release. needs: updates needs: LGTM Needs one or more additional approvals and removed needs: updates labels Apr 29, 2016
items.push(new AudioTrackMenuItem(this.player_, {
// MenuItem is selectable
'selectable': true,
'track': track
Copy link
Member

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
}

Copy link
Member

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.

@misteroneill
Copy link
Member

LGTM

@dmlap dmlap closed this in 4156307 May 2, 2016
@gkatsev gkatsev removed the needs: LGTM Needs one or more additional approvals label Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor This PR can be added to a minor release. It should not be added to a patch release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants