Added MediaSession support (notification controls on mobile)#187
Added MediaSession support (notification controls on mobile)#187R0nd wants to merge 5 commits intohyperblast:masterfrom
Conversation
|
One ugly hack I had to add is an |
| import PlayerModel from "./player_model"; | ||
| import silenceMp3 from "./5-seconds-of-silence.mp3"; | ||
|
|
||
| export default class MediaSessionController { |
There was a problem hiding this comment.
Formatting does not match other files
There was a problem hiding this comment.
Changed to single quotes and tab width 4
| ); | ||
|
|
||
| this.dataSource.on("player", (player) => this.updateMetadata(player)); | ||
| this.dataSource.watch("player", { |
There was a problem hiding this comment.
Only one type can watch on data source, this logic should be in PlayerModel instead.
There was a problem hiding this comment.
Moved to PlayerModel, but it should probably be refactored later because the activeItem's columns are becoming messy
js/webui/webpack.config.js
Outdated
| } | ||
| }); | ||
|
|
||
| config.optimization = { |
There was a problem hiding this comment.
This looks unrelated to this PR, besides that I'm not sure if there is a benefit of having vendors chunk.
There was a problem hiding this comment.
It's out of scope of this PR, but the added code pushed the bundle over 300KB, breaking the build
There was a problem hiding this comment.
The limit is raised in other PR, probably you can do the same.
There was a problem hiding this comment.
Removed code splitting and raised bundle limit
|
@R0nd, |
This has possible unintended effect effect of draining mobile battery for playing silence. |
I've added a setting to enable this feature. I've made it disabled by default, since there's no data on performance impact yet and browser support isn't 100% there. |
|
@R0nd sorry for delay, I'm on vacation at the moment, would merge it when I'm back, have a nice day! |
Probably it would be better to avoid Brace formatting still does not match other source files: |
Implemented MediaSession support (show playing track and expose playback controls in a notification on mobile). Works great in Chrome, somewhat buggy in Firefox Nightly for now (no prev/next buttons, incorrect playback state).
