mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-27 16:48:55 +00:00
* Prefer `c ? x : y` over `c && x || y` * Avoid unnecessary asssignment expressions * Prefer switch statements over object lookup tables * Add an .editorconfig * Fix style issues * Fix mentioned issues Co-authored-by: bob <bob.varioa@gmail.com>
25 lines
648 B
JavaScript
25 lines
648 B
JavaScript
'use strict';
|
|
|
|
const NavigationEndpoint = require('./NavigationEndpoint');
|
|
|
|
class MusicPlayButton {
|
|
type = 'MusicPlayButton';
|
|
|
|
constructor(data) {
|
|
this.endpoint = new NavigationEndpoint(data.playNavigationEndpoint);
|
|
this.play_icon_type = data.playIcon.iconType;
|
|
this.pause_icon_type = data.pauseIcon.iconType;
|
|
|
|
if (data.accessibilityPlayData) {
|
|
this.play_label = data.accessibilityPlayData.accessibilityData.label
|
|
}
|
|
|
|
if (data.accessibilityPlayData) {
|
|
this.pause_label = data.accessibilityPauseData?.accessibilityData.label
|
|
}
|
|
|
|
this.icon_color = data.iconColor;
|
|
}
|
|
}
|
|
|
|
module.exports = MusicPlayButton; |