You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MediaSession not supported by TypeScript 2.3.4 #19473
I would be glad to help in the future. Currently I do not have the enough knowledge to contribute.
However I have given a workaround to help other people facing the same issue.
Hi Pablo González (@pablo-gonzalez), I am getting exactly same error while trying to use MediaSession in Typescript. I tried installing @types/wicg-mediasession as well but couldn't resolve the issue.
Here's the response from the developer when I tried to use this library in my Angular project: w3c/mediasession#206 (comment)
redstonewizard Thanks for your recommendation. My code was already instantiating the Object with new but I was missing the tsconfig.json entries. However its working now even without those changes in the typescript config, no more errors just like that. As far as I know we did not change the typescript version since then (using ~4.6.4), same one that was producing the error before, if I'm not mistaken.
Activity
[-]MediaSession not supported by TypeScript using Ionic 2[/-][+]MediaSession not supported by TypeScript 2.3.4[/+]mhegazy commentedon Oct 25, 2017
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.
pablo-gonzalez commentedon Oct 26, 2017
I would be glad to help in the future. Currently I do not have the enough knowledge to contribute.
However I have given a workaround to help other people facing the same issue.
Best regards,
Pablo
aareeph commentedon Dec 5, 2018
Hi Pablo González (@pablo-gonzalez), I am getting exactly same error while trying to use MediaSession in Typescript. I tried installing @types/wicg-mediasession as well but couldn't resolve the issue.
Here's the response from the developer when I tried to use this library in my Angular project:
w3c/mediasession#206 (comment)
Thanks!
joaovct commentedon Oct 25, 2020
(Exactly) 3 years after this issue, the only "solution" is using // ts-ignore?
jsmith commentedon Nov 8, 2020
The "solution" is not
// @ts-ignorebut installing @types/wicg-mediasession as stated by Pablo González (@pablo-gonzalez)I'm using it now and it's working fantastic!
MetaMmodern commentedon Jan 1, 2021
+1, this is working, the issue may be closed imo. Also add this to some docs so it is google'd better)
Jacob (@jsmith) thank you anf Happy New Year)
sanderschnydrig commentedon Jun 28, 2022
I installed @types/wicg-mediasession but its not doing anything to solve the error for me.
Edit: using // ts-ignore which is working
RedstoneWizard08 commentedon Oct 10, 2022
Try using:
instead of:
because I was also having trouble after installing this library and switching to that fixed it for me.
EDIT: Also make sure to add
wicg-mediasessionto thecompilerOptions.typesarray in yourtsconfig.json.sanderschnydrig commentedon Oct 10, 2022
redstonewizard Thanks for your recommendation. My code was already instantiating the Object with new but I was missing the tsconfig.json entries. However its working now even without those changes in the typescript config, no more errors just like that. As far as I know we did not change the typescript version since then (using ~4.6.4), same one that was producing the error before, if I'm not mistaken.
RedstoneWizard08 commentedon Oct 10, 2022
Okay.
jakebailey commentedon Jul 9, 2023
Just looking at old issues; this was fixed in #44684.