MediaButtonIntentReceiver not working in Android 4.0+

It looks like your broadcast receiver is an inner class to your service? If so, make your broadcast receiver static and in the manifest do this: <receiver android:name=”MyOuterClass$MediaButtonIntentReceiver” android:enabled=”true”> <intent-filter android:priority=”2147483647″ > <action android:name=”android.intent.action.MEDIA_BUTTON” /> </intent-filter> </receiver> In Android 3.0+ you must use registerMediaButtonEventReceiver to register the receiver. This uses the AndroidManifest for the IntentFilter. … Read more

Stream live video from phone to phone using socket fd

I found an open source project for implementing what I was trying. It processes the video with metadata through an IP camera. Although it does not send video directly to a phone, it does broadcast video for various devices to watch. The source code can be found at the following project page http://code.google.com/p/ipcamera-for-android/. With Android … Read more

How to resume the mediaplayer?

Thank you for your attention but I’ve got it myself for pausing the Mediaplayer I used: Mediaplayer.pause(); length=Mediaplayer.getCurrentPosition(); and for resuming the player from the position where it stopped lately is done by: Mediaplayer.seekTo(length); Mediaplayer.start();

iPhone SDK:How do you play video inside a view? Rather than fullscreen

As of the 3.2 SDK you can access the view property of MPMoviePlayerController, modify its frame and add it to your view hierarchy. MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]]; player.view.frame = CGRectMake(184, 200, 400, 300); [self.view addSubview:player.view]; [player play]; There’s an example here: http://www.devx.com/wireless/Article/44642/1954

MediaPlayer.setDataSource() and prepare() not working – android

Try MediaPlayer.create(), you also may want to start only after player is actually ready, for example: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MediaPlayer player = MediaPlayer.create(this, Uri.parse(“http://www.urltofile.com/file.mp3”)); player.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.start(); } }); }

MediaPlayer stop playing after about 5 seconds

I had this problem too. It was probably due to having the MediaPlayer-object only existing within a method. For example: //ERROR, stops after 5 sec! public static void playMusic(int id) { MediaPlayer mediaPlayer = MediaPlayer.create(context, id); mediaPlayer.setLooping(true); mediaPlayer.start(); } It is most likely that the garbage collector will come in and clean away the MediaPlayer-object. … Read more

How to play a WPF Sound File resource

I tried this with an image file, which works the same as a sound file as far as the uri is concerned because it’s just another resource. I used the code below which essentially matches what you have. new Uri(@”pack://application:,,,/Resources/logo.png”) Make sure that your ‘Media’ folder is not nested in any other folder. If it … Read more

Passing parameters on button action:@selector

Edit. Found a neater way! One argument that the button can receive is (id)sender. This means you can create a new button, inheriting from UIButton, that allows you to store the other intended arguments. Hopefully these two snippets illustrate what to do. myOwnbutton.argOne = someValue [myOwnbutton addTarget:self action:@selector(buttonTouchUpInside:) forControlEvents:UIControlEventTouchUpInside]; and – (IBAction) buttonTouchUpInside:(id)sender { MyOwnButton … Read more

Android: MediaPlayer setVolume function

This function is actualy wonderful. Thanks to it you can create a volume scale with any number of steps! Let’s assume you want 50 steps: int maxVolume = 50; Then to set setVolume to any value in this range (0-49) you do this: float log1=(float)(Math.log(maxVolume-currVolume)/Math.log(maxVolume)); yourMediaPlayer.setVolume(log1,log1); //set volume takes two paramater Nice and easy! And … Read more