Discussion:
Hide Quicktime logo when using MPMoviePlayerController to play audio
John Love
2011-08-09 15:30:29 UTC
Permalink
Reference my iOS TabController app...

Apple docs state that the AVAudioPlayer class does not provide support for streaming audio based on HTTP URL's. AVAudioPlayer plays only music embedded in the iApp.

Given that, I do use MPMoviePlayerController to play these web stored audio/mp3 files which it can handle.

This definitely works. I start out with a UIView with the lyrics for the song. At the very bottom of this lyrics UIView is a "Play" button. The user taps this button and the audio/mp3 plays; however, the audio/QuickTime (( Q )) graphic comes to the foreground and the lyrics disappear and will stay away until the user taps "Done".

What I want to happen is that the audio/mp3 is played, but the lyrics stay in front.

BTW, I really don't think I need the "Done" button to be seen because the user can stop the audio by simply selecting another Tab.

Obviously this coming to the foreground for the AV Quicktime graphic makes sense because the MPMoviePlayerController object is primarily designed to play video and the video ought to come to the front. Therefore, it is consistent in that the Quicktime graphic also comes to the foreground.

BUT, I really do need a way to defeat the audio/QuickTime (( Q )) graphic coming to the front and keep the lyrics there.

I did insert code to determine if it was an audio file (mp3), versus a video file (mp4). So far so good ... and then if it was an audio file, within my actual playing segment, I have:


if ( NSClassFromString(@"MPMoviePlayerViewController") )
{
if (!isAudioFile)
{
[senderViewController
presentMoviePlayerViewControllerAnimated:moviePlayerViewController_];
}
}

[moviePlayerController_ play];


It actually works, that is, I actually hear the mp3 in the background, with the lyrics staying in front and the audio/QuickTime (( Q )) graphic does not show …

**BUT, what does happen is horrible, that is, the "Done" button shows over the lyrics** I talked about with some sort of unknown ??? letters there. The gibberish that appears looks line the "Done" label for the UIButton superimposed on which is the time remaining to finish the song.

FWIW, I really don't think I need a "Done" button because as soon as I go to another tab, either new music or a video, the music initially playing stops and the new AV file starts. If I press the Home button, the music stops playing, so I think I can get along without the Done button being around.

Any ideas to cover over the Done button ?? ... because right now I don't have a clue what to do.


John Love
Touch the Future! Teach!
Matt Neuburg
2011-08-10 16:48:20 UTC
Permalink
It will help you distinguish MPMoviePlayerViewController from MPMoviePlayerController. They are very different things. In particular, the latter doesn't give you the "potted" view. m.
Date: Tue, 9 Aug 2011 11:30:29 -0400
Subject: Hide Quicktime logo when using MPMoviePlayerController to
play audio
Apple docs state that the AVAudioPlayer class does not provide support for streaming audio based on HTTP URL's. AVAudioPlayer plays only music embedded in the iApp.
Given that, I do use MPMoviePlayerController to play these web stored audio/mp3 files which it can handle.
This definitely works. I start out with a UIView with the lyrics for the song. At the very bottom of this lyrics UIView is a "Play" button. The user taps this button and the audio/mp3 plays; however, the audio/QuickTime (( Q )) graphic comes to the foreground and the lyrics disappear and will stay away until the user taps "Done".
What I want to happen is that the audio/mp3 is played, but the lyrics stay in front.
BTW, I really don't think I need the "Done" button to be seen because the user can stop the audio by simply selecting another Tab.
Obviously this coming to the foreground for the AV Quicktime graphic makes sense because the MPMoviePlayerController object is primarily designed to play video and the video ought to come to the front. Therefore, it is consistent in that the Quicktime graphic also comes to the foreground.
BUT, I really do need a way to defeat the audio/QuickTime (( Q )) graphic coming to the front and keep the lyrics there.
{
if (!isAudioFile)
{
[senderViewController
presentMoviePlayerViewControllerAnimated:moviePlayerViewController_];
}
}
[moviePlayerController_ play];
It actually works, that is, I actually hear the mp3 in the background, with the lyrics staying in front and the audio/QuickTime (( Q )) graphic does not show ∑
**BUT, what does happen is horrible, that is, the "Done" button shows over the lyrics** I talked about with some sort of unknown ??? letters there. The gibberish that appears looks line the "Done" label for the UIButton superimposed on which is the time remaining to finish the song.
FWIW, I really don't think I need a "Done" button because as soon as I go to another tab, either new music or a video, the music initially playing stops and the new AV file starts. If I press the Home button, the music stops playing, so I think I can get along without the Done button being around.
--
matt neuburg, phd = ***@tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

Loading...