media-player

Set ContentURL of MPMoviePlayerController twice

馋奶兔 提交于 2019-12-05 19:08:27
I create an embedded MPMoviePlayerController thusly inside my loadView method: self.moviePlayerController = [[[MPMoviePlayerController alloc] init] autorelease]; // add to view, setup moviePlayerController's view frame, etc And I can later load a movie the user chooses thusly: NSURL *fileUrl = ... self.moviePlayerController.contentURL = fileUrl; and everything works great. However, if I set the contentURL again: NSURL *fileUrl2 = ... self.moviePlayerController.contentURL = fileUrl2; This does not work, even if fileUrl2 == fileUrl1. When I change the contentURL, I get the following

Can Android MediaPlayer play audio in a zipped file?

落爺英雄遲暮 提交于 2019-12-05 13:58:19
CODE EDITED: I am developing a dictionary app for Android. I have been succeeding in making the app pronounce each word being looked up. Here is the code: btnPronounce.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //Log.i(MAIN_TAG,"Start pronounciation ..."); btnPronounce.setEnabled(false); String currentWord = edWord.getText().toString().toLowerCase(); try { ZipFile zip = new ZipFile("/sdcard/app_folder/sound/zip_test.zip"); ZipEntry entry = zip.getEntry(currentWord); if (entry != null) { InputStream in = zip

Android MediaPlayer URL's with Cookie

人走茶凉 提交于 2019-12-05 10:42:20
I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E: http://example.com/site/content?id=SOMEID = mp3 formatted stream If you access the url without a cookie, you'll get a Server 500 error. If you have a cookie, then you'll get the stream. For the life of me, I can't figure out how to make the mediaplayer play a URL while sending a cookie. I can play any url that doesn't require a cookie, however. As far as I can tell you can't. Almost everything MediaPlayer does is done in native code, including opening any

C# Com Interop with Windows Media Player Visualisation (With Sample Code)

旧城冷巷雨未停 提交于 2019-12-05 10:12:44
I am attempting to create a Windows Media Player (WMP) Visualization plugin in C#. I am quite new to exposing C# to COM and may have missed something basic. I have persisted with this for 3 days (about 20 hours) and not got past the single issue I will describe below. For those who don't know, WMP visualizations are the pretty images that show in media player while listening to music. In a nutshell : WMP will call certain methods on my C# COM interface, but not others. I have WMP 11 installed I downloaded the Latest Windows SDK which contains a C++ plugin wizard to compile a working

MediaPlayerLauncher on WP7 - how to resume previously playing media?

此生再无相见时 提交于 2019-12-05 07:47:10
I'm using a MediaPlayerLauncher to show movietrailers in my WP7 application, like this: MediaPlayerLauncher mpl = new MediaPlayerLauncher(); mpl.Media = new Uri(trailerUrl, UriKind.Absolute); mpl.Controls = MediaPlaybackControls.All; mpl.Show(); This works just fine, except one thing: if the user is already listening to music in the background, and launch a trailer, the music is not resumed after the trailer is done playing (or if the user closes the video). Does anyone know how i can resume the previously playing music/media, if even possible? Local media playing through XNA or a 'background

Check if onStop is called from user interaction, or screen dimming

时光总嘲笑我的痴心妄想 提交于 2019-12-05 07:23:50
I have a media player that stops playing whenever the user closes the app, either by pressing the home button, using the back button or simply opening another app. To get this behavior, I added an onStop() to my main activity which tells my MediaPlayer (which is in a service) to stop playing music. However, I would like the music to keep playing whenever the screen gets dimmed, either by using the power button to turn the screen off, or just by the screen auto dimming. Right now the player also stops playing when the screen dims, meaning that the onStop() method also gets called then. How can

How to play audio only from video file on Android?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 06:43:44
问题 I have mp4 and wmv movie files and need to play only sound not video screen. How to do it?? Could I get sound track from movie file?? I know if I hide the SurfaceView from screen, I can only hear sound.. but I have tried a lot but.. it is impossible. If you have any solution to extract sound track from movie file, please let me know.. Thanks in advance. 回答1: If you are using the mediaplayer API in your app then don't call the API public void setDisplay (SurfaceHolder sh) . This will ensure

MediaPlayer stops and restarts

北战南征 提交于 2019-12-05 05:22:41
I get a weird error. I play with a MediaPlayer a mediastream (like shoutcast or icecast). Sometimes suddenly on playing stream (total random) happens a error, the stream stops and restart. OnErrorListener don't get triggered! Logcat: 03-02 17:50:36.274: W/MediaPlayer(16799): info/warning (702, 0) 03-02 17:50:36.274: I/MediaPlayer(16799): Info (702,0) or like this: 03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (703, 0) 03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (701, 0) 03-02 17:50:14.250: I/MediaPlayer(16799): Info (703,0) 03-02 17:50:14.250: I/MediaPlayer(16799): Info

How to set proxy on MediaPlayer

浪子不回头ぞ 提交于 2019-12-05 03:54:50
问题 In my music stream program, how can I set proxy on android.media.MediaPlayer class for stream a link file through the proxy network ? I know about NTCreditional, UsernamePasswordCreditional, Proxy-Authorization Header and etc in HttpClient , URLConnection . But I can not set proxy on android.media.MediaPlayer , how can I do it? Thanks for your advance :) 回答1: Unfortunately MediaPlayer API doesn't provide a ready-to-use method for proxy setting at the moment. how can I do it? There is a

Android Studio Mediaplayer how to fade in and out

我与影子孤独终老i 提交于 2019-12-05 03:34:04
I am working with the mediaplayer class in android studio. I simply want to fade out one sound and fade in the other sound instead of using setVolume(0,0) and setVolume(1,1). I have created two mediaplayers for this and it seemed like I found a solution in this thread: Android: How to create fade-in/fade-out sound effects for any music file that my app plays? but I don't know how to use deltaTime. There are also some other solutions to this, which I can barely understand. Isn't there an easy way to cross fade two mediaplayers, I can not imagine no one has needed this yet or everyone uses