NOTE:this project is no longer update please using improved GiraffePlayer2 ,for flutter please visit GPlayer
out of the box android video player base on ijkplayer
note: if the player can't play your video,try download full-featured so which support more codec/format (bigger binary size) to replace ijkplayer-java/src/main/jniLibs
(I have try to push a new branch to github but failed)
CENTER_INSIDE
.等比缩放,画面填满view。CENTER_CROP
.等比缩放,直到画面宽高都等于或小于view的宽高。giraffeplayer
the player default support 6 CPU architecture:ARMv5, ARMv7, ARMv8,x86 and 86_64,if your project need't support all of the architectures,you can remove the folder in ijkplayer-java/src/main/jniLibs
to generate a light APK.
read this first:How to use 32-bit native libaries on 64-bit Android device,What you should know about .so files,关于Android的.so文件你所需要知道的
just callGiraffePlayerActivity.configPlayer(activity).play(url)
,all is done.
<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
play
GiraffePlayer player = new GiraffePlayer(activity);
player.play(url);
play(url)
//play videostop()
//stop playpause()
start()
forward()
// forward or back,example: forward(0.1f) forward(-0.1f)getCurrentPosition()
setScaleType(GiraffePlayer.SCALETYPE_FITPARENT)
//set video scale typetoggleAspectRatio()
// toggle video scale typeseekTo(...)
//seek to specify positiongetDuration()
//get video durationonInfo(...)
//callback when have some informationonError(...)
//callback when an error occurredonComplete(...)
//callback when the play is overonControlPanelVisibilityChange(...)
//callback when control panel visibility change