Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source types and add youtube support #10

Open
araynimax opened this issue Aug 30, 2021 · 5 comments
Open

Add source types and add youtube support #10

araynimax opened this issue Aug 30, 2021 · 5 comments
Labels
feature New feature no priority Will be not prioritized

Comments

@araynimax
Copy link
Owner

The given source-url should be used to get the exact type of the source:

  • direct url sound
  • direct url video
  • youtube
  • youtube-live
  • etc.
@araynimax araynimax added the feature New feature label Aug 30, 2021
@araynimax araynimax self-assigned this Aug 30, 2021
@araynimax
Copy link
Owner Author

This is quite tricky to implement.
First try:

@araynimax araynimax added the no priority Will be not prioritized label Aug 31, 2021
@araynimax araynimax removed their assignment Aug 31, 2021
@coyotezin
Copy link

coyotezin commented Sep 7, 2022

hey, did you end up implementing youtube support? i really like how 3d sound works in this resource but youtube/other url sources support is a must have imo

i was trying to use xsound, which does include youtube support but its 3d/directional sound doesnt seem to work(only changes volume based on distance) and also doesnt come with filters/underwater effect as yours does. Could maybe take a look on how youtube support was implemented there to add to this resource?

@araynimax
Copy link
Owner Author

As written in previous comments, it's quite hard to implement this properly or at least I didnt find a correct way yet.
xsound does not use the Native Web Audio API which is needed for the 3d implementation for sounity.

Unfortunately, I don't have time to deal with it due to studies and other things.
Feel free to try out to implement it yourself. I will find time to review any pull request.

@VacEx0
Copy link

VacEx0 commented Dec 4, 2022

Very interested in this.

This is quite tricky to implement. First try:

  • Create IFrame with url: youtube.com/embed/##ID##
  • With chromes security features disabled, you can access the DOM of the IFrame and find the video tag and connect it to the web audio logic.
  • However, you had to control the player through another element
    Take a look into the code: feature/10-source-types/src/sounity-cef/src/nodes/SounitySoundNode.ts#L108
  • Youtube livestreams can't really be distinguished and that's why youtube livestreams coming from server-side don't start, because here the start-time is always taken into account

How far did you get through this? Like does it work even in the slightest?
This resource itself is very nice, but in order for me to use it for things like boomboxes in game (where the player enters a url to play music) I need it to support youtube urls or some other method that wouldnt be too complicated for the general player.

The only other resource out there, to my knowledge, that does this exact thing costs $50 unfortunately.

@araynimax
Copy link
Owner Author

Unfortunately I do not have time for this side project at the moment. Feel free to implement it yourself and create a pullrequest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature no priority Will be not prioritized
Projects
None yet
Development

No branches or pull requests

3 participants