android视频播放器源码

[复制链接]
Tag:

项目介绍:

基于ijkplayer封装的视频播放器。


How to usecase 1: only want to play a video fullscreen
just callGiraffePlayerActivity.configPlayer(activity).play(url),all is done.
case 2: embed a player in a layoutstep 1: include video layout in your layout xml file<include        
   layout="@layout/giraffe_player"        
   android:layout_width="match_parent"        
   android:layout_height="210dp"/>
notice:the giraffe player is match_parent default,if you want to specify height or width you can overwrite layout_width and layout_width in include tag
step 2: new player and call playGiraffePlayer player = new GiraffePlayer(activity);player.play(url);
API:
  • play(url) //play video
  • stop() //stop play
  • pause()
  • start()
  • forward() // forward or back,example: forward(0.1f) forward(-0.1f)
  • getCurrentPosition()
  • setScaleType(GiraffePlayer.SCALETYPE_FITPARENT) //set video scale type
  • toggleAspectRatio() // toggle video scale type
  • seekTo(...) //seek to specify position
  • getDuration() //get video duration
  • onInfo(...) //callback when have some information
  • onError(...) //callback when an error occurred
  • onComplete(...) //callback when the play is over
  • onControlPanelVisibilityChange(...) //callback when control panel visibility change





相关源码推荐:

我来说两句
所有评论(432)
rebecca 2017-12-27 10:31:05
楼主威武,以后多发干货,多办活动~!
回复
是个宝宝 2017-12-27 10:51:15
每次我都积极回帖的,想要安币~
回复
einnius2012 2017-12-27 11:06:55
安卓巴士是个不错的网站,我来顶个贴~
回复
设女郎 2017-12-27 11:12:45
感谢大神~
回复
snowqoo228 2017-12-27 11:30:35
不错不错,楼主辛苦了。。。
回复
apkbus热心网友 2017-12-27 11:33:08
淡定,淡定,淡定……
回复
yanghaiju2012 2017-12-27 11:34:05
支持楼主,支持安卓巴士!
回复
提取码:  下载次数:128 状态:已购或VIP 售价:15(原价:15)金钱 下载权限:初级码农 
7882 3 128
代码贡献英雄榜
用户名 下载数
联系我们
首页/微信公众账号投稿
帖子代码编辑/版权问题
QQ:435399051,1294855032
如何获得代码达人称号?
如何成为签约作者?
领先的中文移动开发者社区
18620764416
7*24全天服务
意见反馈:1294855032@qq.com

扫一扫关注我们

Powered by Discuz! X3.2© 2001-2019 Comsenz Inc.( 粤ICP备15117877号 )