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

Closes Issue #222: Autoplay Feature from Youtube #258

Closed
wants to merge 4 commits into from

Conversation

avalan4e57
Copy link
Contributor

Motivation and Context

There's a pull request (#231) but it isn't active for a long time. So I've used that pull request and made some work with it to close the issue #222.

Types of changes

What types of changes does your code introduce? Check all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Cleaned up the code from pull request #231.
Then fixed some bugs:
(1) Fixed getNewVideoID function. Previously it just popped up all
the playList and left only the first element. And if this element
would be current video id then nextId will be set to null. Now I've
made a reverse for playlist array to get just the same next video from
YouTube as Youtube suggests itself and that is done with no further
changes in the code. I've also removed the while loop from
getNewVideoID function and that gives the code an opportunity
to check all the playlist for a next track during the session.
(2) Fixed the problem when tracks were added to videoMetadata["items"]
when they were already there. Now there is a clause that checks if
current track has already been played and if so just doesn't add
a duplicate.

Final checklist:

Go over all the following points and check all the boxes that apply
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING guidelines.
  • All tests passed.

Cleaned up the code from pull request zen-audio-player#231.
Then fixed some bugs:
(1) Fixed getNewVideoID function. Previously it just popped up all
the playList and left only the first element. And if this element
would be current video id then nextId will be set to null. Now I've
made a reverse for playlist array to get just the same next video from
YouTube as Youtube suggests itself and that is done with no further
changes in the code. I've also removed the while loop from
getNewVideoID function and that gives the code an opportunity
to check all the playlist for a next track during the session.
(2) Fixed the problem when tracks were added to videoMetadata["items"]
when they were already there. Now there is a clause that checks if
current track has already been played and if so just doesn't add
a duplicate.
@avalan4e57
Copy link
Contributor Author

avalan4e57 commented Aug 1, 2017

Hello! I need to know which event is connected to query search. If I put some video id in search field then I can handle it in form submit event. But if it's a query search when you just type something like "smells like teen spirit" then code from submit form event listener doesn't work. Can you please help find out what is the name of that exact event?

@shakeelmohamed
Copy link
Member

@avalan4e57 I think you want getSearchResults()

@shakeelmohamed
Copy link
Member

Closing due to inactivity

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

Successfully merging this pull request may close these issues.

2 participants