zoukankan      html  css  js  c++  java
  • Android 开源框架 ( 十六 ) 视频播放器 --- JiaoZiVideoPlayer(JieCaoVideoPlayer)

      原JieCaoVideoPlayer 不知道什么时候改名了,现在叫JiaoZiVideoPlayer.

      项目GitHub地址:https://github.com/lipangit/JiaoZiVideoPlayer

      JiaoZiVideoPlayer主要功能

        1.视频全屏播放和浮层小窗播放
        2.可以完全自定义UI
        3.能在ListView、ViewPager和ListView、ViewPager和Fragment等多重嵌套模式下全屏工作
        4.手势修改进度和音量
        5.视频大小的屏幕适配,宽或长至少有两个对边是充满屏幕的,另外两个方向居中
        6.可以在加载、暂停、播放等各种状态中正常进入全屏和退出全屏
        7.基于exoplayer, 支持hls,rtsp
        8.设置http头信息
        9.重力感应自动全屏
        10.WebView嵌套本地视频
    

      

     基本使用

      1.添加依赖

    compile 'cn.jzvd:jiaozivideoplayer:6.2.12'

      2.xml布局文件

    <cn.jzvd.JZVideoPlayerStandard
            android:id="@+id/videoplayer"
            android:layout_width="match_parent"
            android:layout_height="200dp"/>

      3.设置视频url和标题

    JZVideoPlayerStandard jzVideoPlayerStandard = (JZVideoPlayerStandard) findViewById(R.id.videoplayer);
    jzVideoPlayerStandard.setUp("http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4", 
                                JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, 
                                "饺子闭眼睛");
    jzVideoPlayerStandard.thumbImageView.setImage("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640");

      4.AndroidManifest.xml:

    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|screenSize|keyboardHidden"
        android:screenOrientation="portrait" />
        

       当我们横竖屏切换的时候会直接调用onCreate方法中的onConfigurationChanged方法,而不会重新执行onCreate方法,那当然如果不配置这个属性的话就会重新调用onCreate方法了。

     

  • 相关阅读:
    【cocos2d-x 024】 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
    【cocos2d-x 024】 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
    socket 通信代码,单线程
    socket 通信代码,单线程
    socket 通信代码,单线程
    使用Cocos Studio 创建帧动画
    使用Cocos Studio 创建帧动画
    使用Cocos Studio 创建帧动画
    sscanf函数用法详解
    (OK) firefox
  • 原文地址:https://www.cnblogs.com/bugzone/p/JiaoZiVideoPlayer.html
Copyright © 2011-2022 走看看