exoplayer

Overlapping GLSurfaceView on SurfaceView and vice versa

浪子不回头ぞ 提交于 2020-06-01 05:31:05
问题 ExoPlayer - SurfaceView Camera2 + MediaCodec - GLSurfaceView I am using the above view groups for playing video and camera recording. UI-1: Exo-Surf at the center and Cam-GLS in the top right corner. UI-2: Cam-GLS at the center and Exo-Surf in the top right corner. To achieve this I am using setZOrderOnTop to set z-index, as both are inside RelativeLayout. (exoPlayerView.videoSurfaceView as? SurfaceView)?.setZOrderOnTop(true/false) It seems working fine on Samsung S9+ with API 29 - Android 10

How to pause/resume video in Exoplayer?

最后都变了- 提交于 2020-05-13 13:58:42
问题 I am using Exoplayer for playing video Code For Playing Video private PlayerView videoView; SimpleExoPlayer player; videoView = findViewById(R.id.video_view); player = ExoPlayerFactory.newSimpleInstance(this, new DefaultTrackSelector()); videoView.setPlayer(player); player.prepare(buildMediaSource(Uri.parse(_videoUrl))); player.setPlayWhenReady(true); videoView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { //i want to pause video

Recording of RTMP stream

一世执手 提交于 2020-04-18 06:55:59
问题 I have a class, which watching rtmp stream with help of ExoPLayer: player = ExoPlayerFactory.newSimpleInstance(context) val rtmpDataSourceFactory = RtmpDataSourceFactory() val videoSource = ProgressiveMediaSource.Factory(rtmpDataSourceFactory) .createMediaSource(Uri.parse(streamURL)) player.prepare(videoSource) player.setVideoTextureView(playerView) player.playWhenReady = true playerView is TextureView, picked instead of SurfaceView, because i also need to take screenshots from stream. As far

Recording of RTMP stream

白昼怎懂夜的黑 提交于 2020-04-18 06:55:21
问题 I have a class, which watching rtmp stream with help of ExoPLayer: player = ExoPlayerFactory.newSimpleInstance(context) val rtmpDataSourceFactory = RtmpDataSourceFactory() val videoSource = ProgressiveMediaSource.Factory(rtmpDataSourceFactory) .createMediaSource(Uri.parse(streamURL)) player.prepare(videoSource) player.setVideoTextureView(playerView) player.playWhenReady = true playerView is TextureView, picked instead of SurfaceView, because i also need to take screenshots from stream. As far

How to implement Exoplayer 2.11.1 in android?

六眼飞鱼酱① 提交于 2020-04-11 02:16:08
问题 i am trying to implement exoplayer this is my exoplayer version implementation 'com.google.android.exoplayer:exoplayer:2.11.1' i am creating a music player app and i don't know anything about exoplayer i am trying to implement exoplayer from last 2 days but it's not working. i couldn't understand anything in the official documentation . i find many example and tutorial but it's all about playing video using exoplayer . many example's are using deprecated methods. I am trying to implement

几个不错的Android开源音视频播放器

Deadly 提交于 2020-03-24 10:56:54
3 月,跳不动了?>>> 原文链接: https://blog.csdn.net/u012246458/article/details/83620456 需求: 搜集到的github常用的视频和音频播放器,其中前三个是比较常用的播放器。 第四个和第五个是比较直白的用法。 1.ijkplayer 项目地址: https://github.com/Bilibili/ijkplayer 介绍:Ijkplayer 是Bilibili发布的基于 FFplay 的轻量级 Android/iOS 视频播放器。实现了跨平台功能,API 易于集成;编译配置可裁剪,方便控制安装包大小;支持硬件加速解码,更加省电;提供 Android 平台下应用弹幕集成的解决方案。 2.ExoPlayer 项目地址:https://github.com/google/ExoPlayer 介绍:ExpPlayer是一个开源的,App等级的媒体API,它的开源项目包含了library和示例:ExoPlayer library - 这部分是核心的库 Demo app - 这部分是演示怎么使用ExoPlayer的Demo 3.android-UniversalMusicPlayer 项目地址:https://github.com/googlesamples/android-UniversalMusicPlayer

How to auto start a video using exoplayer?

一个人想着一个人 提交于 2020-03-20 03:55:10
问题 I have a video loaded in a com.google.android.exoplayer2.ui.SimpleExoPlayerView view but I want to make it automatically start when the view loads. Right now, the user has to click the play button. 回答1: SimpleExoPlayer works well with a SurfaceView, there are methods to set the surface of the player. This is how I create the SimpleExoPlayer: /** Create a default TrackSelector **/ TrackSelector trackSelector = new DefaultTrackSelector(new Handler()); /** Create a default LoadControl **/

Trying to play an RTMP stream using ExoPlayer

丶灬走出姿态 提交于 2020-03-05 04:23:20
问题 I have this code: SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(this); PlayerView playerView = findViewById(R.id.simple_player); playerView.setPlayer(player); RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory(); MediaSource videoSource = new ProgressiveMediaSource.Factory(rtmpDataSourceFactory) .createMediaSource(Uri.parse("https://player.cdnmedia.tv/embed/a77aa67c")); player.prepare(videoSource); player.setPlayWhenReady(true); This is my graddle file:

ExoPlayer and start / pause / seekTo commands

此生再无相见时 提交于 2020-01-28 18:12:30
问题 I am trying to use ExoPlayer , as opposed to MediaPlayer and I can't seem to figure it out... MediaPlayer has .start() / .pause() commands... and I can just seekTo(1287) and it automatically starts playing... How do I do this with ExoPlayer ? I have tried to do seekTo(1287) but it doesn't start playing after... I have also added .setPlayWhenReady(true) after that, and still no luck... I am able to .stop() ... but I can't get it to start playing again after that unless I .prepare() again...

E/ExoPlayerImplInternal: Source error com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404

六月ゝ 毕业季﹏ 提交于 2020-01-24 00:11:25
问题 I am trying the play the video by the exo Player, but it gives me this error:- E/ExoPlayerImplInternal: Source error. InvalidResponseCodeException: Response code: 404 This is my Activity Class :- public class VideoActivity extends AppCompatActivity implements VideoRendererEventListener { private String mVideoUrl; private SimpleExoPlayerView simpleExoPlayerView; private SimpleExoPlayer player; private static final String TAG = "AMAN"; @Override protected void onCreate(Bundle savedInstanceState