[android-developers] MediaController

2013-08-10 Thread bob
Does anyone know why the MediaController class doesn't show up on the 
screen when I define it in an XML layout?

I saw this in the docs:

*The way to use this class is to instantiate it programatically.*

However, the docs seem to contradict themselves when they go on to say:

*Functions like show() and hide() have no effect when MediaController is 
created in an xml layout. *

That implies to me that it is okay to create it in an XML layout if you 
want a MediaController that is always visible.

Anyone know what the story is?

I've googled it and not found the answer.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] MediaController - seek bar

2013-04-18 Thread Larry Meadors
I have a audiobook player that saves it's position using a web service.

It has a periodic timer that saves every 30 seconds which works great, but
I'd like to also save immediately after the user moves the position using
the seek bar.

I'm using the built-in MediaController, but it doesn't seem to provide
anything except for the MediaPlayerControl interface.

That interface has a seekTo() method that tells the current position, but
it tells it as you're dragging, so it fires off a few dozen evens as you
drag it. I really don't care about any of those, just the last one.

Any smart people with a tip for me here? I have a couple of ideas, I'm just
not crazy about any of them...

Larry

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] MediaController not visible for VideoView in Dialog

2012-06-25 Thread Vance Turnewitsch
Hi,
I am displaying a VideoView in a custom Dialog I am creating. I am
attaching a MediaController to the VideoView, but the MediaController
won't show up when touching/clicking the screen or VideoView on a
device or in the emulator. Below is my code for creating the Dialog:

  private Dialog createFullScreenVideoDialog(final Bundle args){
//Create Layout...
FrameLayout holder = new FrameLayout(this);
holder.setId(holder.hashCode());
holder.setLayoutParams(new
ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

//Create video view
final VideoView video = new VideoView(this);
video.setId(video.hashCode());
FrameLayout.LayoutParams videoParams = null;
switch(getResources().getConfiguration().orientation){
case Configuration.ORIENTATION_LANDSCAPE:
  videoParams = new
FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.FILL_PARENT, Gravity.CENTER);
  break;
case Configuration.ORIENTATION_PORTRAIT:
  videoParams = new
FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT, Gravity.CENTER);
  break;
default: //If the orientation is ORIENTATION_SQUARE or
ORIENTATION_UNDEFINED
  //or some other value...
  videoParams = new
FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT, Gravity.CENTER);
}

holder.addView(video, videoParams);

final Dialog dia = new
Dialog(this,android.R.style.Theme_NoTitleBar_Fullscreen){
  public void onBackPressed(){
video.pause();
super.onBackPressed();
  }
};

dia.setContentView(holder);

dia.setOnShowListener(new OnShowListener() {

  @Override
  public void onShow(DialogInterface arg0) {
String path =
args.getString(ComponentConstants.VIDEOPLAYER_FULLSCREEN_PATHKEY);

MediaController controller = new
MediaController(dia.getContext());
video.setMediaController(controller);
if(path!=null){
  try {
video.setVideoURI(MediaUtil.getVideoPath(getActiveForm(),
path));
 
if(args.getBoolean(ComponentConstants.VIDEOPLAYER_FULLSCREEN_STATEKEY))
{
  video.start();
 
video.seekTo(args.getInt(ComponentConstants.VIDEOPLAYER_FULLSCREEN_CURRENTPOSITIONKEY));
}
  } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
  }
}
  }
});
return dia;
  }

The video is playing in the VideoView, but I can't see the
MediaController.

Any ideas?
Thanks,
Vance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaController working sample copy?

2012-03-05 Thread IS SOA
i did search on google devlopers site and they have mediaplayer code but i 
am looking for mediacontroller can anybody points me please?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] MediaController working sample copy?

2012-03-05 Thread TreKing
On Mon, Mar 5, 2012 at 8:31 PM, IS SOA isso...@gmail.com wrote:

 i did search on google devlopers site and they have mediaplayer code but i
 am looking for mediacontroller can anybody points me please?


http://lmgtfy.com/?q=android+mediacontroller+example

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] MediaController working sample copy?

2012-03-05 Thread IS SOA
 wow mate that exactly what i needed, a genius to help me out, thanks for 
 the advice mate but i already passed by that door ... 


On Monday, March 5, 2012 9:49:23 PM UTC-5, TreKing wrote:

 On Mon, Mar 5, 2012 at 8:31 PM, IS SOA   wrote:

 i did search on google devlopers site and they have mediaplayer code but 
 i am looking for mediacontroller can anybody points me please?


 http://lmgtfy.com/?q=android+mediacontroller+example


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago 
 transit tracking app for Android-powered devices

   

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] MediaController with MediaPlayer

