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

Suggestions #1

Open
decryptedchaos opened this issue Feb 24, 2021 · 3 comments
Open

Suggestions #1

decryptedchaos opened this issue Feb 24, 2021 · 3 comments

Comments

@decryptedchaos
Copy link

This is a useful bit of code, I explored the code while I was looking for an audio player implementation.

I would share with you two things that I found that could use improvement.

the songIndex array does not appear to work when there is only one song in the array the way I was able to work around this is to declare the same song twice, however, it would be nice if there was a less hacky way to get it to only process one song.

the URL source for the mp3 file is in clear text, making it too easy to steal the content, it would be very nice if the javascript handled obfuscated filenames or random keys that pointed to the mp3 file.

@josephDev123
Copy link
Owner

nice suggestion. I will look into it

@josephDev123
Copy link
Owner

They work well here. The only problem is that it's not playing the next audio quickly

@decryptedchaos
Copy link
Author

Interesting you can't reproduce, the issue i had is if i declare a single entry as such it won't play. i should note that changing let songIndex = 2 [1-2] makes no difference either.

const songs = ['He Did It Again']; let songIndex = 2;

i found that it requires a second option, i didn't review the code in great detail and I'm not a great coder in the first place. but it was my experience that it wouldn't detect the file with only one in the list it would return (undefined).mp3 in the src=

const songs = ['He Did It Again', 'blank'];

I also noticed that it didn't play the next song, but I wasn't worried about it yet since I was only working with one track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants