Closed Vatsal3009 closed 6 months ago
I don't understand what the issue is. This library provides a Youtube Player to play Youtube videos.
@Vatsal3009 do you mean that view initially display play icon, then video starts when user click on play icon ? also, you can share a design/screenshot from what exactly needed
I'd like to display a view like this in my RecyclerView using our library, where the video plays automatically. However, I need the ability to pause the video afterward. I've noticed there's an "app:autoPlay=false" attribute, but it doesn't seem to be working. Please let me know if you need any further information from my end. Thank you for your response!
I have use below code
binding?.playerView?.addYouTubePlayerListener(object : AbstractYouTubePlayerListener() { override fun onReady(@NonNull youTubePlayer: YouTubePlayer) { item.source?.let { youTubePlayer.loadVideo(it, 0f) youTubePlayer.pause() } } })
@Vatsal3009
you can use cueVideo
instead of mix of "load & pause".
I tried now, and youTubePlayer.cueVideo(it. 0f)
worked as you want.
Hello @MahmoudMabrok ,
Thank you for your resposne. I have check with "cueVideo" but as you can see in the screenshort by using this first time it will take 1-2 sec to display image and after scroll the recyclerview and again go bottom to top than it will show error in player view in most of the video. can you help me with this ?
Question / Problem
Summary
Hello,
In my project, the requirement is to simply display a YouTube video with a play icon. I believe this feature is not available in the current library.
What I've tried
Now i just load video using if and pause this video and manage my issue.