1、使用

1.1 在project的build.gradle添加如下代码和引入lib库

allprojects {repositories {maven { url "https://jitpack.io" }}
}
implementation fm.jiecao:jiecaovideoplayer:5.8.1

1.2 运行所需权限

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

1.3 布局文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:gravity="center_vertical"><fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandardandroid:id="@+id/videoplayer"android:layout_width="match_parent"android:layout_height="200dp"/>
</LinearLayout>

1.4 配置清单文件

<activity android:name=".JiaoZiVideoPlayerActivity"android:configChanges="screenSize|orientation|keyboard"><intent-filter><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.LAUNCHER"/></intent-filter><intent-filter><action android:name="android.intent.action.VIEW"/><category android:name="android.intent.category.DEFAULT"/><category android:name="android.intent.category.BROWSABLE"/><data android:scheme="rtsp"/></intent-filter><intent-filter tools:ignore="AppLinkUrlError"><action android:name="android.intent.action.VIEW"/><category android:name="android.intent.category.DEFAULT"/><data android:mimeType="video/*"/><data android:mimeType="application/sdp"/></intent-filter><intent-filter><action android:name="android.intent.action.VIEW"/><category android:name="android.intent.category.DEFAULT"/><category android:name="android.intent.category.BROWSABLE"/><data android:scheme="http"/><data android:mimeType="video/mp4"/><data android:mimeType="video/3gp"/><data android:mimeType="video/3gpp"/><data android:mimeType="video/3gpp2"/></intent-filter></activity>

1.5 activity 中调运

class JiaoZiVideoPlayerActivity: BaseActivity() {override fun getLayoutId(): Int {return R.layout.activity_video_player_jiecao}override fun initData() {val data = intent.data;if (data == null){//从应用内响应http://hc.yinyuetai.com/uploads/videos/common/0FBB016ADECDDFF86FF7D6E8CE792DCC.mp4?sc=c19481d47147e188&br=785&rd=Android//获取传递的数据var videoUrl = intent.getStringExtra("videoUrl")var videoTitle = intent.getStringExtra("videoTitle")if(StringHelper.isEmptyString(videoUrl)){videoUrl = "http://hc.yinyuetai.com/uploads/videos/common/0FBB016ADECDDFF86FF7D6E8CE792DCC.mp4?sc=c19481d47147e188&br=785&rd=Android"}videoplayer.setUp(videoUrl, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,videoTitle)videoplayer.thumbImageView.setThumbInCustomProject("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640");}else{if (data.toString().startsWith("http:")){//外部网络视频videoplayer.setUp(data.toString(),JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,data.toString())}else{//从应用外响应videoplayer.setUp(data.path,JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL,data.toString())}}}override fun onBackPressed() {if (JCVideoPlayer.backPress()) {return}super.onBackPressed()}override fun onPause() {super.onPause()JCVideoPlayer.releaseAllVideos()}
}

jiecaovideoplayer视频播放开源框架的使用步骤相关推荐

  1. 若依JAVA开源框架自动生成代码步骤记录-创建子module以及导入子module相关问题

    目录 创建大分类 创建功能表 生成代码 创建module并导入生成的代码 导入子模块 修改自己module的pom.xml和ruoyi-admin下的pom.xml 运行效果 创建大分类 进入系统管理 ...

  2. Android常用开源框架

    快速索引 框架名称 上榜关键字 1.Retrofit 网络 2.okhttp 网络 3.Butter Knife 代码模板 4.MPAndroidChart 图表 5.glide 图片 6.leakc ...

  3. Android 2018优秀开源框架整理收藏

    中级.高级.资深工程师 知其然知其不可然 <框架百大排行榜>里所提到的流行词.流行术语--使用能力.融会贯通其原理.讲解框架能力的高低,将让你不断的在这三个级别徘徊: 会有意识的合并榜单里 ...

  4. android 优秀的开源框架整理

    程序员界有个神奇的网站,那就是github,这个网站集合了一大批优秀的开源框架,极大地节省了开发者开发的时间,在这里我进行了一下整理,这样可以使我们在使用到时快速的查找到,希望对大家有所帮助! 1. ...

  5. android2019开源框架

    1. Retrofit 一句话介绍:Retrofit是一款类型安全的网络框架,基于HTTP协议,服务于Android和java语言 官网地址 http://square.github.io/retro ...

  6. 各种Android UI开源框架 开源库

    各种Android UI开源框架 开源库 转 https://blog.csdn.net/zhangdi_gdk2016/article/details/84643668 自己总结的Android开源 ...

  7. 各种Android UI开源框架

    自己总结的Android开源项目及库. github排名 https://github.com/trending,github搜索:https://github.com/search Android库 ...

  8. Android 开源框架精选

    1. github排名 https://github.com/trending,github搜索:https://github.com/search 2.https://github.com/wasa ...

  9. 各种Android ui 开源框架

    自己总结的Android开源项目及库. github排名 https://github.com/trending,github搜索:https://github.com/search Android库 ...

最新文章

  1. iOS Extension 里的方法不执行
  2. DRX不连续接收(1)
  3. java方法6_6.1 JAVA方法入门
  4. Spring的jar包下载及目录详解
  5. Linux启动nacos成功日志_Spring Cloud Alibaba基础教程:使用Nacos作为配置中心
  6. 让Qt Creator支持Windows Phone 8开发
  7. 1 京东_推荐好友拿好礼 | 每1积分可兑换30元京东电子卡
  8. 编写计算表达式(X-Y+25)/Z的值得程序,要求将其商和余数分别放在A、B单元中。(设X和Y是32位无符号数,A、B和Z是16位无符号数,不考虑溢出情况。)
  9. 布局—column(属性)
  10. 2场直播丨OGG日常运维及故障处理、云原生数据仓库AnalyticDB
  11. Python数字类型:数值运算操作符、数值运算函数、类型判断函数、类型转换函数
  12. 资源配置文件的目录结构以及相应的读取方式
  13. ASP.Net Web API 的参数绑定[翻译]
  14. java提前多久显示,Java当前日期/时间比原始时间提前1小时显示
  15. 《区块链技术指南》电子书推荐!
  16. Datalogic得利捷发布IMPACT 2D机器人引导URCap插件
  17. 2022版首发,阿里Java开发手册(黄山版).PDF
  18. react基础之--样式设置
  19. 每日10行代码82:网上购物活动满减凑单计算器
  20. 线上AI僚机,告诉你对方喜好,手把手教你如何正确约会

热门文章

  1. knockoutJS学习指南
  2. 精心整理Webpack7分钟极速回忆录
  3. Magisk Delta工具安装教程
  4. 《世界上最伟大的推销员》 里的十张羊皮卷
  5. 微信公众号开发相关功能
  6. java List集合去重保持原顺序
  7. 来自:www.hoopchina.com 作者:儿童节 《雄心一万丈》
  8. 附代码 | OpenCV实现银行卡号识别,字符识别算法你知多少?
  9. 了解OLED显示屏的工作原理
  10. 选择恐惧症的福音之轮盘小程序展示