1 Star 0 Fork 0

jackeysun / VodPlayer

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

云点播播放器封装

远程引用

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
dependencies {
	        implementation 'com.gitee.jackeysun:vod-player:1.0.9'
	}

更新引用

allprojects {
		repositories {
			...
			maven { url uri('https://gitee.com/jackeysun/vod-player/raw/master/repo') }
		}
	}
dependencies {
	        implementation 'com.uuedu:superplayerkit:1.0.13'
	}

版本1.0

控件的使用

<com.tencent.liteav.demo.superplayer.SuperPlayerView
    android:id="@+id/superVodPlayerView"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    app:sv_main_color="@android:color/holo_green_light"
    app:sv_show_mark="true"
    app:sv_show_share="true"
    app:sv_full_screen="true"
    app:sv_show_zoom="true"/>

控件属性

  1. sv_main_color 主题颜色
  2. sv_show_mark 标记按钮 ,默认不显示
  3. sv_show_share 分享按钮 ,默认不显示
  4. sv_full_screen 初始是否全屏, 默认小屏
  5. sv_show_zoom 全屏小屏切换按钮,默认显示

初始化播放资源

使用场景:在不想立即播放时,提前设置播放资源,点击按钮即可播放视频,注意在初始化之前还有视频在播放的情况下,请提前关闭前一个视频

setSuperPlayerModel(SuperPlayerModel model)

回调

状态监听

public void setPlayerViewCallback(OnSuperPlayerViewCallback callback) {
    mPlayerViewCallback = callback;
}
public interface OnSuperPlayerViewCallback {

    /**
     * 开始全屏播放
     */
    void onStartFullScreenPlay();

    /**
     * 结束全屏播放
     */
    void onStopFullScreenPlay();

    /**
     * 点击悬浮窗模式下的x按钮
     */
    void onClickFloatCloseBtn();

    /**
     * 点击小播放模式的返回按钮
     */
    void onClickSmallReturnBtn();

    /**
     * 开始悬浮窗播放
     */
    void onStartFloatWindowPlay();
}

按钮监听

 setOnBtnClickListener(OnBtnClickListener onBtnClickListener)

方法

获取当前播放位置,单位毫秒

getCurrent()

获取当前视频的总时长,单位毫秒

getDuration()

设置初始播放位置

seek(int position)

获取当前播放状态

getPlayerState()

生命周期方法

onResume()
onPause()
release()

内存释放

resetPlayer()

Repository Comments ( 0 )

Sign in to post a comment

About

腾讯云点播播放器 expand collapse
Java and 2 more languages
Cancel

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/jackeysun/vod-player.git
git@gitee.com:jackeysun/vod-player.git
jackeysun
vod-player
VodPlayer
master

Search