I use the example named MoviePlayer from SDK 3.0, but it sometimes crashes - movieplayer

I use the example named MoviePlayer from SDK 3.0, but it sometimes crashes.
PS: I never change any code.
Question 1:
My enviroment:
lan media server:10.0,0.118
I enter an MP4 address:
http://10.0.0.118/1.mp4
It works fine, but sometimes it crashes.
using gdb:bt
mach_msg_trap
mach_msg
CFRunLoopRunSpecific
CFRunLoopRunInMode
GSEventRunModal
GSEventRun
UIApplicationMain
main
What does it mean? I never modify any code.
Question 2:
And sometimes, if I play an MP4 file, and then I play it again, the screen of the simulater will shock. If I play another MP4 file it works fine.
How can I make it work?
Question 3:
The delegate named MPMoviePlayerContentPreloadDidFinishNotification does not work the first time I play the movie. If I play it again or I play another movie, it is called.
Why?

Question 2) This shock and blinking is only
a bug in the emulator. It is not
happening on a real iPhone device so
don't worry about it.
Question 3) I too saw
that the delegate named
MPMoviePlayerContentPreloadDidFinishNotification
does not work the first time
I play the movie which is totally
strange. Maybe this is fixed in
newest firmware? I don't know. I can't
check it. Did you find any workaround for Question 3?

Related

Xcode keeps pausing my music

First of all i know this is a programming forums, but my problem concerns Xcode and the problem happens with me while CODING.
When i use Xcode, when it is stopped in breakpoints while debugging the sound of the music played ( in my Mac music player ) is gone !!! i know this is awkward but it happens. Does any one has a solution or at least a reason for this?
After googling this problem i just found one case talking about the same problem here in this Link
I'm not using Spotify like the case in the link i'm using another music player called Vox
I have changed Vox and changed it with Deezer and it has the same problem
Update 1
As mentioned in the Accepted Answer, This problem only happened while using Cocos2dx in Xcode, When i returned back to the use Xcode with just iOS sdk without the Cocos2dx this problem doesn't exist any more.
This is happening when your capture audio session in your application and debug something.
The case to reproduce this using Xcode + simulator (on device you will have phone's audio session, so it can not be reproduced with the following snippet). Sometimes it stops just after breakpoint occurs, sometimes - after about a minute (i think, session expires after that time, or something like that)
Create empty project and override didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryError];
if (setCategoryError) // set breakpoint here
NSLog(#"Error setting category! %#", setCategoryError);
return YES;
}
I think, on breakpoint session somehow stops music playing. so - check your project for the code, which manipulates with audio session (AVAudioSession).
Hope, this helps.
I had the same issue and I figured it had something to do with CocosDenshion. Do you use it? If so, try to not create a CDSoundEngine. Does it fix the issue? You could create it only in your release build.
Had the same problem, super annoying.
Fixed it by routing sound through soundflower.
https://github.com/mLupine/SoundflowerBed/releases
Then install soundflower bed:
https://github.com/mattingalls/Soundflower/releases/tag/2.0b2
Look for the soundflower icon in your menu bar on the right, select your output device of choice, then go to your sound options and select soundflower as the output.
Hope that helps!
The Simulator is the iOS/watchOS/tvOS user space running on the host mac kernel, so it shares its audio subsystem with the mac. When stopped in the debugger none of the audio callbacks can be serviced. I suspect this happens when you have an active audio session with active callbacks.
Please file a bug at https://bugreport.apple.com and provide a sample project if you can.

QMediaPlayer doesn't change status at the end of file

