一个视频播放JZVideoPlayer小demo
1.导入依赖:implementation'cn.jzvd:jiaozivideoplayer:6.2.10'
2.activity_main布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<cn.jzvd.JZVideoPlayerStandard
android:id="@+id/videoplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout >
3.MainActivity主要代码:
videoplayer = (JZVideoPlayerStandard)findViewById(R.id.videoplayer);
videoplayer.setUp(视频网址,JZJZVideoPlayer.SCREEN_WINDOW_NORMAL,视频名字);
网友评论