今天在B站看番时,用键盘调节音量,看到了这一幕
于是很好奇这些声优列表是怎么显示的,去bing搜索了一下,发现知乎上有人提问过
但我用的是火狐,于是搜索关键字hardware media key handling firefox
搜索结果第一篇
点进去发现关键字
If media keys don't work to control your web browser, try closing any other media applications running on your system. This includes music players like iTunes and video players like VLC. The media keys can only control one media player at a time, and which playback application gets to control the keys is determined by your operating system.
If your media keys don't work on a particular website, it's likely that the website doesn't support them. Technically speaking, website developers must use the MediaSession API to enable this feature on their websites. This feature lets websites take advantage of Chrome's global media playback controls on its browser toolbar, too.
原来这东西叫Media Session API,去MDN搜索,看到了样例,在控制台测试一下
随便设个值看一下
嗯,大概就是这样。