andrewmcgivery / obsidian-soundscapes

A plugin for Obsidian.MD that adds a music/ambiance player to the status bar to play Lofi beats, nature sounds, ambiance, relaxing music, and more.
MIT License
46 stars 7 forks source link

Custom Soundscapes not playing #12

Open Beingpax opened 4 months ago

Beingpax commented 4 months ago

Love how fast the plugin is adding new features.

I'm trying to add a custom soundscape for youtube video. and its showing that the video is not available on youtube.

63200

error451 commented 4 months ago

I guess this is a reason: https://stackoverflow.com/a/59640711/19935682 >

YouTube forbids embedding some videos in a localhost environment without a public domain, but your video can be embedded with no issue through a public domain/ sub-domain try the same using webhosting apps or online html tools.

I had the same issue with Sky COTL soundtrack and when i save the html iframe code from share > embed to local html file (or directly in an obsidian note) i got the same Video unavailable - Watch on YouTube error, but if i put the same code in some online html compiler like this one it works

<iframe width="560" height="315" src="https://www.youtube.com/embed/87etrUp83Yc?amp;controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

So, i guess obsidian is not exposed to public web (localhost environment without a public domain) and as it's said in stackoverflow answer YouTube forbids embedding some videos in those situations

@phthallo @andrewmcgivery what do you think, am I on the right path?

P.S. I realized that in the code the player is set to the size of 200x100 and in the documentation (mentioned in the comment) it says that the minimum required size is 200x200, I don't know if that has any impact, I just noticed it

andrewmcgivery commented 4 months ago

It's likely the issue with there needing to be a domain for certain videos, but I've also noticed that there is inconsistency where it works fine for some people and not for others.

From a technical perspective I could probably get around this by hosting the iframe somewhere (and then putting an iframe to that page in Obsidian) but then that adds an external dependency on me keeping (and paying for) a domain. and hosting.

Will keep brainstorming on this one but there may not be a clean fix for it.

ThomasEricB commented 4 months ago

Will keep brainstorming on this one but there may not be a clean fix for it.

I might have a great solution for this problem @andrewmcgivery! Instead of embedding from YouTube directly, you should make the video embed from a random working invidious instance as the default (with a toggle to disable invidious instancing to go direct to youtube)! I've seen a couple of websites use this as a method of a way to dodge these embed restrictions (and geo-restrictions as well)!

n30s4m commented 3 months ago

This is a link that can put the ID and work ok, from the characters after the =

https://www.youtube.com/watch?v=XXHJOvXnwJw

this XXHJOvXnwJw

Others, I can't. I tried about 10 and I can't do it, but DUB is infallible. What would be so special about this link that the others wouldn’t? I tried several ways, getting the ID like the other one that worked, trying sharing, and always reloading the plugins and restarting Obsidian, but they didn't work. In any case, congratulations.