2012-01-18 Thread Giuseppe
 I would like to show the mediacontroller for all the playing time of 
mediaplayer, please how to do it?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] MediaController VideoView

2011-07-07 Thread New Developer
Hi

I have a simple  layout.xml  with a

VideoView  
and
MediaController

Purpose being I want the media controller visible at all times

1) I call this layout using  Fragment   and thus inflate.inflater

2) I have to use a code generated  new MediaController(this)  and not the 
layout's one
Thus when I touch the VideoView the code generated MediaController  appears  
but never the layout's

3) When I use  mediacontroller.show(0);  or   mediacontroller.show(3); it 
rejects with a unsupportedbuttons NullPointerException

All of which are problems I have found in google searches but no solution, that 
works.

and ideas

Thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] MediaController VideoView

2011-07-07 Thread Mark Murphy
On Thu, Jul 7, 2011 at 7:42 PM, New Developer secur...@isscp.com wrote:
 I have a simple  layout.xml  with a

 VideoView  
 and
 MediaController

Quoting the MediaController documentation: The way to use this class
is to instantiate it programatically. You don't put it in a layout.

 Purpose being I want the media controller visible at all times

I am not aware that MediaController can be used that way, though you
can write your own -- it's not that tough.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] MediaController VideoView

2011-07-07 Thread New Developer
Thanks for the fast response

and yes I had read the programatic line
why then do you have it as an option to add to your own layout.xml ?  IF it 
can't be used this way ?
curious?


On Jul 7, 2011, at 7:49 PM, Mark Murphy wrote:

 On Thu, Jul 7, 2011 at 7:42 PM, New Developer secur...@isscp.com wrote:
 I have a simple  layout.xml  with a
 
 VideoView  
 and
 MediaController
 
 Quoting the MediaController documentation: The way to use this class
 is to instantiate it programatically. You don't put it in a layout.
 
 Purpose being I want the media controller visible at all times
 
 I am not aware that MediaController can be used that way, though you
 can write your own -- it's not that tough.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android Training...At Your Office: http://commonsware.com/training
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] MediaController VideoView

2011-07-07 Thread Mark Murphy
On Thu, Jul 7, 2011 at 8:13 PM, New Developer secur...@isscp.com wrote:
 Thanks for the fast response

 and yes I had read the programatic line
 why then do you have it as an option to add to your own layout.xml ?  IF it 
 can't be used this way ?
 curious?

They elected to implement it as a ViewGroup. Usually ViewGroups are
designed to be put in layouts, but there is no guarantee of that.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] mediaController in APIDemo

2010-10-06 Thread zohar lerman
Hi
I am using the code of APIDemo for streaming video.

I want to add control bar to the videoview.

I added the following code to the MediaPlayerDemo_Video.oncreate but
the control was not shown:

mPreview = (VideoView) findViewById(R.id.surface);
MediaController mediaController = new
MediaController(mPreview.getContext());
mediaController.setAnchorView(mPreview);
mediaController.setMediaPlayer(mPreview);
mPreview.setMediaController(mediaController);

any idea why?
thanks

Zohar

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaController questions + problems + strange behaviour

2010-07-02 Thread MarcoAndroid
Hi,

I've been starting to use the MediaController in combination with the
MediaPlayer. Besides finding out some documented weird behaviour (like
if you create a MediaController from XML the show()/hide() don't do
anything but they do work if you create the controller via code), I
did find some undocumented (AFAICT) buggy? behaviour. Here it goes:

1) Why is the mediacontroller too wide by default, that is when all
buttons are showing (which is the case when you create it from XML)?
See screenshot here: 
http://www.4shared.com/photo/ogbrAo4H/mediacontroller_toowide_2010-0.html
The | and | are cut off!
Even on a real Nexus One it's too wide, only in landscape it fits
(easily; it doesn't get stretched full width either)
If I add paddingLeft and right to the wrapping LinearLayout, the left
 right of the mediacontroller are just cut off.
If I add paddingLeft and right to the MediaController xml, the left 
right of the mediacontroller are also just cut off.
If I change the width of the MediaController view in the XML to 200dip
it just gets cut off.
Apparently the controller is not made resolution independent using
dips etc? Or can I do something to make it fit? For now I take out the
 and , the user can seek with the slider too...

2) Why is it called a floating window (at least in its
implementation), I can't seem to be able to move it around. Floating
is meant here only as: it is on top of something?

3) It seems you really need to wait a bit before calling
controller.show() because otherwise something is not ready yet (I get
something like window null - Activity not started error). Is this
true? Is there a better way to do it than postDelayed as mentioned in
this post: 
http://stackoverflow.com/questions/1759862/how-can-i-get-an-android-mediacontroller-to-appear-from-layout-xml?

