Use the current embed player via TIDALs OEmbed API. #191

Merged
enjikaka merged 3 commits from tidal-embed-fix into main 2023-02-03 15:36:58 +00:00
enjikaka commented 2023-02-02 13:16:38 +00:00 (Migrated from github.com)

The code was using the old unmaintained embed player. This updates the code to use the newest one via our OEmbed API: https://oembed.tidal.com/?url=https://tidal.com/browse/track/145596276

The OEmbed API delivers the embed with sizes for different embed types. dangerouslySetInnerHTML is a bit sad, if wanted I can refactor to instead read out sizes from the delivered iframe and set those on a new

The code was using the old unmaintained embed player. This updates the code to use the newest one via our OEmbed API: https://oembed.tidal.com/?url=https://tidal.com/browse/track/145596276 The OEmbed API delivers the embed with sizes for different embed types. `dangerouslySetInnerHTML` is a bit sad, if wanted I can refactor to instead read out sizes from the delivered iframe and set those on a new <iframe> in the component. https://user-images.githubusercontent.com/877455/216334497-f429daa3-4cf2-4dcd-8114-a0cabfa0fec3.mov
v0l commented 2023-02-03 10:15:14 +00:00 (Migrated from github.com)

Yea not a fan of injecting random HTML onto the page, why does this not work as an iframe?

Yea not a fan of injecting random HTML onto the page, why does this not work as an iframe?
v0l commented 2023-02-03 13:33:29 +00:00 (Migrated from github.com)

I mean why do the sizes need to be set on the iframes, can we not just set the width of the frame and the height is dynamic, that is what we do for spotify/youtube/soundcloud etc and it works fine

I mean why do the sizes need to be set on the iframes, can we not just set the width of the frame and the height is dynamic, that is what we do for spotify/youtube/soundcloud etc and it works fine
enjikaka commented 2023-02-03 13:56:16 +00:00 (Migrated from github.com)

Embeds from different services does not support a limitless amount of sizes. Their respective OEmbed API will report a supported recommended size. Dynamic heights aren't possible since the contents from an iframe can not affect the height of the iframe.

You can check the OEmbed spec here; all music-player embeds use the rich type -> https://oembed.com/#section2:~:text=2.3.4.4.-,The%20rich%20type,-This%20type%20is

Embeds from different services does not support a limitless amount of sizes. Their respective OEmbed API will report a supported recommended size. Dynamic heights aren't possible since the contents from an iframe can not affect the height of the iframe. You can check the OEmbed spec here; all music-player embeds use the rich type -> https://oembed.com/#section2:~:text=2.3.4.4.-,The%20rich%20type,-This%20type%20is
enjikaka commented 2023-02-03 14:12:12 +00:00 (Migrated from github.com)

Updated now to use the source and height on a constructed iframe instead. (width 100 %)

Updated now to use the source and height on a constructed iframe instead. (width 100 %)
v0l (Migrated from github.com) approved these changes 2023-02-03 14:44:36 +00:00
v0l (Migrated from github.com) left a comment

Really nice, thanks!

Really nice, thanks!
Sign in to join this conversation.
No description provided.