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.
Related
Seems i'm not getting the right way to code this.
I can do almost everything done to my media player be functional except for this.
This is a bit tricky, and not exposed by the LibVLC public API, which is why you can't find a C# function for this. But there is a way.
First, read how to use LibVLC options
Then find the one you want from the Wiki.
These look like what you're looking for
--freetype-rel-fontsize=<int> Size
--freetype-bold
--freetype-color=<int> color
Use it like this
var libvlc = new LibVLC("--freetype-bold", "--freetype-rel-fontsize=10", "--freetype-color=65280");
And you would get green, bold, extra large subtitles.
For looking up usage and parameter info, you can also check out how the VLC apps use it. Here is VLC for Android libvlc options usage.
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 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);
Ever since I updated to iOS 5, I can't get MPMoviePlayerViewController to play audio on the iPad. Video is perfect, but no audio is heard. It doesn't matter what format I use. It does not work. It works in the simulator, but not on the iPad.
- (IBAction)playVideo {
NSString *filepath = [[NSBundle mainBundle] pathForResource:#"test" ofType:#"m4v"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:#selector(movieFinishedPlaying:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[moviePlayer moviePlayer]];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
}
Anyone else have this problem? Or found a fix?
It sounds silly, but we came across an issue on my team where the volume control for general iPad sounds was muted and this meant that there was no sound for video played in our app, even though music played through the music player or video on websites worked fine.
To check this volume control you can bring up the task manager (double-tap the home button) and then swipe across to the far left and there are some music controls; check that the mute button on this screen is not on.
try this:
...
moviePlayer.useApplicationAudioSession = NO;
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
set audio session before allocating MPMoviePlayerController will play sound along with video
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayback error:nil];
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
Ensure the audio format in the video file is something that the iPad can play. I believe the simulator has access to the host machine's codecs, which might explain why the iPad can play the video but not the audio. As noted on this page in the MPMoviePlayerController documentation:
If you use this class to play audio files, it displays a white screen with a QuickTime logo while the audio plays. For audio files, this class supports AAC-LC audio at up to 48 kHz, and MP3 (MPEG-1 Audio Layer 3) up to 48 kHz, stereo audio.
I just made the slide button on the side into lock screen. Then the sound suddely worked.
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.