I have a silent movie (No sound at all in that clip) which acts as a background movie for my view.
When I play music with iPod and then open my app the iPod music stops.
I don´t want my movie to interrupt the iPod Audio. I´ve read that UseApplicationAudioSession is deprecated but how do I realize this now?
Thank you for your help!
EDIT: And because I add an image onto the MovieplayerViewController I can not use AVPlayer.
PS: Other threads I´ve found here do mention the deprecated UseApplicationAudioSession solution thats why I opened a new question.
Thanks :)
Here is my solution:
AVAudioSession audioSession = AVAudioSession.SharedInstance();
NSError audioSessionError = new NSError();
audioSession.SetCategory(new NSString("AVAudioSessionCategoryAmbient"), out audioSessionError);
Related
I am trying to create a game using JavaFX. I had been trying to insert some background musics to the game. The musics are of compatible .mp3 files. I am currently using MediaPlayer to playback each Media. Each media file consist of the actual loop and a small (optional) intro music to the loop. How can I achieve smooth audio playback using JavaFX.
Methods I have tried:
Using the Media as one file; I try to alter the mediaPlayer.startTime, mediaPlayer.stopTime. It seems that the duration of the music is shortened when I enter the loop. However, the music restarts at the intro and ends at the wrong place. It was as if startTime didn't offset the music at all.
Using the Media as two separate files (intro and loop); I try to immediately playback the loop music as soon as the intro music is finished (using mediaPlayer.setOnEndOfMedia()). However, the transition was too slow and noticable.
After experience with other well-known game engines (e.g. Unity), I found that the files should be in .wav format as opposed to .mp3 format. This will allow the music to be looped seamlessly.
I have code like this:
setContentView(R.layout.webview);
webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://www.youtube.com/watch?v=_Z5-P9v3F8w");
It'll show the youtube video with the Play button, but none of the Glass gesture can make the video play. Any ideas? Thanks!
Finally figured out how to play Youtube video on Glass!
Intent i = new Intent();
i.setAction("com.google.glass.action.VIDEOPLAYER");
i.putExtra("video_url", "https://m.youtube.com/watch?v=5bWSgFnoCOk");
startActivity(i);
Using WebView can't play the video, using VideoView can only play local MP4 or streaming MP4 (there's some way to hack the MP4 link for a Youtube video, but not reliable). Also, using VideoView can only pause/play the video, but not fast forward or backward. Using the com.google.glass.action.VIDEOPLAYER above solves all the problems WebView and VideoView have.
I am implementing a Music related Application. In my application I need to use AVPlayer instead of MPMusicPlayer to play iPod Library songs. I used AVPlayer to support FadeIn and Fadeout effects for the background playback of MPMediaItems. I used MPMediaItemProperyAssetURL to get the url from the MPMediaItem and give it as input to the AVPlayer like follows. My problem is some items are won't play because of null url. I found that songs downloaded from iTunes store (which are DRM protected) were unable to play because they have no MPMediaItemProperyAssetURL. Could you please guys help me, how can I resolve these issues. I need to support these DRM protected songs in AVPlayer. Please take a look at my following code for reference,
MPMediaItem *currentItem = [songs objectAtIndex:songIndex];
NSURL *itemURL = [currentItem valueForProperty:MPMediaItemPropertyAssetURL];
currentlyPlayingItem=[itemURL absoluteString];
avPlayer = [[AVPlayer alloc] initWithURL:itemURL];
[avPlayer play];
Thanks in Advance,
Sekhar.
Regrettably there is no mechanism to load DRM'd files into the AVPlayer or any of the AV Foundation APIs. If you can convince your users to upgrade their entire library at $0.30 per song with iTunes Plus, that is the only way.
I want to play an audio compressed with G729. How can I handle codes in J2ME player?
Player p = Manager.createPlayer(url);
p.realize();
where and what I put here to mention about G729.? Any explanation with a sample code please.
I looked here as well.but couldn't find a good solution.
Is there any code regarding making a movie file with some selected images in iPhone? I need to create a movie file from the images, not the animations. I am working a few months in Objective-C. That's why I dont know what to do.
Answer to this question might help you: AVFoundation + AssetWriter: Generate Movie With Images and Audio