美文网首页
jiecaovideoplayer视频播放

jiecaovideoplayer视频播放

作者: 初昇陌 | 来源:发表于2019-03-18 20:07 被阅读0次

    1.依赖

        implementation 'fm.jiecao:jiecaovideoplayer:4.8.3'
        implementation 'com.github.bumptech.glide:glide:3.7.0'
    

    2.布局

    <fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
            android:id="@+id/player_list_video"
            android:layout_width="match_parent"
            android:layout_height="220dp" />
    

    3.主界面

    String s1="http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4";
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
           initView();
       }
    
       private void initView() {
           player_list_video = (JCVideoPlayerStandard) findViewById(R.id.player_list_video);
           player_list_video.setUp(s1 , JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "视频标题");
    
       }
       @Override
       public void onBackPressed() {
           if (JCVideoPlayer.backPress()){
               return;
           }
           super.onBackPressed();
       }
    
       @Override
       protected void onPause() {
           super.onPause();
           JCVideoPlayer.releaseAllVideos();
       }
    

    相关文章

      网友评论

          本文标题:jiecaovideoplayer视频播放

          本文链接:https://www.haomeiwen.com/subject/bltimqtx.html