4) It seems getBufferPercentage() only gets called when you press a
button on the control? I do see the mediaplayer's onBufferingUpdate()
getting called in the example below, but getBufferPercentage only when
I touch a button on the MediaController:

  controller.setMediaPlayer(new MediaController.MediaPlayerControl() {
public int getBufferPercentage() {
  return bufferedPercentage;
}
public int getCurrentPosition() {
  return mediaPlayer.getCurrentPosition();
}
public int getDuration() {
  return mediaPlayer.getDuration();
}
public boolean isPlaying() {return mediaPlayer.isPlaying();}
public void pause() {
  mediaPlayer.pause();
}
public void seekTo(int pos) {}
  public void start() {
  mediaPlayer.start();
}
  });

Any ideas why it's not being called? My workaround for now is to do a
controller.show() call in mediaPlayer.onBufferingUpdate().

5) This I found out by experience and seems to me incorrect in the
docs here: 
http://developer.android.com/reference/android/widget/MediaController.html
I read the bottom 3 statements as: no prev/next buttons are shown if
setPrevNextListeners() is not being called.
But when creating the controller via XML they are shown disabled,
though I'm sure not having called setPrevNextListeners().

6) In 1.6 the slider knob is showing correctly at starting and ending
point, see screenshot for starting point (note that the stream as been
loaded, but whether it's loaded or not has no impact):
http://www.4shared.com/photo/FeK1kxXT/mediacontroller_slider_sdk16_s.html
But in 2.1 the slider know is slightly hidden under something on the
left and something  on the right, see screenshots:
http://www.4shared.com/photo/UH5jHyMd/mediacontroller_slider_sdk21_b.html
http://www.4shared.com/photo/8chC5_Q5/mediacontroller_slider_sdk21_b.html
Seems a bug to me. Or can I do something about this?
BTW: the correct position in 2.1 seems to be about 4secs into the
track, see this screenshot:
http://www.4shared.com/photo/fbM-PNJ1/mediacontroller_slider_sdk21_o.html

7): Why is the downloading of an mp3 from the internet (via a URL)
starting all over again when I drag the slider all the way to the left
(i.e 0)? Seems not necessary, and will make the user have to wait
again for the download.

8) In 1.6 it was fine to call controller.setEnabled(true) before
controller.setMediaPlayer(), but definitely in 2.1 it is not allowed
anymore, you get a NullpointerException. If you check the
MediaController source code, you'll see it's calling a mediaPlayer
method w/o checking for null.

Hope somebody can provide some input on these!

Regards,
Marco






-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaController in MediaPlayer

2010-06-04 Thread Abhi
Hello,

I am using MediaPlayer to build a Video player for playing local video
files. However, I don't know how to enable MediaController for my
player. I want the media control buttons that pop up when you touch
the video surface.

Can anyone help me out please?

Thanks,

Abhi

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaController disappearing with warning and show(0)

2010-04-14 Thread michaely
Hello,

I am trying to stream some audio from an http server using a
MediaPlayer with MediaController . The audio file is mp3 with the size
of about 5Mb. I have opened the MediaController with show(0) to leave
it open indefinitely.

If I leave the audio to play without touching anything everything
works fine, but the instant I touch anywhere in the activity window
the MediaController disappears and throws the following warning in
LogCat and the audio continues to play.

04-14 02:30:56.749: WARN/InputManagerService(55): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@43cfef38

Note that if I touch the Notification bar this does not happen. It is
only when the activity window is touched. This happens in the emulator
as well as my Nexus One. Both running 2.1.

Here is a complete log starting from the call to play():

04-14 02:30:40.828: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:40.847: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:42.179: INFO/PlayerDriver(31): buffering (1)
04-14 02:30:44.796: DEBUG/AudioSink(31): bufferCount (4) is too small
and increased to 12
04-14 02:30:45.189: INFO/PlayerDriver(31): buffering (9)
04-14 02:30:45.572: WARN/AudioFlinger(31): write blocked for 72 msecs,
1 delayed writes, thread 0xb388
04-14 02:30:47.759: DEBUG/dalvikvm(208): GC freed 4715 objects /
307896 bytes in 90ms
04-14 02:30:50.616: WARN/AudioFlinger(31): write blocked for 99 msecs,
42 delayed writes, thread 0xb388
04-14 02:30:51.219: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:51.586: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:51.667: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:52.029: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:52.046: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:52.287: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:52.317: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:52.597: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:52.617: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:52.877: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:52.937: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:53.235: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:53.235: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:53.485: WARN/MediaPlayer(208): info/warning (1, 44)
04-14 02:30:53.506: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:53.677: INFO/MediaPlayer(208): Info (1,44)
04-14 02:30:55.350: INFO/PlayerDriver(31): buffering (38)
04-14 02:30:55.839: WARN/AudioFlinger(31): write blocked for 97 msecs,
65 delayed writes, thread 0xb388
04-14 02:30:56.749: WARN/InputManagerService(55): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@43cfef38
04-14 02:31:00.889: WARN/AudioFlinger(31): write blocked for 94 msecs,
106 delayed writes, thread 0xb388

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] MediaController for a mp3 file

