Skip to content

Instantly share code, notes, and snippets.

View slavipetrov's full-sized avatar
👨‍💻

Slavi Petrov slavipetrov

👨‍💻
  • Bulgaria
View GitHub Profile
...
// Using the MediaControllerListener interface
fullscreenVideoView.videoUrl(videoUrl)
.mediaControllerListener(object : MediaControllerListener {
override fun onPlayClicked() {
// Do something when the play button is clicked
}
override fun onPauseClicked() {
// Do something when the pause button is clicked
...
// Add initially from the Builder
fullscreenVideoView.videoUrl(videoUrl)
.addOnErrorListener(object : OnErrorListener {
override fun onError(exception: FullscreenVideoViewException?) {
// Handle error
}
})
// OR
...
// Hide initially from the Builder
fullscreenVideoView.videoUrl(videoUrl)
.hideFullscreenButton()
// OR
// Hide by calling the view method
fullscreenVideoView.hideFullscreenButton()
...
...
// Hide initially from the Builder
fullscreenVideoView.videoUrl(videoUrl)
.hideProgress()
// OR
// Hide by calling the view method
fullscreenVideoView.hideProgress()
...
...
// Setup the view
fullscreenVideoView.videoUrl(videoUrl)
// Play the video later
fullscreenVideoView.play()
// OR
// Pause the video later
...
// Drawable resource id
val thumbnailResId = R.drawable.video_thumbnail
// Add the thumbnail
fullscreenVideoView.videoUrl(videoUrl)
.thumbnail(thumbnailResId)
...
...
// Add the default playback speeds
fullscreenVideoView.videoUrl(videoUrl)
.addPlaybackSpeedButton()
// Add custom playback speeds
val playbackOptions = PlaybackSpeedOptions().addSpeeds(0.25f, 0.5f, 0.75f, 1f)
fullscreenVideoView.videoUrl(videoUrl)
.addPlaybackSpeedButton()
...
<dependency>
<groupId>bg.devlabs.fullscreenvideoview</groupId>
<artifactId>library</artifactId>
<version>1.1.3</version>
<type>pom</type>
</dependency>
...
...
dependencies {
compile 'bg.devlabs.fullscreenvideoview:library:1.1.3'
}
...
...
<bg.devlabs.fullscreenvideoview.FullscreenVideoView
...
app:enter_fullscreen_drawable="@drawable/ic_fullscreen_white_48dp"
app:exit_fullscreen_drawable="@drawable/ic_fullscreen_exit_white_48dp"
app:ffwd_drawable="@drawable/ic_fast_forward_white_48dp"
app:pause_drawable="@drawable/ic_pause_white_48dp"
app:play_drawable="@drawable/ic_play_arrow_white_48dp"
app:progress_color="@color/colorPrimary"
app:rew_drawable="@drawable/ic_fast_rewind_white_48dp" />