mediacontroller

How to use a Seekbar in android as a seekBar as well as a progressBar simultaneously?

*爱你&永不变心* 提交于 2019-11-30 18:36:32
I intend to write a custom media controller for my app. I was planning to use seekbar to do both seeking and showing progress. Trying to implement this. Does anyone have such implementation or am I on the wrong path ? Finally I figured it out!! The solution that I came up with was something like this : First of all set the max progress for seekbar as the duration of the video videoView.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { seekBar.setMax(videoView.getDuration()); seekBar.postDelayed(onEverySecond, 1000); } }); This runnable will

Using MediaController on Android 5

安稳与你 提交于 2019-11-30 15:37:35
I want to use the new MediaController in Android 5 instead of the old RemoteController for getting the currently playing track and changing the track. I couldn't find any examples so I tried it by myself. To get the current MediaController , I have implemented a Class which extends MediaController.Callback and implements MediaSessionManager.OnActiveSessionsChangedListener . With this method I try to get the current mediaController : @Override public void onActiveSessionsChanged(List<MediaController> mediaControllers) { Log.i(Util.LOG_TAG, "sessions changed"); if (mediaControllers != null &&

Video not playing in Android

不羁岁月 提交于 2019-11-30 07:22:33
Video not working properly in the below mentioned code. What could be the problem for this? MediaController mediaController = new MediaController(getBaseContext()); mediaController.setAnchorView(videoweb); Uri video = Uri.parse("http://www.youtube.com/v/wwI2w2YHkCQ?fs=1"); videoweb.setMediaController(mediaController); videoweb.setVideoURI(video); videoweb.start(); Error: Cannot play video Sorry,this video cannot be played. Karthik The link you have provided, http://www.youtube.com/v/wwI2w2YHkCQ?fs=1 , is for an HTML page. The URI to be provided for setVideoURI() should be a media file such as

How to use a Seekbar in android as a seekBar as well as a progressBar simultaneously?

一个人想着一个人 提交于 2019-11-30 02:51:28
问题 I intend to write a custom media controller for my app. I was planning to use seekbar to do both seeking and showing progress. Trying to implement this. Does anyone have such implementation or am I on the wrong path ? 回答1: Finally I figured it out!! The solution that I came up with was something like this : First of all set the max progress for seekbar as the duration of the video videoView.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) {

ExoPlayer and start / pause / seekTo commands

只愿长相守 提交于 2019-11-30 01:26:04
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... but I don't think I should have to do that between every pause and play. I am using my own controls and

Android 4.1 - RTSP using VideoView and MediaController

蹲街弑〆低调 提交于 2019-11-29 12:35:06
问题 Developing a simple app to play a RTSP stream on Android 4.1, but unable to do so Update I am able Able to play if I use BigBuckBunny_115k.mov Uri video = Uri.parse("rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"); BUT I tried with lot of RTSP streams mentioned here and here, but none worked :( ****Problem: I could not see any stream on my phone, only black screen is visible.. After some time, a dialog box appears "Can't play this video". I tried with many RTSP streams, but same result,

Video not playing in Android

大兔子大兔子 提交于 2019-11-29 09:32:34
问题 Video not working properly in the below mentioned code. What could be the problem for this? MediaController mediaController = new MediaController(getBaseContext()); mediaController.setAnchorView(videoweb); Uri video = Uri.parse("http://www.youtube.com/v/wwI2w2YHkCQ?fs=1"); videoweb.setMediaController(mediaController); videoweb.setVideoURI(video); videoweb.start(); Error: Cannot play video Sorry,this video cannot be played. 回答1: The link you have provided, http://www.youtube.com/v/wwI2w2YHkCQ

Android: How to use mediaController in service class?

橙三吉。 提交于 2019-11-29 08:20:21
I have a app that plays radio via MediaPlayer as a service. Is it possible to use MediaController in Service class? The problem is that I can use findViewById. I try to get my LinearLayout in onPrepeared methiod ... public class RadioPlayer extends Service implements OnPreparedListener, MediaController.MediaPlayerControl { @Override public void onCreate() { super.onCreate(); mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setOnPreparedListener(this); mediaController = new MediaController(this, false); mediaPlayer.setDataSource(url);

Custom UI on exoplayer sample

蓝咒 提交于 2019-11-29 02:26:52
** I really need help if you don't know anything don't give me a negative point :| if something bother you comment** I want to write custom UI for my player in Exoplayer(change button of pause play or add new buttons like player speed next and etc) . I use Exoplayer sample from github and before add code to my original project, I want to test the custom UI on official sample. I read pages in Stackoverflow and tuts+ about custom UI but I really confused! why change some buttons image or change their place must be so difficult :) how i can handle this? EDIT this is the sample https://github.com

Android MediaController intercepts all other touch events

…衆ロ難τιáo~ 提交于 2019-11-28 13:28:43
The top half of my app has a VideoView with a MediaController under it. The bottom half is an image with some buttons. While the MediaController is visible, the buttons below are not clickable. It's like while the MediaController is visible, it intercepts all other touch events, even if they are not within the bounds of the MediaController . Any idea around that? Ivan Bartsov You can check out my answer on overriding dispatchTouchEvent() to pass clicks through MediaController to an underlying Button , but I'm guessing there's something wrong with the way you use MediaController. Can you post