Class YouTubePlayerUtils
-
- All Implemented Interfaces:
public final class YouTubePlayerUtils
-
-
Method Summary
Modifier and Type Method Description final static UnitloadOrCueVideo(YouTubePlayer $self, Lifecycle lifecycle, String videoId, Float startSeconds)Calls YouTubePlayer.cueVideo or YouTubePlayer.loadVideo depending on which one is more appropriate. -
-
Method Detail
-
loadOrCueVideo
final static Unit loadOrCueVideo(YouTubePlayer $self, Lifecycle lifecycle, String videoId, Float startSeconds)
Calls YouTubePlayer.cueVideo or YouTubePlayer.loadVideo depending on which one is more appropriate. If it can't decide, calls YouTubePlayer.cueVideo by default.
In most cases you want to avoid calling YouTubePlayer.loadVideo if the Activity/Fragment is not in the foreground. This function automates these checks for you.
- Parameters:
lifecycle- the lifecycle of the Activity or Fragment containing the YouTubePlayerView.videoId- id of the video.startSeconds- the time from which the video should start playing.
-
-
-
-