All Projects → yusufcakmak → Exoplayersample

yusufcakmak / Exoplayersample

Licence: apache-2.0
This project is developed with ExoPlayer 2. You can play audio files and play video files with custom playback controls.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Exoplayersample

BakingApp
Udacity Android Developer Nanodegree, project 2.
Stars: ✭ 54 (-81.94%)
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 (-86.96%)
Mutual labels:  exoplayer
RtmpPlayer
RTMP player on Android
Stars: ✭ 28 (-90.64%)
Mutual labels:  exoplayer
NSMPlayer-Android
No description or website provided.
Stars: ✭ 18 (-93.98%)
Mutual labels:  exoplayer
VideoMetadataProvider
Video metadata provider library (collect metadata from ExoPlayer, FFMpeg, Native Android)
Stars: ✭ 20 (-93.31%)
Mutual labels:  exoplayer
videopager
An app showing how to make an Instagram/YouTube Shorts/TikTok style video pager
Stars: ✭ 60 (-79.93%)
Mutual labels:  exoplayer
media
Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Stars: ✭ 294 (-1.67%)
Mutual labels:  exoplayer
Exovideoview
a simple video view for exoplayer
Stars: ✭ 263 (-12.04%)
Mutual labels:  exoplayer
Bilibili-MusicPlayer
B站音乐区音频第三方播放器 (Bilibili Third-party online music player for Android) MVVM+Room+LiveData+Retrofit+Exoplayer
Stars: ✭ 19 (-93.65%)
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.98%)
Mutual labels:  exoplayer
DoubleTapPlayerView
YouTube's Fast-Forward-Rewind double tapping feature built on top of ExoPlayer
Stars: ✭ 81 (-72.91%)
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 (-92.64%)
Mutual labels:  exoplayer
QuicPlayer
media player using QUIC protocol
Stars: ✭ 17 (-94.31%)
Mutual labels:  exoplayer
podcast-app
Podcast App
Stars: ✭ 291 (-2.68%)
Mutual labels:  exoplayer
KingPlayer
🎬 一个专注于 Android 视频播放器的基础库,无缝切换内核。(IjkPlayer、ExoPlayer、VlcPlayer、MediaPlayer)
Stars: ✭ 35 (-88.29%)
Mutual labels:  exoplayer
flutter playout
AV Playout in Flutter
Stars: ✭ 129 (-56.86%)
Mutual labels:  exoplayer
MQPlayer
Android video player based on FFmpeg and Exoplayer
Stars: ✭ 20 (-93.31%)
Mutual labels:  exoplayer
Gsyvideoplayer
视频播放器(IJKplayer、ExoPlayer、MediaPlayer),HTTPS,支持弹幕,外挂字幕,支持滤镜、水印、gif截图,片头广告、中间广告,多个同时播放,支持基本的拖动,声音、亮度调节,支持边播边缓存,支持视频自带rotation的旋转(90,270之类),重力旋转与手动旋转的同步支持,支持列表播放 ,列表全屏动画,视频加载速度,列表小窗口支持拖动,动画效果,调整比例,多分辨率切换,支持切换播放器,进度条小窗口预览,列表切换详情页面无缝播放,rtsp、concat、mpeg。
Stars: ✭ 16,948 (+5568.23%)
Mutual labels:  exoplayer
Playerbase
The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
Stars: ✭ 2,814 (+841.14%)
Mutual labels:  exoplayer
CarouselGifViewer
Efficiently display a list of GIFs in a carousel (RecyclerView).
Stars: ✭ 33 (-88.96%)
Mutual labels:  exoplayer

ExoPlayer2 Sample Project

This repo updated for r2.10.4 version.

You can play videos and musics with ExoPlayer. This demo shows you how to use ExoPlayer. You can play mp3s or radio stream links with RadioActivity.

I wrote a article about ExoPlayer.

https://medium.com/@yusufcakmak/android-exoplayer-starters-guide-6350433f256c

I changed playback controls for custom ui demo. If you want to use default controls, you can delete exoplayer layout files. You can find more details under Custom UI heading.

Playing Audio

  player = ExoPlayerFactory.newSimpleInstance(this)

  dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "exoPlayerSample"))

  mediaSource = ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(RADIO_URL))

  player.prepare(mediaSource)
        
  player.playWhenReady = true
  

You can play and pause audio with this method setPlayWhenReady(boolean);

play audio

player.setPlayWhenReady(true);

pause audio

player.setPlayWhenReady(false);

Playing Video

We need to SimpleExoPlayerView for playing videos.

        player = ExoPlayerFactory.newSimpleInstance(this)

        mediaDataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "mediaPlayerSample"))

        val mediaSource = ProgressiveMediaSource.Factory(mediaDataSourceFactory)
                .createMediaSource(Uri.parse(STREAM_URL))


        with(player) {
            prepare(mediaSource, false, false)
            playWhenReady = true
        }


        playerView.setShutterBackgroundColor(Color.TRANSPARENT)
        playerView.player = player
        playerView.requestFocus()

If you use hls or dash formats, you need to use HlsMediaSource as a MediaSource.

For hls

MediaSource mediaSource = new HlsMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"),
                mediaDataSourceFactory, mainHandler, null);
player.prepare(mediaSource);

For dash

MediaSource mediaSource = new DashMediaSource(uri, buildDataSourceFactory(false),
            new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, null);
player.prepare(mediaSource);

License

Copyright 2017 Yusuf Çakmak.

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].