-
- All Implemented Interfaces:
-
com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.YouTubePlayerListener
public final class FadeViewHelper implements YouTubePlayerListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classFadeViewHelper.Companion
-
Field Summary
Fields Modifier and Type Field Description private BooleanisDisabledprivate LonganimationDurationprivate LongfadeOutDelayprivate final ViewtargetView
-
Constructor Summary
Constructors Constructor Description FadeViewHelper(View targetView)
-
Method Summary
Modifier and Type Method Description final BooleangetIsDisabled()final UnitsetIsDisabled(Boolean isDisabled)final LonggetAnimationDuration()Duration of the fade animation in milliseconds. final UnitsetAnimationDuration(Long animationDuration)Duration of the fade animation in milliseconds. final LonggetFadeOutDelay()Delay after which the view automatically fades out. final UnitsetFadeOutDelay(Long fadeOutDelay)Delay after which the view automatically fades out. final ViewgetTargetView()final UnittoggleVisibility()UnitonStateChange(YouTubePlayer youTubePlayer, PlayerConstants.PlayerState state)Called every time the state of the player changes. UnitonReady(YouTubePlayer youTubePlayer)Called when the player is ready to play videos. UnitonPlaybackQualityChange(YouTubePlayer youTubePlayer, PlayerConstants.PlaybackQuality playbackQuality)Called every time the quality of the playback changes. UnitonPlaybackRateChange(YouTubePlayer youTubePlayer, PlayerConstants.PlaybackRate playbackRate)Called every time the speed of the playback changes. UnitonError(YouTubePlayer youTubePlayer, PlayerConstants.PlayerError error)Called when an error occurs in the player. UnitonApiChange(YouTubePlayer youTubePlayer)UnitonCurrentSecond(YouTubePlayer youTubePlayer, Float second)Called periodically by the player, the argument is the number of seconds that have been played. UnitonVideoDuration(YouTubePlayer youTubePlayer, Float duration)Called when the total duration of the video is loaded. UnitonVideoLoadedFraction(YouTubePlayer youTubePlayer, Float loadedFraction)Called periodically by the player, the argument is the percentage of the video that has been buffered. UnitonVideoId(YouTubePlayer youTubePlayer, String videoId)Called when the id of the current video is loaded -
-
Constructor Detail
-
FadeViewHelper
FadeViewHelper(View targetView)
-
-
Method Detail
-
getIsDisabled
final Boolean getIsDisabled()
-
setIsDisabled
final Unit setIsDisabled(Boolean isDisabled)
-
getAnimationDuration
final Long getAnimationDuration()
Duration of the fade animation in milliseconds.
-
setAnimationDuration
final Unit setAnimationDuration(Long animationDuration)
Duration of the fade animation in milliseconds.
-
getFadeOutDelay
final Long getFadeOutDelay()
Delay after which the view automatically fades out.
-
setFadeOutDelay
final Unit setFadeOutDelay(Long fadeOutDelay)
Delay after which the view automatically fades out.
-
getTargetView
final View getTargetView()
-
toggleVisibility
final Unit toggleVisibility()
-
onStateChange
Unit onStateChange(YouTubePlayer youTubePlayer, PlayerConstants.PlayerState state)
Called every time the state of the player changes. Check PlayerConstants.PlayerState to see all the possible states.
- Parameters:
state- a state from PlayerConstants.PlayerState
-
onReady
Unit onReady(YouTubePlayer youTubePlayer)
Called when the player is ready to play videos. You should start using with the player only after this method is called.
- Parameters:
youTubePlayer- The YouTubePlayer object.
-
onPlaybackQualityChange
Unit onPlaybackQualityChange(YouTubePlayer youTubePlayer, PlayerConstants.PlaybackQuality playbackQuality)
Called every time the quality of the playback changes. Check PlayerConstants.PlaybackQuality to see all the possible values.
- Parameters:
playbackQuality- a state from PlayerConstants.PlaybackQuality
-
onPlaybackRateChange
Unit onPlaybackRateChange(YouTubePlayer youTubePlayer, PlayerConstants.PlaybackRate playbackRate)
Called every time the speed of the playback changes. Check PlayerConstants.PlaybackRate to see all the possible values.
- Parameters:
playbackRate- a state from PlayerConstants.PlaybackRate
-
onError
Unit onError(YouTubePlayer youTubePlayer, PlayerConstants.PlayerError error)
Called when an error occurs in the player. Check PlayerConstants.PlayerError to see all the possible values.
- Parameters:
error- a state from PlayerConstants.PlayerError
-
onApiChange
Unit onApiChange(YouTubePlayer youTubePlayer)
-
onCurrentSecond
Unit onCurrentSecond(YouTubePlayer youTubePlayer, Float second)
Called periodically by the player, the argument is the number of seconds that have been played.
- Parameters:
second- current second of the playback
-
onVideoDuration
Unit onVideoDuration(YouTubePlayer youTubePlayer, Float duration)
Called when the total duration of the video is loaded. <br></br><br></br> Note that getDuration() will return 0 until the video's metadata is loaded, which normally happens just after the video starts playing.
- Parameters:
duration- total duration of the video
-
onVideoLoadedFraction
Unit onVideoLoadedFraction(YouTubePlayer youTubePlayer, Float loadedFraction)
Called periodically by the player, the argument is the percentage of the video that has been buffered.
- Parameters:
loadedFraction- a number between 0 and 1 that represents the percentage of the video that has been buffered.
-
onVideoId
Unit onVideoId(YouTubePlayer youTubePlayer, String videoId)
Called when the id of the current video is loaded
- Parameters:
videoId- the id of the video being played
-
-
-
-