Open tlb0 opened 7 months ago
Name | Link |
---|---|
Latest commit | bfd534f52081696d2de07dbe426d787afd0c2e35 |
Latest deploy log | https://app.netlify.com/sites/obsidian-media-notes/deploys/66002f5ffd5c8e0008d54583 |
Deploy Preview | https://deploy-preview-1--obsidian-media-notes.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
hey @tlb0 thanks for contributing!
A couple questions:
Regarding the code changes:
getVideoId
- it would be preferable to refactor that to work with any url type, instead of overwriting the mediaLink passed into the MediaFrame componentHi @jemstelos , sorry for the late reply, I was really busy this week. You asked if I could reproduce the issue. In this example I used the same YouTube-video, but with a different link format. The first one works, but the second one just shows a black screen. So you said I should move the function to the get videoId function? Just to be sure that I understood you correctly, should I just place the code of the regularURL function into the getVideoId funtion? I'm asking since I am not familiar with the way you structured the code.
@tlb0 hey yes this is the function i'm referring to: https://github.com/jemstelos/obsidian-media-notes/blob/3b0a73767484fb731273d9cd231d275e93c11ef6/src/components/media-frame.tsx#L7
If that can be refactored with your regex to extract the right ID from different url's this should work and keep the same separation of concerns. We currently just pass in a videoId to the Youtube player component
Hi, I moved the regex to the getVideoId() function now. Works perfectly fine. You can ignore/delete the changes release,yml and manifest.json. I just had the check if everything works fine.
Hi, when I used your plugin the video player did not work because the URL was not written in the right format. Since there are many ways a YouTube URL can be formatted, I slightly changed your code to allow allow almost all of these possibilities. I only added a small function. The function now allows for Links in these formats:
The code is based on this post. Maybe you don't like the placement of the function. Do what you want with it. :)