All Projects → ct7ct7ct7 → Android-VimeoPlayer

ct7ct7ct7 / Android-VimeoPlayer

Licence: MIT License
Unofficial Vimeo video player library for Android.

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Android-VimeoPlayer

react-video-players
📺 Library of React video player components that offer a consistent interface and callback system for Vimeo, YouTube and the <video> tag. Along with a handy higher order component for building your own 😉
Stars: ✭ 13 (-71.74%)
Mutual labels:  vimeo, video-player, vimeo-player
react-native-vimeo-iframe
No description or website provided.
Stars: ✭ 17 (-63.04%)
Mutual labels:  vimeo, video-player
x5 webview flutter
一个基于腾讯x5引擎的webview flutter插件,简化集成,一行代码打开视频播放,暂时只支持android使用
Stars: ✭ 90 (+95.65%)
Mutual labels:  webview, video-player
Youtube player flutter
Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. Supports both Android and iOS platforms.
Stars: ✭ 366 (+695.65%)
Mutual labels:  webview, video-player
Unity Videoplayer Helper
Simple helper for the Video Player in Unity
Stars: ✭ 49 (+6.52%)
Mutual labels:  vimeo, video-player
statamic-video-embed
A field type for embedding YouTube and Vimeo Videos
Stars: ✭ 16 (-65.22%)
Mutual labels:  vimeo, vimeo-video
dokuwiki-plugin-vshare
Plugin to easily embed videos from various video sharing sites into DokuWiki
Stars: ✭ 15 (-67.39%)
Mutual labels:  vimeo, video-player
vimeo-threejs-player
A plugin for streaming video from Vimeo to WebGL/VR/AR apps
Stars: ✭ 75 (+63.04%)
Mutual labels:  vimeo
floating-video-player-android
Floating VideoPlayer sample project with plugin
Stars: ✭ 17 (-63.04%)
Mutual labels:  video-player
os-fileup
Helper app to understand how to upload files and do basic image/video processing in hybrid android apps.
Stars: ✭ 207 (+350%)
Mutual labels:  webview
Super-Stitch
一款视频超级拼接软件
Stars: ✭ 28 (-39.13%)
Mutual labels:  video-player
webviewhs
🌐 A Haskell binding to the webview library created by Serge Zaitsev.
Stars: ✭ 109 (+136.96%)
Mutual labels:  webview
WebViewJavaScriptBridge
android webview javascript bridge
Stars: ✭ 24 (-47.83%)
Mutual labels:  webview
kaltura-player-js
Kaltura Player JS Platform - Cloud TV and OVP Media Players
Stars: ✭ 83 (+80.43%)
Mutual labels:  video-player
laravel-video-api
Laravel (Youtube/Vimeo) Video Data API
Stars: ✭ 53 (+15.22%)
Mutual labels:  vimeo
msLog
log for webView & webApp 用于webView和webApp的log工具
Stars: ✭ 25 (-45.65%)
Mutual labels:  webview
webviewer-android
Simple WebView for Android
Stars: ✭ 15 (-67.39%)
Mutual labels:  webview
flutter video list sample
Flutter workout to play video list
Stars: ✭ 30 (-34.78%)
Mutual labels:  video-player
RxWebView
RxJava2 binding APIs for Android's WebView
Stars: ✭ 22 (-52.17%)
Mutual labels:  webview
RNApp
react native app
Stars: ✭ 43 (-6.52%)
Mutual labels:  webview

Android-VimeoPlayer

Unofficial Vimeo video player library for Android.

Inspired by android-youtube-player.

website

screenshot

Gradle

dependencies {
    implementation 'com.ct7ct7ct7.androidvimeoplayer:library:{latest version}'
}

Usage

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    
        <com.ct7ct7ct7.androidvimeoplayer.view.VimeoPlayerView
            android:id="@+id/vimeoPlayer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:autoPlay="false"
            app:loop="false"
            app:muted="false"
            app:showFullscreenOption="false"
            app:showMenuOption="false"
            app:showOriginalControls="false"
            app:showTitle="true"
            app:topicColor="#FFFF00"
            app:aspectRatio="1.778"
            app:backgroundColor="#00FFFF"
            />
</LinearLayout>
lifecycle.addObserver(vimeoPlayer)
vimeoPlayer.initialize(true, 59777392)

//If video is open. but limit playing at embedded.
vimeoPlayer.initialize(true, {YourPrivateVideoId}, "SettingsEmbeddedUrl")

