AVErrorFailedToParse error thrown - ios

Can anyone provide anymore information on why I might get AVErrorFailedToParse when using MPMoviePlayerViewController.
AVError.h lists the error, but doesn't provide any other info.
AVErrorFailedToParse NS_AVAILABLE(10_10, 8_0) = -11853,
The error happens intermittently. So I'll try and play a mp4 and it will fail with this error, i'll try again immediately afterwards and it works.

Related

Sentry error - IndexSizeError: The index is not in the allowed range

I am getting this error from Sentry repetitively in ios - safari 14.0 in react project.
There is no code trace and no other information than this but it repeats in almost every URL.
I have already searched for the options everywhere. I have tried debugging but I can't replicate it, and so I can't resolve it.
Does anyone know what does this error means? Or how can I add debug information in Sentry?
I have been looking for the solution for a while and couldn't get it. I know it's a bit lack of information to provide but that's why I am asking this. if someone can tell me how to deal with sentry errors if you don't know why it is repeating so often, it will be really helpful.
A similar issue still exists.
Faced this in Safari when Draft.js is updating the editor state.
The error which I see: IndexSizeError: The index is not in the allowed range.
For me, playing around with Paragraph Directioncontext menus items after right-clicking on the Editor selection reproduced the error.
My Solution/hack:
Add it to any JS file executing before the Editor file.
const nativeSelectionExtend = Selection.prototype.extend;
Selection.prototype.extend = function (...args) {
try {
return nativeSelectionExtend.apply(this, args);
} catch (error) {
console.log('Selection error.', error);
}
};
It works properly for me. Maybe will be useful for somebody as well.
Thanks to https://github.com/shpakkdv

Logging Additional Information for Error Reporting

In our error logging, we are using Crashlytics.
Now there are 2 ways that we log errors:
The automatic logging (when the app has crashed) done when the app starts up again.
Immediate logging using the Swift SDK
In case 1. it seems that there is no way of logging additional information.
However, in case 2. we use the following call :
Crashlytics.sharedInstance().recordError(error, withAdditionalUserInfo:additionalInfo)
With additionalInfo being a simple set of KVP's ["ListingNumber": "abcAsEasyAs123"]
However, this does not show up on the portal as well as in the .txt download that they offer.
We then amended our logging method to try and attach the additional info to the error itself.
if let error = error {
let newError = NSError(domain: (error as NSError).domain, code: (error as NSError).code, userInfo: ["ListingNumber": "abcAsEasyAs123"])
Crashlytics.sharedInstance().recordError(newError)
}
However, even in this case, the additional info is nowhere to be found.
According to the documentation, this should be possible, but nothing I am doing is showing.
EDIT: This is not a duplicate of that question as I have read it and referenced the same material that the accepted answer used.

Sound Effect Won't Play (XCode/Swift)

So I am following through an old tutorial and I think with the changes in xcode and swift this code is now no longer usable, but i am not sure. Would love some help.
Declaring constant for the audio effect
let cannonSound = SKAction.playSoundFileNamed("cannon.wav", waitForCompletion: false)
Calling the audio effect within my funtion
let hotdogSequence = SKAction.sequence([cannonSound, moveHotdog, deleteHotdog])
hotdog.run(hotdogSequence)
For more info I am using SpriteKit in Xcode and this code is contained within GameScene.swift file.
Update:
The error I receive is
2017-03-30 00:52:43.631 Ballpark Weiner[95999:1983181] SKAction: Error loading sound resource: "cannon.wav"
The game doesn't crash just no sound plays
This message usually means that the file cannot be found in your project or might be corrupt.
You should check that the file is actually copied into your project and is spelled correctly. Its case sensitive so if the actual file is called "Cannon.wav" it will not work.
Hope this helps

unsupported video format handling

I am using MPMoviePlayerController to play videos. I want to show an alert to user when the given video does not have a supported format. But I am not getting any error from SDK about it.
When I try to run any unsupported video , it leaves me with MPMovieFinishReasonPlaybackEnded and the following error in the console.
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
Does anyone know about how to handle it?
Have you tried examining the errorLog property of MPMoviePlayerController?
I got the solution for this.
[[[notification userInfo]valueForKey:#"error"] localizedDescription];
This works for me and gives "can not open" for the unsupported formats. Hope it helps others looking for similar problems.

Heroku - ActionView::Template::Error

I adding in my rails app "audiojs" music player (http://kolber.github.com/audiojs/)
on localhost all good and work, but heroku says:
"We're sorry, but something went wrong."
log
ActionView::Template::Error (audiojs/audio.min.js isn't precompiled)
how to solve the problem?
The problem is in your main page javascript. You're trying to load a track, but the elements you're looking for don't exist so you're getting the undefined error.
var audio = a[0];
first = $('ol a').attr('data-src');
// Add this code to layouts/application.html.erb
// First is coming back undefined on your root route.
if (first == undefined)
console.log("First is undefined! Will cause error in audio track");
$('ol li').first().addClass('playing');
audio.load(first);
Whereas, you're setting data-src="<%= show.preview %>" in releases/show.html.erb (and index.html.erb) and the code works without issue there.
Your options are to detect if there are no order list items and not try to automatically play an audio track, or add audio tracks to your main page.

Resources