SUMMARY The mediaSession API shim that's injected currently does not detect the metadata by youtube and youtube music. STEPS TO REPRODUCE 1. Enable mediasession capability by going to chrome://flags (On chrome 73) 2. Enable enhanced media controls from extension menu 3. Go to youtube 4. No metadata or enhanced functionilty OBSERVED RESULT No metadata on youtube and youtube music EXPECTED RESULT Metadata and correct functionality (play pause next prev) on yt and yt music ADDITIONAL INFORMATION FIX: Changing https://github.com/KDE/plasma-browser-integration/blob/eb583434a5611e5a3bb8046e6627469753115b3c/extension/content-script.js#L594 to ${mediaSessionsClassName}.metadata = null; will fix this problem. Apparently yt and yt music is checking if metadata is null (?) before applying it's on metadata.
Oh, wow! Thank you very much! I was already wondering why YouTube did not support this but never realized they did but checked for this. Indeed changing it to null fixes it.
Indeed, I put a breakpoint in the property getter and they do check: ... navigator.mediaSession&&!navigator.mediaSession.metadata&&navigator.mediaSession.setActionHandler&& ...
Git commit f4722bd0a6ec63b9e2c05d91d89d1ea58c5581ce by Kai Uwe Broulik. Committed on 23/04/2019 at 07:34. Pushed by broulik into branch 'master'. Initialize metadata with null This matches Media Session API spec "A MediaSession has an associated metadata object represented by a MediaMetadata. It is initially null." M +1 -1 extension/content-script.js https://commits.kde.org/plasma-browser-integration/f4722bd0a6ec63b9e2c05d91d89d1ea58c5581ce