//If video is pirvate.
vimeoPlayer.initialize(true, {YourPrivateVideoId},"VideoHashKey", "SettingsEmbeddedUrl")


Properties

  • app:topicColor (default : 00adef) Specify the color of the video controls.
  • app:backgroundColor (default : 000000) Specify the color of the video background.
  • app:autoPlay (default : false) Automatically start playback of the video.
  • app:loop (default : false) Play the video again when it reaches the end.
  • app:muted (default : false) Mute this video on load.
  • app:showTitle (default : true) Show the title on the video.
  • app:showOriginalControls (default : false) Show vimeo js original controls.
  • app:showFullscreenOption (default : false) Show the fullscreen button on the native controls.
  • app:showMenuOption (default : false) Show the menu button on the native controls.
  • app:aspectRatio (default : 1.777..) Assign aspect ratio. default is 16/9.
  • app:quality (default : "auto") Vimeo Plus, PRO, and Business members can set this config. Possible values:Auto, 4K, 2K, 1080p, 720p, 540p, 360p

Menu options

//show the menu option
vimeoPlayer.setMenuVisibility(true)

//add item
vimeoPlayer.addMenuItem(ViemoMenuItem("Item 1",R.drawable.icon, View.OnClickListener {
    //TODO
    vimeoPlayer.dismissMenuItem()
}))

//override menu click listener
vimeoPlayer.setMenuClickListener { 
    //TODO
}

Fullscreen options

//show the fullscreen option
vimeoPlayer.setFullscreenVisibility(true)



var REQUEST_CODE = 1234
.
.
.
//go to fullscreen page
vimeoPlayer.setFullscreenClickListener {

    //define the orientation
    var requestOrientation = VimeoPlayerActivity.REQUEST_ORIENTATION_AUTO
    
    startActivityForResult(VimeoPlayerActivity.createIntent(this, requestOrientation, vimeoPlayer), REQUEST_CODE)
}
.
.
.
//handle return behavior
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE) {
        var playAt = data!!.getFloatExtra(VimeoPlayerActivity.RESULT_STATE_VIDEO_PLAY_AT, 0f)
        vimeoPlayer.seekTo(playAt)

        var playerState = PlayerState.valueOf(data!!.getStringExtra(VimeoPlayerActivity.RESULT_STATE_PLAYER_STATE))
        when (playerState) {
            PlayerState.PLAYING -> vimeoPlayer.play()
            PlayerState.PAUSED -> vimeoPlayer.pause()
        }
    }
}

Methods

val videoId: Int = vimeoPlayer.videoId
val baseUrl: String? = vimeoPlayer.baseUrl
val hashKey: String? = vimeoPlayer.hashKey
val playerState: PlayerState = vimeoPlayer.playerState
val currentTime: Float = vimeoPlayer.currentTimeSeconds
vimeoPlayer.setCaptions("en") //only supported original controls.
vimeoPlayer.disableCaptions() //only supported original controls.
vimeoPlayer.seekTo(0.0f)
vimeoPlayer.loop = true
vimeoPlayer.topicColor = Color.RED
vimeoPlayer.setVolume(0.5f)
vimeoPlayer.setPlaybackRate(0.5f)
vimeoPlayer.play()
vimeoPlayer.pause()
vimeoPlayer.loadVideo(19231868)
vimeoPlayer.recycle()
vimeoPlayer.clearCache()

Listeners

  • VimeoPlayerReadyListener
  • VimeoPlayerStateListener
  • VimeoPlayerTimeListener
  • VimeoPlayerTextTrackListener
  • VimeoPlayerVolumeListener
  • VimeoPlayerErrorListener
vimeoPlayer.addReadyListener(object : VimeoPlayerReadyListener {
    override fun onReady(title: String?, duration: Float, textTrackArray: Array<TextTrack>) {
        //TODO
    }

    override fun onInitFailed() {
        //TODO
    }
})
vimeoPlayer.addStateListener(object : VimeoPlayerStateListener {
    override fun onPlaying(duration: Float) {
        //TODO
    }

    override fun onPaused(seconds: Float) {
        //TODO
    }

    override fun onEnded(duration: Float) {
        //TODO
    }
})
vimeoPlayer.addTimeListener { second: Float ->
    //TODO
}
vimeoPlayer.addTextTrackListener { kind: String, label: String, language: String ->
    //TODO
}
vimeoPlayer.addVolumeListener { volume: Float ->
    //TODO
}
vimeoPlayer.addErrorListener { message: String, method: String, name: String ->
    //TODO
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].