2009-12-01 Thread rastyrori
I'm having trouble finding examples of displaying a media controller
(play, stop, rewind, ff) for an mp3 file. Is this possible? Seems to
be only implemented for VideoView.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaController without VideoView ?

2009-06-26 Thread sasq

Is it possible to create and use a MediaController that is not
attached to a VideoView?

The obvious/trivial way does not seem to work, ie;

mc = new MediaController(this);
mc.setAnchorView(myView);
mv.setMediaPlayer(this);

doesnt seem to do anything...

-- Sasq

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] MediaController is not working properly with MediaPlayer

2009-06-22 Thread manoj

Hi,

I want to enable the MediaController for the MediaPlayer.

For this I have written the code like this:

public class AudioPlayerNew extends Activity implements
MediaPlayerControl,MediaPlayer.OnPreparedListener,MediaPlayer.OnBufferingUpdateListener
{
 MediaController mediaController;
 MediaPlayer mMediaPlayer;
 private String path = /sdcard/Kaarulo Shikarukelle.mp3;
 int percent = 1;
 boolean playerState = true;

public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.sdcard_media_view);
mediaController = (MediaController) findViewById
(R.id.MediaController01);
playAudio(path);
mediaController.setAnchorView( findViewById
(R.layout.sdcard_media_view));
mediaController.setMediaPlayer(this);
mediaController.bringToFront();
mediaController.setEnabled(true);
}

private void playAudio(String media)
{
try
   {
mMediaPlayer = new MediaPlayer();
 mMediaPlayer.setDataSource(path);
   mMediaPlayer.prepare();
 
mMediaPlayer.setOnSeekCompleteListener(this);
 
mMediaPlayer.setOnPreparedListener(this);
 
mMediaPlayer.setOnCompletionListener(this);
 
mMediaPlayer.setOnErrorListener(this);
   }
   catch (Exception e)
  {
Log.e(TAG, error:  + e.getMessage(), e);
  }

  }

@Override
protected void onDestroy() {
super.onDestroy();
// TODO Auto-generated method stub
dismissDialog();
if(null != mMediaPlayer)
{
mMediaPlayer.release();
mMediaPlayer = null;
}


wakeLock.release();
}

@Override
public int getBufferPercentage() {
System.out.println(MediaController.getBufferPercentage()
called!!!);
// TODO Auto-generated method stub
return percent;
}

@Override
public int getCurrentPosition() {
System.out.println(MediaController.getCurrentPosition()
called!!!);
// TODO Auto-generated method stub
return mMediaPlayer.getCurrentPosition();
}

@Override
public int getDuration() {
System.out.println(MediaController.getDuration() called!!!);
// TODO Auto-generated method stub
return mMediaPlayer.getDuration();
}

@Override
public boolean isPlaying()
{
//System.out.println(MediaController.isPlaying() called!!!);
// TODO Auto-generated method stub
return playerState;
}

@Override
public void pause()
{
//System.out.println(MediaController.pause() called!!!);
// TODO Auto-generated method stub
if(null != mMediaPlayer)
{
mMediaPlayer.pause();
}
playerState = false;
}

@Override
public void seekTo(int pos)
{
// TODO Auto-generated method stub
//System.out.println(MediaController.seekTo() called!!!);
if(mMediaPlayer != null)
{
mMediaPlayer.seekTo(pos);
}
}

@Override
public void start()
{
//System.out.println(MediaController.start() called!!!);
// TODO Auto-generated method stub
if(null != mMediaPlayer )// !mMediaPlayer.isPlaying())
{
mMediaPlayer.start();
}
playerState = true;
}



@Override
public void onPrepared(MediaPlayer arg0) {
// TODO Auto-generated method stub
dismissDialog();
mMediaPlayer.start();
}



@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
Log.i(VideoViewDemo -, onCompletion() 
calledoc);
setProgressBarIndeterminateVisibility(false);
finish();
}



@Override
public void onBufferingUpdate(MediaPlayer mp, int arg1) {

System.out.println(Buffer percentage :+arg1);
// TODO Auto-generated method stub
percent = arg1;
}



@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
isVideoFilePlayedProperly = false;

// TODO 

[android-developers] MediaController tutorial

2009-05-07 Thread Christian S.

Anyone have a tutorial how to build a MediaController?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---