Search Results

Search found 232 results on 10 pages for 'mediaplayer'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • Streaming audio not working in Android

    - by user320293
    Hi, I'm sure that this question has been asked before but I've been unable to find a solid answer. I'm trying to load a streaming audio from a server. Its a audio/aac file http://3363.live.streamtheworld.com:80/CHUMFMAACCMP3 The code that I'm using is private void playAudio(String str) { try { final String path = str; if (path == null || path.length() == 0) { Toast.makeText(RadioPlayer.this, "File URL/path is empty", Toast.LENGTH_LONG).show(); } else { // If the path has not changed, just start the media player MediaPlayer mp = new MediaPlayer(); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); try{ mp.setDataSource(getDataSource(path)); mp.prepareAsync(); mp.start(); }catch(IOException e){ Log.i("ONCREATE IOEXCEPTION", e.getMessage()); }catch(Exception e){ Log.i("ONCREATE EXCEPTION", e.getMessage()); } } } catch (Exception e) { Log.e("RPLAYER EXCEPTION", "error: " + e.getMessage(), e); } } private String getDataSource(String path) throws IOException { if (!URLUtil.isNetworkUrl(path)) { return path; } else { URL url = new URL(path); URLConnection cn = url.openConnection(); cn.connect(); InputStream stream = cn.getInputStream(); if (stream == null) throw new RuntimeException("stream is null"); File temp = File.createTempFile("mediaplayertmp", ".dat"); temp.deleteOnExit(); String tempPath = temp.getAbsolutePath(); FileOutputStream out = new FileOutputStream(temp); byte buf[] = new byte[128]; do { int numread = stream.read(buf); if (numread <= 0) break; out.write(buf, 0, numread); } while (true); try { stream.close(); } catch (IOException ex) { Log.e("RPLAYER IOEXCEPTION", "error: " + ex.getMessage(), ex); } return tempPath; } } Is this the correct implementation? I'm not sure where I'm going wrong. Can someone please please help me on this.

    Read the article

  • Save as Ringtone from ContextMenu

    - by kostas_menu
    I have created a button that onClick plays a mp3 file.I have also create a context menu that when you press the button for 2 secs it prompts you to save it as ringtone.How can i save it somewhere in my sd?this is my code: public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Toast.makeText(a.this, "Touch and listen", Toast.LENGTH_SHORT).show(); Button button = (Button) findViewById(R.id.btn1); registerForContextMenu(button); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ MediaPlayer mp = MediaPlayer.create(a.this, R.raw.myalo); mp.start(); Toast.makeText(a.this, "Eisai sto myalo", Toast.LENGTH_SHORT).show(); } }); @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Save As:"); menu.add(0, v.getId(), 0, "Ringtone"); } @Override public boolean onContextItemSelected(MenuItem item) { if(item.getTitle()=="Ringtone"){function1(item.getItemId());} else {return false;} return true; } public void function1(int id){ Toast.makeText(this, "Ringtone Saved", Toast.LENGTH_SHORT).show(); } }

    Read the article

  • how to enable mac like task bar in Windows 7

    - by Reddy
    I have recently got a laptop with windows 7 installed and it is showing normal task bar at bottom and one taskbar with glass like background (I think I seen similar one in either mac or ubuntu) which have the icons for accessing internet, email, mediaplayer. But after sometime it suddenly disappeared and I don't know how to get it back? I don't even know what it is called ;( Can anybody please help?

    Read the article

  • Software to Stream Media Content from Dedicated Server [closed]

    - by Christian
    We have Windows 2008 R2 Servers and we want to stream content (avi, wmv, mpeg etc) to Windows/Mac OS X/iOS etc devices. The visitor must be able to select the file (s)he want to view withing the library. We tried to accomplish this using: VLC Windows Media Service (WMS) Mediaportal VLC: We didnt find a solution to publish the content in a library WMS: only supports WMV/WMA, needs MediaPlayer MediaPortal: it is not supported on W2k8R2 Server Any suggestions? /chris

    Read the article

  • [android] MediaRecorder prepare() causes segfault

    - by dwilde1
    Folks, I have a situation where my MediaRecorder instance causes a segfault. I'm working with a HTC Hero, Android 1.5+APIs. I've tried all variations, including 3gpp and H.263 and reducing the video resolution to 320x240. What am I missing? The state machine causes 4 MediaPlayer beeps and then turns on the video camera. Here's the pertinent source: UPDATE: ADDING SURFACE CREATE INFO I have rebooted the device based on previous answer to similar question. UPDATE 2: I seem to be following the MediaRecorder state machine perfectly, and if I trap out the MR code, the blank surface displays perfectly and everything else functions perfectly. I can record videos manually and play back via MediaPlayer in my code, so there should be nothing wrong with the underlying code. I've copied sample code on the surface and surfaceHolder code. I've looked at the MR instance in the Debug perspective in Eclipse and see that all (known) variables seem to be instantiated correctly. The setter calls are all now implemented in the exaxct order specced in the state diagram. // in activity class definition protected MediaPlayer mPlayer; protected MediaRecorder mRecorder; protected boolean inCapture = false; protected int phaseCapture = 0; protected int durCapturePhase = INF; protected SurfaceView surface; protected SurfaceHolder surfaceHolder; // in onCreate() // panelPreview is an empty LinearLayout surface = new SurfaceView(getApplicationContext()); surfaceHolder = surface.getHolder(); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); panelPreview.addView(surface); // in timer handler runnable if (mRecorder == null) mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(path + "/" + vlip); mRecorder.setVideoSize(320, 240); mRecorder.setVideoFrameRate(15); mRecorder.setPreviewDisplay(surfaceHolder.getSurface()); panelPreview.setVisibility(LinearLayout.VISIBLE); mRecorder.prepare(); mRecorder.start(); Here is a complete log trace for the process run and crash: I/ActivityManager( 80): Start proc com.ejf.convince.jenplus for activity com.ejf.convince.jenplus/.JenPLUS: pid=17738 uid=10075 gids={1006, 3003} I/jdwp (17738): received file descriptor 10 from ADB W/System.err(17738): Can't dispatch DDM chunk 46454154: no handler defined W/System.err(17738): Can't dispatch DDM chunk 4d505251: no handler defined I/WindowManager( 80): Screen status=true, current orientation=-1, SensorEnabled=false I/WindowManager( 80): needSensorRunningLp, mCurrentAppOrientation =-1 I/WindowManager( 80): Enabling listeners W/ActivityThread(17738): Application com.ejf.convince.jenplus is waiting for the debugger on port 8100... I/System.out(17738): Sending WAIT chunk I/dalvikvm(17738): Debugger is active I/AlertDialog( 80): [onCreate] auto launch SIP. I/WindowManager( 80): onOrientationChanged, rotation changed to 0 I/System.out(17738): Debugger has connected I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): debugger has settled (1370) I/ActivityManager( 80): Displayed activity com.ejf.convince.jenplus/.JenPLUS: 5186 ms I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/AudioHardwareMSM72XX( 2696): AUDIO_START: start kernel pcm_out driver. W/AudioFlinger( 2696): write blocked for 96 msecs I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 W/AuthorDriver( 2696): Intended width(640) exceeds the max allowed width(352). Max width is used instead. W/AuthorDriver( 2696): Intended height(480) exceeds the max allowed height(288). Max height is used instead. I/AudioHardwareMSM72XX( 2696): AudioHardware pcm playback is going to standby. I/DEBUG (16094): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG (16094): Build fingerprint: 'sprint/htc_heroc/heroc/heroc: 1.5/CUPCAKE/85027:user/release-keys' I/DEBUG (16094): pid: 17738, tid: 17738 com.ejf.convince.jenplus Thanks in advance! -- Don Wilde http://www.ConvinceProject.com

    Read the article

  • MediaRecorder prepare() causes segfault

    - by dwilde1
    Folks, I have a situation where my MediaRecorder instance causes a segfault. I'm working with a HTC Hero, Android 1.5+APIs. I've tried all variations, including 3gpp and H.263 and reducing the video resolution to 320x240. What am I missing? The state machine causes 4 MediaPlayer beeps and then turns on the video camera. Here's the pertinent source: UPDATE: ADDING SURFACE CREATE INFO I have rebooted the device based on previous answer to similar question. UPDATE 2: I seem to be following the MediaRecorder state machine perfectly, and if I trap out the MR code, the blank surface displays perfectly and everything else functions perfectly. I can record videos manually and play back via MediaPlayer in my code, so there should be nothing wrong with the underlying code. I've copied sample code on the surface and surfaceHolder code. I've looked at the MR instance in the Debug perspective in Eclipse and see that all (known) variables seem to be instantiated correctly. The setter calls are all now implemented in the exaxct order specced in the state diagram. UPDATE 3: I've tried all permission combinations: CAMERA + RECORD_AUDIO+RECORD_VIDEO, CAMERA only, RECORD_AUDIO+RECORD_VIDEO This is driving me bats! :))) // in activity class definition protected MediaPlayer mPlayer; protected MediaRecorder mRecorder; protected boolean inCapture = false; protected int phaseCapture = 0; protected int durCapturePhase = INF; protected SurfaceView surface; protected SurfaceHolder surfaceHolder; // in onCreate() // panelPreview is an empty LinearLayout surface = new SurfaceView(getApplicationContext()); surfaceHolder = surface.getHolder(); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); panelPreview.addView(surface); // in timer handler runnable if (mRecorder == null) mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(path + "/" + vlip); mRecorder.setVideoSize(320, 240); mRecorder.setVideoFrameRate(15); mRecorder.setPreviewDisplay(surfaceHolder.getSurface()); panelPreview.setVisibility(LinearLayout.VISIBLE); mRecorder.prepare(); mRecorder.start(); Here is a complete log trace for the process run and crash: I/ActivityManager( 80): Start proc com.ejf.convince.jenplus for activity com.ejf.convince.jenplus/.JenPLUS: pid=17738 uid=10075 gids={1006, 3003} I/jdwp (17738): received file descriptor 10 from ADB W/System.err(17738): Can't dispatch DDM chunk 46454154: no handler defined W/System.err(17738): Can't dispatch DDM chunk 4d505251: no handler defined I/WindowManager( 80): Screen status=true, current orientation=-1, SensorEnabled=false I/WindowManager( 80): needSensorRunningLp, mCurrentAppOrientation =-1 I/WindowManager( 80): Enabling listeners W/ActivityThread(17738): Application com.ejf.convince.jenplus is waiting for the debugger on port 8100... I/System.out(17738): Sending WAIT chunk I/dalvikvm(17738): Debugger is active I/AlertDialog( 80): [onCreate] auto launch SIP. I/WindowManager( 80): onOrientationChanged, rotation changed to 0 I/System.out(17738): Debugger has connected I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): debugger has settled (1370) I/ActivityManager( 80): Displayed activity com.ejf.convince.jenplus/.JenPLUS: 5186 ms I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/AudioHardwareMSM72XX( 2696): AUDIO_START: start kernel pcm_out driver. W/AudioFlinger( 2696): write blocked for 96 msecs I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 W/AuthorDriver( 2696): Intended width(640) exceeds the max allowed width(352). Max width is used instead. W/AuthorDriver( 2696): Intended height(480) exceeds the max allowed height(288). Max height is used instead. I/AudioHardwareMSM72XX( 2696): AudioHardware pcm playback is going to standby. I/DEBUG (16094): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG (16094): Build fingerprint: 'sprint/htc_heroc/heroc/heroc: 1.5/CUPCAKE/85027:user/release-keys' I/DEBUG (16094): pid: 17738, tid: 17738 com.ejf.convince.jenplus Thanks in advance! -- Don Wilde http://www.ConvinceProject.com

    Read the article

  • Starting to make progress Was [MediaRecorder prepare() causes segfault]

    - by dwilde1
    Folks, I have a situation where my MediaRecorder instance causes a segfault. I'm working with a HTC Hero, Android 1.5+APIs. I've tried all variations, including 3gpp and H.263 and reducing the video resolution to 320x240. What am I missing? The state machine causes 4 MediaPlayer beeps and then turns on the video camera. Here's the pertinent source: UPDATE: ADDING SURFACE CREATE INFO I have rebooted the device based on previous answer to similar question. UPDATE 2: I seem to be following the MediaRecorder state machine perfectly, and if I trap out the MR code, the blank surface displays perfectly and everything else functions perfectly. I can record videos manually and play back via MediaPlayer in my code, so there should be nothing wrong with the underlying code. I've copied sample code on the surface and surfaceHolder code. I've looked at the MR instance in the Debug perspective in Eclipse and see that all (known) variables seem to be instantiated correctly. The setter calls are all now implemented in the exaxct order specced in the state diagram. UPDATE 3: I've tried all permission combinations: CAMERA + RECORD_AUDIO+RECORD_VIDEO, CAMERA only, RECORD_AUDIO+RECORD_VIDEO This is driving me bats! :))) UPDATE 4: starting to work... but with puzzling results. Based on info in bug #5050, I spaced everything out. I have now gotten the recorder to actually save a snippet of video (a whole 2160 bytes!), and I did it by spacing the view visibility, prepare() and start() w.a.a.a.a.a.y out (like several hundred milliseconds for each step). I think what happens is that either bringing the surface VISIBLE has delayed processing or else the start() steps on the prepare() operation before it is complete. What is now happening, however, is that my simple timer tickdown counter is getting clobbered. Is it now that the preview and save operations are causing my main process thread to become unavailable? I'm recording only 10fps at 176x144. Referencing the above code, I've added a timer tickdown after setPreviewDisplay(), prepare() and start(). As I say, it now functions to some degree, but the results still have anomalies. // in activity class definition protected MediaPlayer mPlayer; protected MediaRecorder mRecorder; protected boolean inCapture = false; protected int phaseCapture = 0; protected int durCapturePhase = INF; protected SurfaceView surface; protected SurfaceHolder surfaceHolder; // in onCreate() // panelPreview is an empty LinearLayout surface = new SurfaceView(getApplicationContext()); surfaceHolder = surface.getHolder(); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); panelPreview.addView(surface); // in timer handler runnable if (mRecorder == null) mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(path + "/" + vlip); mRecorder.setVideoSize(320, 240); mRecorder.setVideoFrameRate(15); mRecorder.setPreviewDisplay(surfaceHolder.getSurface()); panelPreview.setVisibility(LinearLayout.VISIBLE); mRecorder.prepare(); mRecorder.start(); Here is a complete log trace for the process run and crash: I/ActivityManager( 80): Start proc com.ejf.convince.jenplus for activity com.ejf.convince.jenplus/.JenPLUS: pid=17738 uid=10075 gids={1006, 3003} I/jdwp (17738): received file descriptor 10 from ADB W/System.err(17738): Can't dispatch DDM chunk 46454154: no handler defined W/System.err(17738): Can't dispatch DDM chunk 4d505251: no handler defined I/WindowManager( 80): Screen status=true, current orientation=-1, SensorEnabled=false I/WindowManager( 80): needSensorRunningLp, mCurrentAppOrientation =-1 I/WindowManager( 80): Enabling listeners W/ActivityThread(17738): Application com.ejf.convince.jenplus is waiting for the debugger on port 8100... I/System.out(17738): Sending WAIT chunk I/dalvikvm(17738): Debugger is active I/AlertDialog( 80): [onCreate] auto launch SIP. I/WindowManager( 80): onOrientationChanged, rotation changed to 0 I/System.out(17738): Debugger has connected I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): waiting for debugger to settle... I/System.out(17738): debugger has settled (1370) I/ActivityManager( 80): Displayed activity com.ejf.convince.jenplus/.JenPLUS: 5186 ms I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/AudioHardwareMSM72XX( 2696): AUDIO_START: start kernel pcm_out driver. W/AudioFlinger( 2696): write blocked for 96 msecs I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5 W/AuthorDriver( 2696): Intended width(640) exceeds the max allowed width(352). Max width is used instead. W/AuthorDriver( 2696): Intended height(480) exceeds the max allowed height(288). Max height is used instead. I/AudioHardwareMSM72XX( 2696): AudioHardware pcm playback is going to standby. I/DEBUG (16094): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG (16094): Build fingerprint: 'sprint/htc_heroc/heroc/heroc: 1.5/CUPCAKE/85027:user/release-keys' I/DEBUG (16094): pid: 17738, tid: 17738 com.ejf.convince.jenplus Thanks in advance! -- Don Wilde http://www.ConvinceProject.com

    Read the article

  • Handling android player errors

    - by stack hoss
    I am anew android developer and i made ashoutcast radio player and work good but when i open app it work for afew time but suddenly stop and need to press stop and play again but i need Handling android player errors to automatic restart on errors package com.test.test; import java.io.IOException; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.media.AudioManager; import android.media.AudioManager.OnAudioFocusChangeListener; import android.media.MediaPlayer; import android.os.IBinder; import android.preference.PreferenceManager; import android.util.Log; public class StreamService extends Service { private static final String TAG = "StreamService"; MediaPlayer mp; boolean isPlaying; Intent MainActivity; SharedPreferences prefs; SharedPreferences.Editor editor; Notification n; NotificationManager notificationManager; // Change this int to some number specifically for this app int notifId = 85; private OnAudioFocusChangeListener focusChangeListener = new OnAudioFocusChangeListener() { public void onAudioFocusChange(int focusChange) { switch (focusChange) { case (AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) : // Lower the volume while ducking. mp.setVolume(0.2f, 0.2f); break; case (AudioManager.AUDIOFOCUS_LOSS_TRANSIENT) : mp.pause(); break; case (AudioManager.AUDIOFOCUS_LOSS) : mp.stop(); break; case (AudioManager.AUDIOFOCUS_GAIN) : // Return the volume to normal and resume if paused. mp.setVolume(1f, 1f); mp.start(); break; default: break; } } }; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @SuppressWarnings("deprecation") @Override public void onCreate() { super.onCreate(); Log.d(TAG, "onCreate"); // Init the SharedPreferences and Editor prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); editor = prefs.edit(); // Set up the buffering notification notificationManager = (NotificationManager) getApplicationContext() .getSystemService(NOTIFICATION_SERVICE); Context context = getApplicationContext(); String notifTitle = context.getResources().getString(R.string.app_name); String notifMessage = context.getResources().getString(R.string.buffering); n = new Notification(); n.icon = R.drawable.ic_launcher; n.tickerText = "Buffering"; n.when = System.currentTimeMillis(); Intent nIntent = new Intent(context, MainActivity.class); nIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pIntent = PendingIntent.getActivity(context, 0, nIntent, 0); n.setLatestEventInfo(context, notifTitle, notifMessage, pIntent); notificationManager.notify(notifId, n); // It's very important that you put the IP/URL of your ShoutCast stream here // Otherwise you'll get Webcom Radio String url = "http://47.182.19.93:9888/"; mp = new MediaPlayer(); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); try { mp.reset(); mp.setDataSource(url); mp.prepare(); mp.start(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block Log.e(TAG, "SecurityException"); } catch (IllegalStateException e) { // TODO Auto-generated catch block Log.e(TAG, "IllegalStateException"); } catch (IOException e) { // TODO Auto-generated catch block Log.e(TAG, "IOException"); } } @SuppressWarnings("deprecation") @Override public void onStart(Intent intent, int startId) { Log.d(TAG, "onStart"); mp.start(); // Set the isPlaying preference to true editor.putBoolean("isPlaying", true); editor.commit(); Context context = getApplicationContext(); String notifTitle = context.getResources().getString(R.string.app_name); String notifMessage = context.getResources().getString(R.string.now_playing); n.icon = R.drawable.ic_launcher; n.tickerText = notifMessage; n.flags = Notification.FLAG_NO_CLEAR; n.when = System.currentTimeMillis(); Intent nIntent = new Intent(context, MainActivity.class); PendingIntent pIntent = PendingIntent.getActivity(context, 0, nIntent, 0); n.setLatestEventInfo(context, notifTitle, notifMessage, pIntent); // Change 5315 to some nother number notificationManager.notify(notifId, n); AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE); // Request audio focus for playback int result = am.requestAudioFocus(focusChangeListener, // Use the music stream. AudioManager.STREAM_MUSIC, // Request permanent focus. AudioManager.AUDIOFOCUS_GAIN); if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { // other app had stopped playing song now , so u can do u stuff now . } } @Override public void onDestroy() { Log.d(TAG, "onDestroy"); mp.stop(); mp.release(); mp = null; editor.putBoolean("isPlaying", false); editor.commit(); notificationManager.cancel(notifId); AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE); am.abandonAudioFocus(focusChangeListener); } }

    Read the article

  • [Windows 8] Please implement the PlayTo feature in your media apps

    - by Benjamin Roux
    One of the greatest feature in Windows 8 apps is the ability to stream the video/photos/music you’re playing to any DLNA capable device in your network. Meaning that if you’re watching a movie on Netflix on your brand new Surface tablet in your garden, you can continue to watch it without interruption on your TV if you decide to go back inside ! Isn’t that awesome? The best thing is that it takes very few lines to implement that in an app and it’s very easy. You just have to subscribe to one event and feed the EventArgs with the stream you want to display. You can either stream a video/music from a MediaElement/MediaPlayer (see PlayerFramework on CodePlex) or from a simple Image control. Code’s better than text so I invite you to go the sample code of the PlayTo feature on the msdn (it features code for JS, C# and C++). So if you’re developing an app capable of playing video, music or just display some photos, please implement the PlayTo, it will bring a plus to your app.

    Read the article

  • Icecast/shoutcast streaming on Android

    - by Alvin
    Is there a way to stream shoutcast/icecast on the android? Passing the icecast URL to the mediaplayer does not work and after researching the topic it seems it is because android can't play raw aac files without a media container. What can I do to get around this? Thanks

    Read the article

  • Get from Android BroadcastReciever to a UI

    - by Andy
    I have a reciever that works well, but I can't seem to show a proper UI, although the toast appears correctly. As far as I can tell, this is caused by Android requiring the class to extend Activity, however, the class already extends BroadcastReciever, so I can't do this. So, I tried to do an Intent, but this failed too. There are no errors, but the screen doesn't show. Source code is below, and any help would be most appreciated. Reciever public class Reciever extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Alarm Recieved", Toast.LENGTH_LONG).show(); Intent i = new Intent(); i.setClass(context, AlarmRing.class); } } AlarmRing public class AlarmRing extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.alarm); MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sweetchild); mp.start(); } Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.comaad.andyroidalarm" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".AndyRoidAlarm" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name="com.comaad.andyroidalarm.Reciever" android:enabled="true"> <intent-filter> <action android:name="com.comaad.andyroidalarm.Reciever"></action> </intent-filter> </receiver> <activity android:name=".AlarmRing"></activity> </application> </manifest> }

    Read the article

  • MPMoviePlayerController doesn't implement MPMediaPlayback protocol as advertised?

    - by goren
    I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that: You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms. Except just above in the header here: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html it doesn't seem to. All I want to do is slow down the playback rate for a video.

    Read the article

  • MPMoviePlayerController doesn't implement MPMediaPlayback protocal as advertised?

    - by goren
    I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that: You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms. Except just above in the header here: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html it doesn't seem to. All I want to do is slow down the playback rate for a video.

    Read the article

  • How to make the ChildWindow Fulscreen?

    - by Subhen
    Hi , I have a ChildWindow , in which I have a Video Playing in Expression MediaPlayer. When I press the FullScreen Button then the whole Application switch to FullScreen Mode , but I want only the Child Window to be Full Screen. Thanks, Subhen

    Read the article

  • How To Extract .flv Stream from JW Player 5.1?

    - by Catfish
    The problem is I've a slow internet connection, and the video doesn't buffer like in YouTube. Therefore I was wondering weather I can extract the url of the .flv file which is being streamed in JW Player and directly download it. Doing some preliminary research, I've found the following info: Main Video URL: http://ijf10.ilcannocchiale.tv/video/2263 Link Only To Video: http://ijf10.ilcannocchiale.tv/js/mediaplayer.swf?... XML File: http://ijf10.ilcannocchiale.tv/xml/video/2263 Actual File Name: 20100425_mother.flv

    Read the article

  • Android - Buffering Lag with VideoView

    - by Chris
    I am using VideoView to display a video in my app. The problem is that, once the layout gets created there is lag of almost 10-30 seconds before which the video starts to play. I can see in LogCat that the video is buffering during the lag. Is there a way I can minimize this lag, or tell MediaPlayer to play the video sooner? Thanks Chris

    Read the article

  • how to play wave file using http

    - by angelina
    Dear all, how can i play wave file using http .my content(wave files ) are on remote server. Client-Server-ContenrServer I m able to play mp3 files using following code <embed id="wmp" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" EnableContextMenu="false" autostart="true" width="320" height="240" loop="false" src=<%= request.getParameter("url") %> />

    Read the article

  • How to figure out that mp3player is delayed when seek bar is working with ??

    - by elecboy97
    While playing mp3 by mediaplyer and showing the progress with seek bar, the problem is that mp3playing sound is delayed when mediaplyer and seekbar working at the same time. I used thread, handler, timer for solving that problem on seekbar.setProgress(mediaplayer.getCurrentPosition()). what do I do?? sdk can take more playbuffer for mp3player..?? or I should focus on optimizing code than before..??

    Read the article

  • Android: Playing an audio clip onClick

    - by fordays
    How do I set up an audiofile to play when a user touches an image. Where should I store the audio file and what code should I use to actually play the file? I don't want to bring up the MediaPlayer interface or anything like that. I was thinking of doing it like this: foo = (ImageView)this.findViewById(R.id.foo); foo.setOnClickListener(this); public void onClick(View v) { if (foo.isTouched()) { playAudioFile(); } } Thanks

    Read the article

  • Compiling a list of audio + video players (flash / javascript / otehr) that I can embed into a websi

    - by FiveTools
    I'm compiling a list of audio + video players (flash / javascript / other) that I can embed into a website. flowplayer: http://flowplayer.org/ jw player: http://www.longtailvideo.com/players/ premium beat: http://www.premiumbeat.com/flash_resources/free_flash_music_player/ xspf web player: http://musicplayer.sourceforge.net/ yahoo media player: http://mediaplayer.yahoo.com/ any popular ones I'm missing? (anyone know if I can skin / customize any of them to operate similar to the Windows vista volume control?)

    Read the article

  • How to access the elements in <script> inside the body tag

    - by Geetha
    Hi All, I am using <script> inside the body tag. <script type="text/javascript" language="javascript"> $('#audioVolume').text($('#audioVolume').text(Math.round((document.mediaPlayer.Volume + 2000) / 10) + "%")); </script> Error: Microsoft JScript runtime error: 'undefined' is null or not an object. Need: I want to access the html elements in <script inside the body tag.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >