Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maiwenchang/ArtPlayer
Kotlin实现的视频播放器,将MediaPlayer与VideoView解耦合,支持切换播放器内核(如ExoPlayer和ijkPlayer),支持自定义控制视图,提供MediaPlayerManager实现全屏模式,小屏幕模式等。
https://github.com/maiwenchang/ArtPlayer
android kotlin media-player video-player videoview
Last synced: about 2 months ago
JSON representation
Kotlin实现的视频播放器,将MediaPlayer与VideoView解耦合,支持切换播放器内核(如ExoPlayer和ijkPlayer),支持自定义控制视图,提供MediaPlayerManager实现全屏模式,小屏幕模式等。
- Host: GitHub
- URL: https://github.com/maiwenchang/ArtPlayer
- Owner: maiwenchang
- License: apache-2.0
- Created: 2018-07-13T05:40:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-16T07:52:38.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T20:37:19.999Z (5 months ago)
- Topics: android, kotlin, media-player, video-player, videoview
- Language: Kotlin
- Homepage: https://maiwenchang.github.io/ArtPlayer/
- Size: 178 MB
- Stars: 589
- Watchers: 15
- Forks: 101
- Open Issues: 5
-
Metadata Files:
- Readme: README.English.md
- License: LICENSE
Awesome Lists containing this project
README
English | [简体中文](https://github.com/maiwenchang/ArtVideoPlayer/blob/master/README.md)
# ArtPlayer![GitHub top language](https://img.shields.io/github/languages/top/maiwenchang/artPlayer)
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/maiwenchang/ArtVideoPlayer/blob/master/LICENSE)
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/maiwenchang/ArtPlayer?color=g)### Introduction
This is a flexible video player. MediaPlayer is completely separate from VideoView and can be replaced with other player kernels such as ExoPlayer and ijkPlayer. Developers can fully customize the player view, which we call the control panel. In addition, developers can use MediaPlayerManager to control playback behaviours, such as full-screen mode, small screen mode, and smart matching modes in RecyclerView.
[Full Wiki of ArtPlayer](https://github.com/maiwenchang/ArtPlayer/wiki)
### Features
- Fullscreen,TinyWindow play
- Support for playing in RecyclerView
- Custom UI
- Global playback in APP
- Mute
- Loop Playback
- Gesture manipulation (small window: single finger drag, double finger zoom; full screen: volume, brightness, fast forward)
- ijkPlayer support
- ExoPlayer support
- Gravity sensor support
- Raw/Assets, and local playback support### Getting started
basic dependency
```
implementation 'org.salient.artvideoplayer:artplayer-core:1.1.0'
```using ExoPlayer
```
implementation "org.salient.artvideoplayer:artplayer-exo:1.1.0"
```using IjkPlayer
```
implementation 'org.salient.artvideoplayer:artplayer-ijk:1.1.0'
implementation "org.salient.artvideoplayer:artplayer-armv7a:1.1.0"
```support different cpu architecture
```
implementation "org.salient.artvideoplayer:artplayer-armv5:1.1.0"
implementation "org.salient.artvideoplayer:artplayer-x86:1.1.0"
//required minSdk version >= 21
implementation "org.salient.artvideoplayer:artplayer-arm64:1.1.0"
implementation "org.salient.artvideoplayer:artplayer-x86_64:1.1.0"
```### 使用方法
kotlin
``` kotlin
import org.salient.artplayer.VideoViewval videoView = VideoView(context)
videoView.mediaPlayer = SystemMediaPlayer().apply{
setDataSource(context, Uri.parse("http://vfx.mtime.cn/Video/2018/07/06/mp4/180706094003288023.mp4"))
}
videoView.prepare()
```xml
``` xml```
`AndroidManifest.xml`
``` xml
```Activity
``` kotlin
// block the backpress event of the fullscreen playback
override fun onBackPressed() {
if (MediaPlayerManager.blockBackPress(this)) {
return
}
super.onBackPressed()
}
```setup cover
``` java
//If using the ControlPanel,we can get the ImageView of the cover by `findViewById()` method
//of the ControlPanel which extends FrameLayout:
Glide.with(context)
.load("http://img5.mtime.cn/mg/2018/07/06/093947.51483272.jpg")
.into(videoView.cover);
```### Support
- Public technical discussion on github is preferred.[Technical problems](https://github.com/maiwenchang/ArtPlayer/issues)
- [Wiki](https://github.com/maiwenchang/ArtPlayer/wiki)### My Build Environment
- Java 1.8
- Android Studio 3.6.0
- Gradle 5.6.4
- IjkPlayer 0.8.8
- ExoPlayer 2.11.3### Authors
- [maiwenchang](https://github.com/maiwenchang)
- [ironman6121](https://github.com/ironman6121)### Contact
- [email protected]### License
```
Copyright 2018 maiwenchangLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```