This product is no longer supported. Please contact to support@flowplayer.com for an alternative product.
Demo application using Flowplayer Light SDK for Android.
- Minimum SDK version 16.
- Kotlin stdlib.
- If you haven't already, configure Kotlin at your Android Studio project.
- First, add Flowplayer's repository in your project by setting a new
maven repository in your project level
build.gradle
as follows:allprojects { repositories { maven { url 'https://dl.bintray.com/flowplayer/maven/' } } }
- Add library dependency:
implementation 'com.flowplayer.flowplayer:flowplayer:#.#.#'
For a detailed example, check activity_player.xml
.
Add Flowplayer
in your layout:
<com.flowplayer.player.Flowplayer
android:layout_width="match_parent"
android:layout_height="320dp"
app:fullscreenLayout="@id/fullscreenLayout"
app:loadingView="@id/fullscreenLoadingView"
app:mediaId="69891ec1-2d90-423c-9892-5a9ee87b6d86"
app:nonFullscreenLayout="@id/nonFullscreenLayout"
app:playerId="ac6dea7c-acf1-472a-bdab-efdd85f092f1" />
Parameter explanation:
app:fullscreenLayout
: the layout that should be hidden when the player enters fullscreen.app:nonFullscreenLayout
: the layout where the player will be shown when it enters fullscreen.app:mediaId
: A Flowplayer mediaId.app:playerId
(Optional): A Flowplayer playerId.app:loadingView
(Optional): A view that will be shown while the video enters fullscreen.
- Create a
Flowplayer
instance with one of the available constructors. - Setup
fullscreenLayout
,nonFullscreenLayout
, and, optionally,loadingView
viaFlowplayer.setup(View nonFullscreenLayout, ViewGroup fullscreenLayout, View loadingView)
. - Load your media by passing a
mediaId
, and, optionally, aplayerId
viaFlowplayer.loadMedia(String mediaId, String playerId)
.