All Projects → JarvanMo → Exovideoview

JarvanMo / Exovideoview

Licence: apache-2.0
a simple video view for exoplayer

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Exovideoview

media
Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Stars: ✭ 294 (+11.79%)
Mutual labels:  exoplayer
VideoMetadataProvider
Video metadata provider library (collect metadata from ExoPlayer, FFMpeg, Native Android)
Stars: ✭ 20 (-92.4%)
Mutual labels:  exoplayer
CarouselGifViewer
Efficiently display a list of GIFs in a carousel (RecyclerView).
Stars: ✭ 33 (-87.45%)
Mutual labels:  exoplayer
BakingApp
Udacity Android Developer Nanodegree, project 2.
Stars: ✭ 54 (-79.47%)
Mutual labels:  exoplayer
cordova-plugin-playlist
🎶 A Cordova plugin for Android and iOS with native support for audio playlists, background support, and lock screen controls 🎶
Stars: ✭ 32 (-87.83%)
Mutual labels:  exoplayer
p2p-cdn-sdk-android
Free p2p cdn android github sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 39 (-85.17%)
Mutual labels:  exoplayer
CommenPlayer
CommenPlayer ——Video player, Support ijkPlayer, Vlc, MediaPlayer, ExoPlayer; 视频播放器,支持ijkPlayer,Vlc,MediaPlayer,ExoPlayer
Stars: ✭ 81 (-69.2%)
Mutual labels:  exoplayer
KingPlayer
🎬 一个专注于 Android 视频播放器的基础库,无缝切换内核。(IjkPlayer、ExoPlayer、VlcPlayer、MediaPlayer)
Stars: ✭ 35 (-86.69%)
Mutual labels:  exoplayer
kaltura-player-android
Kaltura Player is a rich, easy to integrate and easy to use video player for all media types and ad scenarios you need. - based on Google ExoPlayer
Stars: ✭ 22 (-91.63%)
Mutual labels:  exoplayer
QuicPlayer
media player using QUIC protocol
Stars: ✭ 17 (-93.54%)
Mutual labels:  exoplayer
podcast-app
Podcast App
Stars: ✭ 291 (+10.65%)
Mutual labels:  exoplayer
DoubleTapPlayerView
YouTube's Fast-Forward-Rewind double tapping feature built on top of ExoPlayer
Stars: ✭ 81 (-69.2%)
Mutual labels:  exoplayer
MQPlayer
Android video player based on FFmpeg and Exoplayer
Stars: ✭ 20 (-92.4%)
Mutual labels:  exoplayer
flutter playout
AV Playout in Flutter
Stars: ✭ 129 (-50.95%)
Mutual labels:  exoplayer
BakingApp
🍛🍴 This app allows a user to select a recipe and see video-guided steps for how to complete it, showcasing MVVM, Retrofit, ExoPlayer with lifecycle components, Master/Detail Flow, Widgets.
Stars: ✭ 18 (-93.16%)
Mutual labels:  exoplayer
ARVI
Android library designed to simplify the implementation of the video autoplay in the RecyclerView
Stars: ✭ 69 (-73.76%)
Mutual labels:  exoplayer
Bilibili-MusicPlayer
B站音乐区音频第三方播放器 (Bilibili Third-party online music player for Android) MVVM+Room+LiveData+Retrofit+Exoplayer
Stars: ✭ 19 (-92.78%)
Mutual labels:  exoplayer
Playerbase
The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
Stars: ✭ 2,814 (+969.96%)
Mutual labels:  exoplayer
RtmpPlayer
RTMP player on Android
Stars: ✭ 28 (-89.35%)
Mutual labels:  exoplayer
videopager
An app showing how to make an Instagram/YouTube Shorts/TikTok style video pager
Stars: ✭ 60 (-77.19%)
Mutual labels:  exoplayer

logo

ExoVideoView

ExoVideoView is based on ExoPlayer.

中文移步至此.

demo

Planning new versions

What's in ExoVideoView

1.Process AudioFocus automatically.
2.Process its orientation by sensor automatically
3.simple gesture action supported.
4.multiple video quality supported
5.you can add custom views to the default controller.
6.multiple resize-mode supported
7.custom controller supported.
8.change the widget's visibility if you like.

Using ExoVideoView

