Search Results

Search found 314 results on 13 pages for 'priyank mp'.

Page 2/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Playing audio files in WPF

    - by deepak
    hai i need to play audio files in WPF am using the following code FileTextBox.Text = selectedFileName; MediaPlayer mp = new MediaPlayer(); mp.Open(new Uri(selectedFileName, UriKind.Relative )); mp.Play(); its working well, but it doesnt plays the sound. why ???

    Read the article

  • Problems with MediaPlayer, raw resources, stop and start

    - by arakn0
    Hello everybody, I'm new in Android development and I have the next question/problem. I'm playing around with the MediaPlayer class to reproduce some sounds/music. I am playing raw resources (res/raw) and it looks kind of easy. To play a raw resource, the MediaPlayer has to be initialized like this: MediaPlayer mp = MediaPlayer.create(appContext, R.raw.song); mp.start(); Until here there is no problem. The sound is played, and everything works fine. My problem appears when I want to add more options to my application. Specifically when I add the "Stop" button/option. Basically, what I want to do is...when I press "Stop", the music stops. And when I press "Start", the song/sound starts over. (pretty basic!) To stop the media player, you only have to call stop(). But to play the sound again, the media player has to be reseted and prepared. mp.reset(); mp.setDataSource(params); mp.prepare(); The problem is that the method setDataSource() only accepts as params a file path, Content Provider URI, streaming media URL path, or File Descriptor. So, since this method doesn't accept a resource identifier, I don't know how to set the data source in order to call prepare(). In addition, I don't understand why you can't use a Resouce identifier to set the data source, but you can use a resource identifier when initializing the MediaPlayer. I guess that I'm missing something. I wonder if I am mixing concepts, and the method stop() doesn't have to be called in the "Stop" button. Any help? Thanks in advanced!!!

    Read the article

  • I need help with Widget and PendingIntents

    - by YaW
    Hi, I've asked here a question about Task Killers and widgets stop working (SO Question) but now, I have reports of user that they don't use any Task Killer and the widgets didn't work after a while. I have a Nexus One and I don't have this problem. I don't know if this is a problem of memory or something. Based on the API: A PendingIntent itself is simply a reference to a token maintained by the system describing the original data used to retrieve it. This means that, even if its owning application's process is killed, the PendingIntent itself will remain usable from other processes that have been given it. So, I don't know why widget stop working, if Android doesn't kill the PendingIntent by itself, what's the problem? This is my manifest code: <receiver android:name=".widget.InstantWidget" android:label="@string/app_name"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_provider" /> </receiver> And the widget code: public class InstantWidget extends AppWidgetProvider { public static ArrayList<Integer> alWidgetsId = new ArrayList<Integer>(); private static final String PREFS_NAME = "com.cremagames.instant.InstantWidget"; private static final String PREF_PREFIX_NOM = "nom_"; private static final String PREF_PREFIX_RAW = "raw_"; /** * Esto se llama cuando se crea el widget. Metemos en las preferencias los valores de nombre y raw para tenerlos en proximos reboot. * @param context * @param appWidgetManager * @param appWidgetId * @param nombreSound * @param rawSound */ static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId, String nombreSound, int rawSound){ //Guardamos en las prefs los valores SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit(); prefs.putString(PREF_PREFIX_NOM + appWidgetId, nombreSound); prefs.putInt(PREF_PREFIX_RAW + appWidgetId, rawSound); prefs.commit(); //Actualizamos la interfaz updateWidgetGrafico(context, appWidgetManager, appWidgetId, nombreSound, rawSound); } /** * Actualiza la interfaz gráfica del widget (pone el nombre y crea el intent con el raw) * @param context * @param appWidgetManager * @param appWidgetId * @param nombreSound * @param rawSound */ private static void updateWidgetGrafico(Context context, AppWidgetManager appWidgetManager, int appWidgetId, String nombreSound, int rawSound){ RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); //Nombre del Button remoteViews.setTextViewText(R.id.tvWidget, nombreSound); //Creamos el PendingIntent para el onclik del boton Intent active = new Intent(context, InstantWidget.class); active.setAction(String.valueOf(appWidgetId)); active.putExtra("sonido", rawSound); PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0); actionPendingIntent.cancel(); actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0); remoteViews.setOnClickPendingIntent(R.id.btWidget, actionPendingIntent); appWidgetManager.updateAppWidget(appWidgetId, remoteViews); } public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); //Esto se usa en la 1.5 para que se borre bien el widget if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { //Listener de los botones for(int i=0; i<alWidgetsId.size(); i++){ if (intent.getAction().equals(String.valueOf(alWidgetsId.get(i)))) { int sonidoRaw = 0; try { sonidoRaw = intent.getIntExtra("sonido", 0); } catch (NullPointerException e) { } MediaPlayer mp = MediaPlayer.create(context, sonidoRaw); mp.start(); mp.setOnCompletionListener(completionListener); } } super.onReceive(context, intent); } } /** Al borrar el widget, borramos también las preferencias **/ public void onDeleted(Context context, int[] appWidgetIds) { for(int i=0; i<appWidgetIds.length; i++){ //Recogemos las preferencias SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit(); prefs.remove(PREF_PREFIX_NOM + appWidgetIds[i]); prefs.remove(PREF_PREFIX_RAW + appWidgetIds[i]); prefs.commit(); } super.onDeleted(context, appWidgetIds); } /**Este método se llama cada vez que se refresca un widget. En nuestro caso, al crearse y al reboot del telefono. Al crearse lo único que hace es guardar el id en el arrayList Al reboot, vienen varios ID así que los recorremos y guardamos todos y también recuperamos de las preferencias el nombre y el sonido*/ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { for(int i=0; i<appWidgetIds.length; i++){ //Metemos en el array los IDs de los widgets alWidgetsId.add(appWidgetIds[i]); //Recogemos las preferencias SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0); String nomSound = prefs.getString(PREF_PREFIX_NOM + appWidgetIds[i], null); int rawSound = prefs.getInt(PREF_PREFIX_RAW + appWidgetIds[i], 0); //Si están creadas, actualizamos la interfaz if(nomSound != null){ updateWidgetGrafico(context, appWidgetManager, appWidgetIds[i], nomSound, rawSound); } } } MediaPlayer.OnCompletionListener completionListener = new MediaPlayer.OnCompletionListener(){ public void onCompletion(MediaPlayer mp) { if(mp != null){ mp.stop(); mp.release(); mp = null; } } }; } Sorry for the comments in Spanish. I have the possibility to put differents widgets on the desktop, that's why I use the widgetId as the "unique id" for the PendingIntent. Any ideas please? The 70% of the functionality of my app is the widgets, and it isn't working for some users :( Thanks in advance and sorry for my English.

    Read the article

  • Streaming Audio from A URL in Android using MediaPlayer?

    - by Sena Gbeckor-Kove
    Hi, I've been trying to stream mp3's over http using Android's built in MediaPlayer class. The documentation would suggest to me that this should be as easy as : MediaPlayer mp = new MediaPlayer(); mp.setDataSource(URL_OF_FILE); mp.prepare(); mp.start(); However I am getting the following repeatedly. I have tried different URLs as well. Please don't tell me that streaming doesn't work on mp3's. E/PlayerDriver( 31): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported W/PlayerDriver( 31): PVMFInfoErrorHandlingComplete E/MediaPlayer( 198): error (1, -4) E/MediaPlayer( 198): start called in state 0 E/MediaPlayer( 198): error (-38, 0) E/MediaPlayer( 198): Error (1,-4) E/MediaPlayer( 198): Error (-38,0) Any help much appreciated, thanks S

    Read the article

  • Slow MySQL Query not using filesort

    - by Canadaka
    I have a query on my homepage that is getting slower and slower as my database table grows larger. tablename = tweets_cache rows = 572,327 this is the query I'm currently using that is slow, over 5 seconds. SELECT * FROM tweets_cache t WHERE t.province='' AND t.mp='0' ORDER BY t.published DESC LIMIT 50; If I take out either the WHERE or the ORDER BY, then the query is super fast 0.016 seconds. I have the following indexes on the tweets_cache table. PRIMARY published mp category province author So i'm not sure why its not using the indexes since mp, provice and published all have indexes? Doing a profile of the query shows that its not using an index to sort the query and is using filesort which is really slow. possible_keys = mp,province Extra = Using where; Using filesort I tried adding a new multie-colum index with "profiles & mp". The explain shows that this new index listed under "possible_keys" and "key", but the query time is unchanged, still over 5 seconds. Here is a screenshot of the profiler info on the query. http://i355.photobucket.com/albums/r469/canadaka_bucket/slow_query_profile.png Something weird, I made a dump of my database to test on my local desktop so i don't screw up the live site. The same query on my local runs super fast, milliseconds. So I copied all the same mysql startup variables from the server to my local to make sure there wasn't some setting that might be causing this. But even after that the local query runs super fast, but the one on the live server is over 5 seconds. My database server is only using around 800MB of the 4GB it has available. here are the related my.ini settings i'm using default-storage-engine = MYISAM max_connections = 800 skip-locking key_buffer = 512M max_allowed_packet = 1M table_cache = 512 sort_buffer_size = 4M read_buffer_size = 4M read_rnd_buffer_size = 16M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size = 128M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 # Disable Federated by default skip-federated key_buffer = 512M sort_buffer_size = 256M read_buffer = 2M write_buffer = 2M key_buffer = 512M sort_buffer_size = 256M read_buffer = 2M write_buffer = 2M

    Read the article

  • How do I make my NSNotification trigger a selector?

    - by marty
    Here's the code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *musicURL = [NSURL URLWithString:@"http://live-three2.dmd2.ch/buureradio/buureradio.m3u"]; if([musicURL scheme]) { MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:musicURL]; if (mp) { // save the music player object self.musicPlayer = mp; [mp release]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popBack:) name:@"MPMoviePlayerDidExitFullscreenNotification" object:nil]; // Play the music! [self.musicPlayer play]; } } } -(void)popBack:(NSNotification *)note { [self.navigationController popToRootViewControllerAnimated:YES]; } The selector method never gets called. I just want to pop back to the root menu when the "Done" button is pressed on the movie player. I put an NSLog in the selector to check if it was even being called, nothing. The music plays fine. Any thoughts?

    Read the article

  • What is the best way to get an audio file duration in Android?

    - by Gilead
    Hi! I'm using a SoundPool [ 1 ] to play audio clips in my app. All is fine but I need to know when the clip playback has finished. At the moment I track it in my app by obtaining the duration of each clip using a MediaPlayer [ 2 ] instance. That works fine but it looks wasteful to load each file twice, just to get the duration. I could roughly calculate the duration myself knowing the length of the file (available from the AssetFileDescriptor [ 3 ]) but I'd still need to know the sample rate and the number of channels. I see two potential solutions to that problem: Figuring out when a clip has finished playing (doesn't seem to be possible with SoundClip). Having a class which could load just the header of an audio file and give me the sample rate/number of channels (and, ideally, the sample count to get the exact duration). Any suggestions? Thanks, Max The code I'm using at the moment (works fine but is rather heavy for the purpose): String[] fileNames = ... MediaPlayer mp = new MediaPlayer(); for (String fileName : fileNames) { AssetFileDescriptor d = context.getAssets().openFd(fileName); mp.reset(); mp.setDataSource(d.getFileDescriptor(), d.getStartOffset(), d.getLength()); mp.prepare(); int duration = mp.getDuration(); // ... } On a side note, this question has already been asked [ 4 ] but got no answers.

    Read the article

  • Stopping and Play button for Audio (Android)

    - by James Rattray
    I have this problem, I have some audio I wish to play... And I have two buttons for it, 'Play' and 'Stop'... Problem is, after I press the stop button, and then press the Play button, nothing happens. -The stop button stops the song, but I want the Play button to play the song again (from the start) Here is my code: final MediaPlayer mp = MediaPlayer.create(this, R.raw.megadeth); And then the two public onclicks: (For playing...) button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Perform action on click button.setText("Playing!"); try { mp.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mp.start(); // } }); And for stopping the track... final Button button2 = (Button) findViewById(R.id.cancel); button2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { mp.stop(); mp.reset(); } }); Can anyone see the problem with this? If so could you please fix it... (For suggest) Thanks alot... James

    Read the article

  • memory problem with metapost

    - by yCalleecharan
    Hi, I'm using gnuplot to plot a graph to the mp format and then I'm converting it to eps via the command: mpost --sprologues=3 -soutputtemplate=\"%j-%c.eps\" myfigu.mp But I don't get the eps output; instead I get this message: This is MetaPost, version 1.208 (kpathsea version 3.5.7dev) (mem=mpost 2009.12.12) 6 MAY 2010 23:16 **myfigu.mp (./myfigu.mp ! MetaPost capacity exceeded, sorry [main memory size=3000000]. _wc-withpen .currentpen.withcolor.currentcolor gpdraw-...ptpath[(EXPR0)]_sms((EXPR1),(EXPR2))_wc .else:_ac.contour.ptpath[(... l.48052 gpdraw(0,517.1a,166.4b) ; If you really absolutely need more capacity, you can ask a wizard to enlarge me. How do I tweak in order to get more memory. The file from which I'm plotting has two columns of 189,200 values each. These values are of type long double (output from a C program). The text file containing these two column values is about 6 MB. Thanks a lot...

    Read the article

  • onstop() for mp3 files

    - by kostas_menu
    i have this two button.as i press the first it plays an mp3 file.but if i press the second and the first mp3 hasnt finished yet,they play both together.how could i fix it??this is my btn code!!thanks Button button = (Button) findViewById(R.id.btn); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ MediaPlayer mp = MediaPlayer.create(olympiakos.this, R.raw.myalo); mp.start(); Toast.makeText(olympiakos.this, "Eisai sto myalo", Toast.LENGTH_SHORT).show(); } }); Button button2 = (Button) findViewById(R.id.btn2); button2.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ MediaPlayer mp = MediaPlayer.create(olympiakos.this, R.raw.thryleole); mp.start(); Toast.makeText(olympiakos.this, "thryle ole trelenomai", Toast.LENGTH_SHORT).show(); }

    Read the article

  • 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

  • Media Player Problem

    - by kostas_menu
    button.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ if(mp2.isPlaying()==true) {mp2.stop(); mp.start(); } else mp.start(); } }); button2.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ if(mp.isPlaying()==true) {mp.stop();mp2.start();} else mp2.start(); } }); I press the first btn and the 1st song is playing.i press the second,the first stops and the second begins.But then, as i press the first btn, the second song stops but the first song is not playing...please help!!:)

    Read the article

  • Is my current employer expecting too much?

    - by priyank patel
    This is my first job as a programmer.I am working on ASP.NET/C#,HTML,CSS,Javascript/Jquery. I am working for a firm which develops software for small banking firms. Currently they have their software running in 100 firms.Their software is developed in Visual Fox Pro. I was hired to develop online version of this software.I am the solo developer. My boss is another developer.So my company has two developers. My boss doesnot have any idea about .NET development.I am working on their project since 8 months.The progress is surely there but not very big. I try my best to do what my boss asks.But the project just seems too ambitious for me. The company doesnot have any planning for the project.They just ask me to develop what their older software provides.So I have to deal with front end , back end,review codes , design architecture and etc. I have decided to give my best.I try a lot.But the project sometimes just seems to be overwhelming. So my questions is , is it normal for a programmer to be in this place. I always feel the need to work in atleast a small team if not big one. Are my employers just expecting too much of a fresher.Or is that I being a programmer am lacking the skills to deal with this. I am just not able judge my condition.Also I am paid very low salary.I do work on saturday as well. Can anyone just help me judge this scenario? Any suggestions are welcome.

    Read the article

  • Is my first employer expecting too much?

    - by priyank patel
    This is my first job as a programmer. I am working using the followig technologies: ASP.NET C# HTML CSS Javascript JQuery I work for a firm which develops software for small banking firms. Currently they have their software running in 100 firms. Their software is developed in Visual Fox Pro. I was hired to develop an online version of this software. I am the only developer. My boss is another developer, the only other developer in the firm. Therefore, my employer has a total of two developers. My boss does not have any experience with .NET development. I have been working on this project for 8 months. The progress is there, but has been very slow. I try my best to do what my boss asks. But the project just seems too ambitious for me. The company has not done have any planning for the project. They just ask me to develop what their older software provides. So I have to deal with front end, back end, review code, design architecture, and more. I have decided to give my best. I try a lot. But the project sometimes just seems to be overwhelming. Question: Is it normal for a beginner programmer to be in this place? Are my employers just expecting too much of a new programmer? As a programmer, am I lacking skills one needs to deal with this? I always feel the need to work in at least a small team, if not big one. I am just not able judge my condition. Also I am paid very low salary. I do work on Saturday as well. Please, help to clarify my judgment. Any suggestions are welcome.

    Read the article

  • As a programmer how do I plan to learn new things in my spare time

    - by priyank patel
    I am a Asp.Net/C# developer, I develop few projects in my spare time. I try to utilize my time as much as I can. I have been working for past 7 months. Suddenly these days I am a bit worried about learning the new stuff that is there for me as a programmer. I develop in my spare time so I don't get enough time to read books or blogs. So my question to some of you guys is how should I plan to learn new things, should I at least dedicate two-three evenings for new stuff, maybe ebooks while travelling is a good option too. How do you people plan to learn,should I also start to develop with whatever I learnt? As far as learning is concerned, should I just pick up the basics and then implement it or I should seek deeper understanding of the subject?

    Read the article

  • Should I go with OpenGL to see my future in Game Development industry? [closed]

    - by Priyank
    Possible Duplicate: Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry? I tried Google but found quite old articles, so I am in search of an answer in context to year 2012. Hi all, I don't know if you will consider this question appropriate for this community but I am constantly searching for a perfect answer. What I have seen is that most of the games that are released these days are DirectX 1x based. Except for few games like Starcraft or Diablo which don't have high end graphics are using OpenGL. So I have few questions to ask. The platforms i would like to target are PC (windows), Xbox 360 and PS3 (must). Should I go with learning OpenGL to see my future in game development industry? Or should I shift to Directx? If I learn OpenGL first, will it be difficult to learn direcx then? Which API is most suitable for indie development? Which one of the two API's are better from coder's (programmer's) point of view? Like OOP and style of coding. Is openGL being cross platform should be the only reason to choose it over Directx? Even when vendors are not providing enough stable drivers for it. Thanks in advance. I have read this post, but I have few questions. Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry?

    Read the article

  • Can you force a MPMoviePlayerPlaybackDidFinishNotification ?

    - by Jonathan
    Hi, I have several movies that are played and presented using this code. As you can see I also have removed the default movie controls and have added a custom overlay which essentially just stops the video. Here is my problem... When I stop the movie with my custom overlay button, I don't seem to be getting the 'MPMoviePlayerPlaybackDidFinishNotification' Note: everything works normal if I let the movie play through and it stop by itself. Is the any way of 'forcing' the PlaybackDidFinish notification? Can I do something like this [self moviePlayBackDidFinish:something]; ? Thank You! - (void) playMovie { NSString *path = [[NSBundle mainBundle] pathForResource:@"movie_frog" ofType:@"m4v"]; NSURL *url = [NSURL fileURLWithPath:path]; MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:url]; if(mp) { self.myMoviePlayer = mp; [mp release]; //movie view [self.view addSubview:myMoviePlayer.view]; myMoviePlayer.view.frame = CGRectMake(0.0,0.0,480,320); self.myMoviePlayer.controlStyle = MPMovieControlStyleNone; [self.myMoviePlayer play]; //videoNav _videoNav = [[videoNav alloc] initWithNibName:@"videoNav" bundle:nil]; [self.view addSubview:_videoNav.view]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; } }

    Read the article

  • MPMoviePlayerController - streaming works on 3GS, not on anything pre-3GS

    - by Canada Dev
    I am having some serious issues and annoyances with MPMoviePlayerController. In my app you can watch trailers for some movies in .mov format. I have tested with a friend and had users report that it does not work on their device, which are all 3G. I have tested on my own, a 3GS and playback works fine. I have tried on a 1st gen iPhone and it doesn't work. So I am lead to believe it's a memory issue, and that it's simply stopping the playback and returning to the previous screen. Below is the code I use to launch the player, which is straight out of the MoviePlayer example from Apple. MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:trailerURL]]; if (mp) { self.moviePlayer = mp; [mp release]; [self.moviePlayer play]; } I have tried to check the NSError from the notifications, but the only thing I get is "An unknown playback error occurred" for both the localizedDescription and localizedRecoverySuggestion, making it impossible to figure out exactly why it's not working. I have seen many examples of people who just have issues with the movie player, but it's starting to annoy me that it sometimes seem to work fine and other times it just doesn't (again, appearing like a memory issue). Thanks for any help/feedback provided

    Read the article

  • Problem with ImageButton.setVisibility()

    - by Luis Lopez
    Hello guys! I'm having a problem when setting the visibility of two image buttons one on top of the other. The idea is to implement a play/pause control. The problem is that the only part where setting the visibility actually works is in the click listeners of the buttons. If I try to change it somewhere else nothing happens. Any idea why is this happening? Thanks in advance! playBtn.setOnClickListener(new OnClickListener() {//PLAY BUTTON LISTENER public void onClick(View v) { playBtn.setVisibility(ImageButton.GONE); pauseBtn.setVisibility(ImageButton.VISIBLE); mp.start(); }}); pauseBtn.setOnClickListener(new OnClickListener() {//PAUSE BUTTON LISTENER public void onClick(View v) { pauseBtn.setVisibility(ImageButton.GONE); playBtn.setVisibility(ImageButton.VISIBLE); mp.pause(); }}); final class SeekBarTask extends TimerTask { public SeekBarTask(int duration) { } @Override public void run() { if(seekBar.getProgress() = mp.getDuration()) {//IF SONG HAS FINISHED... pauseBtn.setVisibility(ImageButton.GONE);//THESE ONES playBtn.setVisibility(ImageButton.VISIBLE);//DOESN'T WORK mp.stop(); } else { seekBar.incrementProgressBy(100); } } }

    Read the article

  • Application lifecycle and onCreate method in the the android sdk

    - by Leif Andersen
    I slapped together a simple test application that has a button, and makes a noise when the user clicks on it. Here are it's method: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button b = (Button)findViewById(R.id.easy); b.setOnClickListener(this); } public void onClick(View v) { MediaPlayer mp = MediaPlayer.create(this, R.raw.easy); mp.start(); while(true) { if (!mp.isPlaying()) { mp.release(); break; } } } My question is, why is onCreate acting like it's in a while loop? I can click on the button whenever, and it makes the sound. I might think it was just a property of listeners, but the Button object wasn't a member variable. I thought that Android would just go through onCreate onse, and proceed onto the next lifecycle method. Also, I know that my current way of seeing if the sound is playing is crap...I'll get to that later. :) Thank you.

    Read the article

  • How can I scan from Canon PIXMA MX700 without disabling OS X firewall?

    - by Justin Love
    I have a Canon PIXMA MX700 connected by ethernet. When I first bought it I was using OS X 10.4, and scanner-initiated scanning worked fine. After upgrading to 10.6, neither scanner-initiated or scanning from MP Navigator EX works with the firewall enabled. The firewall lists exceptions for three applications: Canon IJ Network Scan Utility.app Canon IJ Network Scanner Selector.app MP Navigator EX 1.0.app I get no further blocked warnings, and /var/log/appfirewall.log lists nothing for today (my latest attempt to use it).

    Read the article

  • How can I scan from Canon PIXMA MX700 without disabling OS X firewall?

    - by Justin Love
    I have a Canon PIXMA MX700 connected by ethernet. When I first bought it I was using OS X 10.4, and scanner-initiated scanning worked fine. After upgrading to 10.6, neither scanner-initiated or scanning from MP Navigator EX works with the firewall enabled. The firewall lists exceptions for three applications: Canon IJ Network Scan Utility.app Canon IJ Network Scanner Selector.app MP Navigator EX 1.0.app I get no further blocked warnings, and /var/log/appfirewall.log lists nothing for today (my latest attempt to use it).

    Read the article

  • Query for props list with or without values

    - by vitto
    Hi, I'm trying to make a SELECT on three relational tables like these ones: table_materials -> material_id - material_name table_props -> prop_id - prop_name table_materials_props - row_id -> material_id -> prop_id - prop_value On my page, I'd like to get a result like this one but i have some problem with the query: material prop A prop B prop C prop D prop E wood 350 NULL NULL 84 16 iron NULL 17 NULL NULL 201 copper 548 285 99 NULL NULL so the query should return something like: material prop_name prop_value wood prop A 350 wood prop B NULL wood prop C NULL wood prop D 84 wood prop E 16 // and go on with others rows i thought to use something like: SELECT * FROM table_materials AS m INNER JOIN table_materials_props AS mp ON m.material_id = mp.material_id INNER JOIN table_materials_props AS p ON mp.prop_id = p.prop_id ORDER BY p.prop_name the problem is the query doesn't return the NULL values, and I need the same prop order for all the materials regardless of prop values are NULL or not I hope this example is clear!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >