-
-
Notifications
You must be signed in to change notification settings - Fork 758
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 more playback rates #1073
Add more playback rates #1073
Conversation
Hi, thanks for the PR! Did you try passing a value bigger than 2? what happens? |
I just tested it which lead me to fix a few bugs I had introduced. When calling it with a value greater than 2 the playback rate is set to 2. Should we add a |
Based on this, I'd say we should not add this method |
The difference between |
@PierfrancescoSoffritti sorry to bother you. Anything else that should be done on this PR? |
I have removed the option to use a generic float to set the playback rate, as it doesn't seem necessary and introduces too much ambiguity in the API. But happy to add the new enums, thanks for your contribution :) |
@PierfrancescoSoffritti the point of being able to set the playback rate with an arbitrary float is that you can set the value to 1.2 or any other value between 0.25 and 2.0 which doens't have an enum value. This is also allowed in the youtube website if you click on playbackrate and select custom. |
I understand, why is using the predefined values not enough for your use case? |
In my use case we have to allow any value between 0.25 and 2.0 with increments of 0.01. This is for an app for musicians which might want to play the video at arbitrary speeds. I understand if you don't want to implement this. For now I have copied my fork into the project and use that. |
I see. I think wanting to add a function to set an arbitrary playback speed is a reasonable request. I will add the method, but it will take some time as I need to make sure the API we are introducing is clear and won't lead to confusing behavior. (And I have limited time to spend on the library) I have opened #1081 to keep track of this, I will get to it before the end of the year. |
The Youtube Web Client supports any value between 0.25 and 2.0 so I'm guessing this API should be able to do so as well. I have added two commits, one that adds just the missing 0.75, 1.25, and 1.75 increments and one that adds a function to allow any float value. We might have to check what happens if 2.5 or 100 is sent and maybe a doc indicating that only values between 0.25 and 2.0 are valid.
This PR addresses:
#1001
#992