Re: Hide Quicktime logo when using MPMoviePlayerController to play audio

Matt Neuburg <[email protected]> Wed, 10 Aug 2011 09:48:20 -0700
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
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
> From: John Love <[email protected]>
> Subject: Hide Quicktime logo when using MPMoviePlayerController to
> 	play audio
>=20
> 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.
>=20
> Given that, I do use MPMoviePlayerController to play these web stored =
audio/mp3 files which it can handle.
>=20
> 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".
>=20
> What I want to happen is that the audio/mp3 is played, but the lyrics =
stay in front.
>=20
> 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.
>=20
> 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.
>=20
> BUT, I really do need a way to defeat the audio/QuickTime (( Q )) =
graphic coming to the front and keep the lyrics there.
>=20
> 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:
>=20
>=20
>    if ( NSClassFromString(@"MPMoviePlayerViewController") )
>    {
>        if (!isAudioFile)
>        {
>            [senderViewController
>             =
presentMoviePlayerViewControllerAnimated:moviePlayerViewController_];
>        }
>    }
>=20
>    [moviePlayerController_ play];
>=20
>=20
> 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 =E2=88=91
>=20
> **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.
>=20
> 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 =3D [email protected], 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