-
-
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 method to change playback speed #101
Comments
the method |
Hi, it can be achieved by changing the WebView user agent, i.e. in
Great lib, thanks for your work! |
Hi, interesting! I didn't know that. It's a nice little hack. The problem with hacks is that they are usually not reliable long term. Therefore not the best solution for a library. I will try to find a way to integrate this as an option (not the default implementation), so that who enables it must know what he's doing. |
Yeah, make it as an option would be an throughly consideration. |
Dude you are so awesome. I will literally send you money @PierfrancescoSoffritti if you implement this. |
The problem with this is that if I implement it, it will be a broken feature for everyone not using the hack of changing the user agent. Therefore the |
Any updates on this issue? Did someone find a workaround to achieve it?
Hi, how can I implement it? |
This is still not possible without using hacks. If you want to use the solution suggested by @leavjenn feel free to fork the library and make the change yourself. |
Thanks! I implemented it. |
Hi guys, any progress on this ? |
Hi @zanynik unfortunately this is still not possible. |
Can I someone guide me on how to change playback speed. I am beginner and I am desparately in need of this of feature.Any Help would be highly appreciated |
Plz add playback speed change option . |
Its April 2020. Still I don't see any api for playback speed. @PierfrancescoSoffritti can you please suggest anything to add playback speed in youtube player view in android? |
I think it's still not possible, but haven't tried recently. You're welcome to explore the YouTube IFrame player api and submitting a pull request, in case things changed. |
@PierfrancescoSoffritti |
How? can you explain?? contact mail : [email protected] |
@leavjenn @sajithlaldev @anmolgooded Hi if any of you implemented this please share a sample code and other details , it would be very helpful for me. |
@PierfrancescoSoffritti document.querySelector('video').playbackRate = 0.5; I just applied this js while playing youtube video in webview. Can you use the same in this library? |
You can, but it's not using public API, so it will inevitably break eventually. |
i added video speed function in my fork : https://github.com/Serkali-sudo/android-youtube-player (it is default iframe setPlayback rate implementation but it works) |
can you make a PR and merge it @PierfrancescoSoffritti |
you can just download my fork and add as a module in android studio.There is no any new update anyways |
how to add it as a module can you guide me? |
There is 2 or more ways of doing this : 1 - In android studio select "File -> New -> Import Module" after selecting that it is going to ask for file path of module.Select "core" folder on the project(in my fork) and after that click finish and it should be added. But if you are using Arctic Fox version of android studio and first method didnt worked. Then you can add it manually as explained below 2-(Alternative Way): First of all you need to download my fork and move "core" folder and "dependencies.gradle" file to your project file path.After that open "settings.gradle" from gradle script in android studio.after that add: Now click "sync now" and it should work now For more info :https://stackoverflow.com/a/69678559 |
hey @Serkali-sudo , so you're calling the public API method of the iframe player? or did you make some custom implementation? Last time i tried this wasn't working on mobile phones, but maybe YouTube fixed it since then. Over the Christmas holidays i can play with it. If it works I will add it to the main lib. Feel free to send a pull request if you want :) |
@PierfrancescoSoffritti Public API method works now.I just added |
Nice, then i will take a look before the new year. |
@Serkali-sudo can you add
|
@rahulsain-ingeniumedu There is no need to add that you can just call that function from public class SpeedExample extends AppCompatActivity {
private YouTubePlayer mYoutubePlayer;
private YouTubePlayerView youTubePlayerView;
private Button setVideoSpeed;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
youTubePlayerView = findViewById(R.id.youtube_player_view);
setVideoSpeed = findViewById(R.id.setVideoSpeed);
setVideoSpeed.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mYoutubePlayer != null) {
mYoutubePlayer.setVideoSpeed(0.5);
}
}
});
getLifecycle().addObserver(youTubePlayerView);
youTubePlayerView.addYouTubePlayerListener(new AbstractYouTubePlayerListener() {
@Override
public void onReady(@NonNull YouTubePlayer youTubePlayer) {
String videoId = "dQw4w9WgXcQ";
youTubePlayer.loadVideo(videoId, 0);
mYoutubePlayer = youTubePlayer;
}
});
}
} |
yes it is working, we can add speed from 0.1f to 2f? |
Hi, I have added support for changing playback speed both to core and chromecast library: 687ecf0 Thanks a lot @Serkali-sudo for the help! |
The change is available in version 11.0.0 |
@PierfrancescoSoffritti how to change speed 0.75, you can more enum. please |
No description provided.
The text was updated successfully, but these errors were encountered: