I need to download encrypted HLS stream in tvos and save it in local file path. But AVAssetDownloadURLSession is not available in tvOS. Is there any alternative?.
Thanks
Post
Replies
Boosts
Views
Activity
In my tvos application , when the password is input via voice dictation to the textfield, the app crashes with below details.
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSConcreteMutableAttributedString attributedSubstringFromRange:: Out of bounds'
*** First throw call stack:
(0x1855a866c 0x184e6c310 0x186192110 0x19a4f7234 0x1a8687588 0x1c58d2e44 0x18b006d70 0x18b0f5484 0x1854eccc8 0x185515d54 0x1855150e8 0x18550ec78 0x18550de0c 0x188826644 0x1c5b2faf4 0x1c5b35294 0x102a0e368 0x103d3921c)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSConcreteMutableAttributedString attributedSubstringFromRange:: Out of bounds'
terminating with uncaught exception of type NSException.
Same issue could be replicated in the sample application with just a securetextentry uitextfield. Any solution/details pls help.
I reset the old player item(remove all observers also) and avplayercontroller then add a new avplayerviewcontroller instance and avplayer and player item on playing a new asset/stream etc. It works fine and no crash in tvos 14, 13 etc. But in tvos 15.2 and above i get the following stack trace.
Below are the details i could collect from firebase, please check if it could help you to infer the cause of the crash. Thanks!
Crashed: com.apple.main-thread
SIGSEGV 0x00000007f2e51110
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x7624 class_getMethodImplementation + 32
1 Foundation 0xa1f30 _NSKVONotifyingOriginalClassForIsa + 28
2 Foundation 0x9db38 _NSKeyValueObservationInfoGetObservances + 272
3 Foundation 0xa8c50 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 244
4 Foundation 0xa9540 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 68
5 Foundation 0xa2080 _NSSetObjectValueAndNotify + 284
6 AVKit 0xe6b8 -[AVInterstitialController dealloc] + 32
7 AVKit 0x356e4 -[AVPlayerControllerTVExtras .cxx_destruct] + 144
8 libobjc.A.dylib 0x7d68 object_cxxDestructFromClass(objc_object*, objc_class*) + 112
9 libobjc.A.dylib 0x1dad0 objc_destructInstance + 88
10 libobjc.A.dylib 0x24f90 _objc_rootDealloc + 52
11 libsystem_blocks.dylib 0x37f8 _Block_release + 184
12 libdispatch.dylib 0x4f84 _dispatch_client_callout + 16
13 libdispatch.dylib 0x12164 _dispatch_main_queue_callback_4CF + 916
14 CoreFoundation 0x7a698 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
15 CoreFoundation 0x74b18 __CFRunLoopRun + 2528
16 CoreFoundation 0x73bf4 CFRunLoopRunSpecific + 572
17 GraphicsServices 0x6afc GSEventRunModal + 160
18 UIKitCore 0xa9ccd0 -[UIApplication _run] + 1080
19 UIKitCore 0xaa20cc UIApplicationMain + 164
20 XXXXXXX 0xc474 (Missing UUID xxxxxxxxx…)
21 ??? 0x1030e91d0 (Missing)
I reset the old player item(remove all observers also) and avplayercontroller then add a new avplayerviewcontroller instance and avplayer and player item on playing a new asset/stream etc. It works fine and no crash in tvos 14, 13 etc.
But in tvos 15.2 and above i get the following stack trace.
Foundation - _NSKVONotifyingOriginalClassForIsa
Foundation
_NSKVONotifyingOriginalClassForIsa
Foundation
_NSKeyValueObservationInfoGetObservances
Foundation
-[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:]
Foundation
-[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:]
Foundation
_NSSetObjectValueAndNotify
AVKit
-[AVInterstitialController dealloc]
AVKit
-[AVPlayerControllerTVExtras .cxx_destruct]
let data = try JSONDecoder().decode([User].self, from: jsonData)
On analysing the memory leaks with instrument tool, this particular code always shows memory leak.
Any help to resolve this issue.
Note: User model is nested struct
self.avplayercontroller.customInfoViewController = nil
Using the nil assigning method removes the options menu but crashes intermittenly -
"Fatal Exception: NSInvalidArgumentException** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]"
Is there any other option to hide/remove options tab when needed in avplayerviewcontroller.
Radar bug which I noticed is resolved but I still get the issue intermittenly. https://openradar.appspot.com/48192193
func artWorkItem(imageToShow: UIImage) - AVMetadataItem? {
let item = AVMutableMetadataItem()
item.value = imageToShow.pngData() as (NSCopying & NSObjectProtocol)?
item.dataType = kCMMetadataBaseDataType_PNG as String
item.identifier = AVMetadataIdentifier.commonIdentifierArtwork
item.extendedLanguageTag = "und"
return item.copy() as? AVMetadataItem
}
From crash organizer stack trace crash occurs at line “item.value = imageToShow.pngData() as (NSCopying & NSObjectProtocol)?” States specialized AVMetaData.artWorkItem(imageToShow:) +252.
It also shows info like “specialized static Data_unconditionallyBridgeFromObjectiveC()”.Could not replicate the crash. What could be the reason for the crash ?. Is it some memory issue?