Skip to content

Commit fef3b63

Browse files
authoredApr 7, 2025
fix: custom Video/Audio switcher in Plugins menu (#3174)
Related to #3167 Update `setVideoState` function and `switchButtonDiv` event listener to handle transition back to audio mode. * **Update `setVideoState` function** - Correctly handle the transition back to audio mode. - Update the `hideVideo` property in the plugin configuration. - Use `this.config` instead of `config` to set options and update checkbox state. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/th-ch/youtube-music/issues/3167?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 0d3311f commit fef3b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/plugins/video-toggle/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ export default createPlugin({
179179
if (this.config) {
180180
this.config.hideVideo = !showVideo;
181181
}
182-
window.mainConfig.plugins.setOptions('video-toggle', config);
182+
window.mainConfig.plugins.setOptions('video-toggle', this.config);
183183

184184
const checkbox = document.querySelector<HTMLInputElement>(
185185
'.video-switch-button-checkbox',
186186
); // custom mode
187-
if (checkbox) checkbox.checked = !config.hideVideo;
187+
if (checkbox) checkbox.checked = !this.config.hideVideo;
188188

189189
if (player) {
190190
player.style.margin = showVideo ? '' : 'auto 0px';

0 commit comments

Comments
 (0)