I'm using Qt 5.1 (from here) on a MacBook Pro (OSX 10.8.4).
I have a movie player application consisting of little more than a QMediaPlayer and a QVideoWidget. Video from a local file URL plays fine.
I can connect and monitor the player's mediaStatusChanged and positionChanged signals, and increase the rate at which they're reported with QMediaPlayer::setNotifyInterval to several times per second.
This all seems to work fine except for one annoying thing:
When the player reaches the end of the file, it doesn't change status, it just reports the same position repeatedly. Only (and this is where things get strange) if I resize the window or minimise/maximise it, does it seem to "flush out" the expected status change to QMediaPlayer::EndOfMedia. Even just raising another application to cover the video app seems to flush the status change.
Any suggestions? Bug in QMediaPlayer? Me doing something wrong? Suggestions for workrounds?
Update: Now reported in Qt Jira.

QuickTime Player inside mediaelements.js - strange bug

developers.
I'm using mediaelements.js plugin for displaying video on a site, I'm developing. So the problem is that when I open the url with Firefox 3.6 on Mac with MACOS, QuickTime player is show inside the mejs player:
http://gyazo.com/70dc452527ac8e219497e7b193d88d17.png?1354549129
If anybody can tell me why is that happening, I'll be very happy.
Thanks in advance,
Le Koki
It doesnt look like the MEJS is even getting fired. did you instantiate MediaElementPlayer?

Ipad MPMovieplayerController video loads but automatically pauses when played

I am trying to get the MPMovieplayerController to work. I load a video everything goes wel i even see the first frame but then it automatically pauses, if i press play it pauses again. In the simulator it works perfectly but on the ipad device it gives the problem. I can even seek through the video and i see the frame i seeked to but nothing plays. This is some output from the console:
2010-06-08 22:16:13.145 app[3089:207] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
[Switching to thread 12803]
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/VCH263.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/H264H2.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/MP4VH2.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/JPEGH1.videodecoder" (file not found).
2010-06-08 22:16:15.145 app[3089:207] setting file:///private/var/mobile/Applications/46CE5456-6338-4BBF-A560-DCEFF700ACE0/tmp/MediaCache/
I dont get those warning when using the simulator BTW.
Does anyone know how to fix this ?
Set the property "useApplicationAudioSession" of the MPMoviePlayerController to "NO" to resolve the problem.
Found the solution just restart the ipad and it works again weird but thats it :)
Had the same problem. Video was playing ok on simulation but not on device. The problem was either on my HTML5 code embeded in the UIView or on the mp4 video compression, I don't know what fixed it but I suggest you try both. I am still getting the error when I am testing the video on the device, but the video plays just fine!
I had an issue on the device where the video would show up but not play. I could scrub. The fix for me was that I was using the avaudiorecorder, and I was releasing it before playing the video without stopping the audio recorder. My solution was to add the stop call to the recorder before starting the video:
[recorder stop];
[recorder release];
Avaudioplayer was causing my problem. Apperently on the iPad Avaudioplayer and Mpmovieplayercontroller cannot both play at the same time.
If an Avaudioplayer object is open the Mpmovieplayer will only display a frame and immediately stop playing.
As far as I can tell this only happens with iPad device 3.2.1 and SDK 4.0.1; simulators and the iPhone work fine
I switched back to Audioservices since I need Audioplayer and Movieplayer to play at the same time.

simple record and play application!

I am trying to make a simple application which will store the sound said by user , say on click of record button and will play it back to him/her , say on click of play button.
Can anyone suggest me some appropriate way to do this ??
Thanks,
Miraaj
You can use QuickTime Kit's capture APIs to record a movie of the audio, and QTMovie (from the same framework) to convert it to a more conventional format for audio files and to play back both the intermediate file and the converted file.
There used to be a QuickTime Kit Programming Guide, but it didn't cover capturing and is now gone from developer.apple.com. You should file a bug against the docs.
This answer will work in a Cocoa (Mac) app. If you meant to ask about the iPhone, you should re-tag your question, as the solution will be completely different for a Cocoa app vs. a Cocoa Touch (iPhone) app.
I used direct sound to create an entire internet phone application a few years ago. Your question is far simpler, you won't have to deal with the circular buffer as critically. Direct sound is pretty main stream and you can find a lot of help with it in forums, and it's free!

Resources