All Projects → maiwenchang → Artplayer

maiwenchang / Artplayer

Licence: apache-2.0
Kotlin实现的视频播放器,将MediaPlayer与VideoView解耦合,支持切换播放器内核(如ExoPlayer和ijkPlayer),支持自定义控制视图,提供MediaPlayerManager实现全屏模式,小屏幕模式等。

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Artplayer

Media player
An flutter media player to make media streaming apps effortlessly! read getting started tutorial on https://medium.com/@tamhanekar.siddhesh95/integrate-media-player-into-your-flutter-application-23040213f0c9
Stars: ✭ 45 (-90.45%)
Mutual labels:  video-player, media-player
Glide
Linux/macOS media player based on GStreamer and GTK+
Stars: ✭ 123 (-73.89%)
Mutual labels:  video-player, media-player
Streama
Self hosted streaming media server. https://docs.streama-project.com/
Stars: ✭ 8,948 (+1799.79%)
Mutual labels:  video-player, media-player
Playerdemo
一个视频播放器,开源版 potplayer ,用于总结播放器开发技术。
Stars: ✭ 491 (+4.25%)
Mutual labels:  video-player, media-player
react-native-vlc-media-player
React native media player for video streaming and playing. Supports RTSP, RTMP and other protocols supported by VLC player
Stars: ✭ 221 (-53.08%)
Mutual labels:  video-player, media-player
Mpv.net
🎞 mpv.net is a modern media player for Windows that works just like mpv.
Stars: ✭ 737 (+56.48%)
Mutual labels:  video-player, media-player
Clapper
A GNOME media player built using GJS with GTK4 toolkit and powered by GStreamer with OpenGL rendering.
Stars: ✭ 103 (-78.13%)
Mutual labels:  video-player, media-player
Celluloid
A simple GTK+ frontend for mpv
Stars: ✭ 541 (+14.86%)
Mutual labels:  video-player, media-player
Libvlc Go
Go bindings for libVLC and high-level media player interface
Stars: ✭ 188 (-60.08%)
Mutual labels:  video-player, media-player
Nicevieoplayer
IjkPlayer/MediaPlayer+TextureView,支持列表,完美切换全屏、小窗口的Android视频播放器
Stars: ✭ 2,114 (+348.83%)
Mutual labels:  video-player, media-player
Avideo
Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
Stars: ✭ 1,329 (+182.17%)
Mutual labels:  video-player, media-player
kaltura-player-js
Kaltura Player JS Platform - Cloud TV and OVP Media Players
Stars: ✭ 83 (-82.38%)
Mutual labels:  video-player, media-player
Glow
mpv Config File Generator for Windows
Stars: ✭ 167 (-64.54%)
Mutual labels:  video-player, media-player
Flyleaf
Media Player .NET Library for WPF/WinForms (based on FFmpeg/DirectX)
Stars: ✭ 323 (-31.42%)
Mutual labels:  video-player, media-player
Mpv Easy Player
MPV-EASY Player - A movie player based on mpv
Stars: ✭ 324 (-31.21%)
Mutual labels:  video-player, media-player
Easyplayer
An elegant, simple, fast RTSP/RTMP/HLS/HTTP Player.EasyPlayer support RTSP(RTP over TCP/UDP)version& RTMP version & Pro version,cover all kinds of streaming media!EasyPlayer是一款精炼、高效、稳定的流媒体播放器,分为RTSP版、RTMP版和Pro版本,支持各种各样的流媒体音视频播放!
Stars: ✭ 358 (-23.99%)
Mutual labels:  media-player
Android Openslmediaplayer
Re-implementation of Android's MediaPlayer and audio effect classes based on OpenSL ES APIs.
Stars: ✭ 393 (-16.56%)
Mutual labels:  media-player
Parsingplayer
A video player playing videos from youku.com and other video sites.
Stars: ✭ 359 (-23.78%)
Mutual labels:  video-player
Movie Monad
📺 A free and simple to use video player made with Haskell.
Stars: ✭ 347 (-26.33%)
Mutual labels:  video-player
Mediaplayer Extended
Android MediaPlayer API-compatible media player library with exact seek and DASH support
Stars: ✭ 406 (-13.8%)
Mutual labels:  media-player

English | 简体中文

ArtPlayer

GitHub top language Hex.pm API GitHub release (latest by date)

简介

Kotlin实现的视频播放器,将MediaPlayer与VideoView解耦合,支持切换播放器内核(如ExoPlayer和ijkPlayer),支持自定义控制视图,提供MediaPlayerManager实现全屏模式,小屏幕模式等。

查看详细文档

特点

  • ijkPlayer支持
  • ExoPlayer支持
  • 全屏,小屏播放
  • 完全自定义UI
  • 静音
  • 循环播放
  • 倍速播放(IjkPlayer支持)
  • 多播放器同时播放
  • Raw/Assets,本地视频文件播放支持
  • Activity生命周期感知,实现了onPause暂停播放,onDestory停止播放并释放资源
  • 手势操作支持(小窗:单指拖动,双指缩放;全屏:音量,亮度,快进)
  • 重力感应支持

开始使用

核心依赖

implementation 'org.salient.artvideoplayer:artplayer-core:1.1.0'

选择使用ExoPlayer

implementation "org.salient.artvideoplayer:artplayer-exo:1.1.0"

选择使用IjkPlayer

implementation 'org.salient.artvideoplayer:artplayer-ijk:1.1.0'
implementation "org.salient.artvideoplayer:artplayer-armv7a:1.1.0"

需要支持不同的cpu架构

implementation "org.salient.artvideoplayer:artplayer-armv5:1.1.0"
implementation "org.salient.artvideoplayer:artplayer-x86:1.1.0"
//下面两个需要minSdk version >= 21
implementation "org.salient.artvideoplayer:artplayer-arm64:1.1.0"
implementation "org.salient.artvideoplayer:artplayer-x86_64:1.1.0"

使用方法

kotlin

import org.salient.artplayer.VideoView

val 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

<org.salient.artplayer.VideoView
	android:id="@+id/video_view"
	android:layout_width="match_parent"
	android:layout_height="200dp"/>

AndroidManifest.xml

<activity
    android:name=".YourActivity"
    android:configChanges="orientation|screenSize" /> <!-- required -->

Activity

//拦截全屏时的返回事件
override fun onBackPressed() {
    if (MediaPlayerManager.blockBackPress(this)) {
        return
    }
    super.onBackPressed()
}

设置封面

//绑定封面图片资源到VideoView的`cover`字段
Glide.with(context)
        .load("http://img5.mtime.cn/mg/2018/07/06/093947.51483272.jpg")
        .into(videoView.cover);

支持

构建环境

  • Kotlin 1.37.2
  • Java 1.8
  • Android Studio 3.6.0
  • Gradle 5.6.4
  • IjkPlayer 0.8.8
  • ExoPlayer 2.11.3

作者

联系方式

License

   Copyright 2018 maiwenchang
   Licensed 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 at
       http://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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].