1.Dependency

The easiest way to get started using ExoVideoView is to add it as a gradle dependency. You need to make sure you have the jitpack repositories included in the build.gradle file in the root of your project:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Next add a gradle compile dependency to the build.gradle file of your app module:

implementation 'com.github.JarvanMo:ExoVideoView:2.1.6'

2.In Layout

Declare ExoVideoView in your layout file as :

<com.jarvanmo.exoplayerview.ui.ExoVideoView
     android:id="@+id/videoView"
     android:layout_width="match_parent"
     android:layout_height="300dp"/>

3.In Java

ExoVideoView provides built-in Player for convenience,so we can play a video as

SimpleMediaSource mediaSource = new SimpleMediaSource(url);//uri also supported
videoView.play(mediaSource);
videoView.play(mediaSource,where);//play from a particular position

Passing a player outside to ExoVideoView:

videoView.setPlayer(player);

Note:never forget to release ExoPlayer:

videoView.releasePlayer();

see details in demo.

3.Orientation Management

The ExoVideoView can handle its orientation by sensor automatically only when ExoVideoVIew has a not-null OrientationListener :

    videoView.setOrientationListener(orientation -> {
            if (orientation == SENSOR_PORTRAIT) {
                //do something
            } else if (orientation == SENSOR_LANDSCAPE) {
                //do something
            }
        });

NOTE:When the ExoVideoView handle its orientation automatically,The ExoVideoView will call activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) or activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); if the context in controller is an Activity. The fullscreen management is the same as orientation management.

4.Back Events

First,override onKeyDown:

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK) {
            return videoView.onKeyDown(keyCode, event);
        }
        return super.onKeyDown(keyCode, event);
    }

Then passing a backListener to ExoVideoView:

    videoView.setBackListener((view, isPortrait) -> {
            if (isPortrait) {
              //do something
            }
            return false;
        });

If return value is true, operation will be interrupted.Otherwise,ExoVideoView handle its orientation by itself and OrientationLister.onOrientationChange() will be caled.

Advance

1.Multi-Quality

ExoVideoView also provides a built-in multi-quality selector.The multi-quality selector will be added to overlayFrameLayout if multi-quality is enabled and ExoMediaSource are given different qualities in current version.

        List<ExoMediaSource.Quality> qualities = new ArrayList<>();
        ExoMediaSource.Quality quality =new SimpleQuality(quality,mediaSource.url());
        qualities.add(quality);
        mediaSource.setQualities(qualities);

2.Controller Display Mode

ExoVideoPlaybackController are divided into four parts:

1.Top
2.Top Landscape
3.Bottom
4.Bottom Landscape

Each of them can be hidden or shown:

 app:controller_display_mode="all|none|top|top_landscape|bottom|bottom_landscape"

in java:

  videoView.setControllerDisplayMode(mode);

3.Add Custom View To Controller

Views can be added to ExoVideoPlaybackController in java.

  videoView.addCustomView(ExoVideoPlaybackControlView.CUSTOM_VIEW_TOP, view);
  videoView.addCustomView(ExoVideoPlaybackControlView.CUSTOM_VIEW_TOP_LANDSCAPE, view);
  videoView.addCustomView(ExoVideoPlaybackControlView.CUSTOM_VIEW_BOTTOM_LANDSCAPE, view);

4.Specifying A custom Layout File

Defining your own exo_video_playback_control_view.xml is useful to customize the layout of ExoVideoPlaybackControlView throughout your application. It's also possible to customize the layout for asingle instance in a layout file. This is achieved by setting the controller_layout_id attribute on a ExoVideoPlaybackControlView. This will cause the specified layout to be inflated instead of code exo_video_playback_control_view.xml for only the instance on which the attribute is set.

app:controller_layout_id="@layout/my_controller"

5.Change Visibility

Sometimes,we may not like the back buttons.So let's hide it:

videoView.changeWidgetVisibility(R.id.exo_player_controller_back,View.INVISIBLE);

For more widgets you can hide or show,see IDS_IN_CONTROLLER.

NOTE:This is a dangerous operation because I don't know what will happen to the UI.

Others

  app:controller_background="@android:color/holo_orange_dark"
  app:use_artwork="true"
  app:default_artwork="@drawable/default_art"
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].