Posts

Post not yet marked as solved
0 Replies
394 Views
Hello everyone! Recently our backend team integrated video streaming via HLS, before we had default HTTP streaming. With HTTP streaming this exporting code worked fine: private func cacheFile(from asset: AVURLAsset) {         guard asset.isExportable,               let fileName = asset.url.pathComponents.last,               let outputURL = self.cacheDirectory?.appendingPathComponent(fileName), !FileManager.default.fileExists(atPath: outputURL.path)         else { return }         asset.resourceLoader.setDelegate(self, queue: backgroundQueue.underlyingQueue)         let exporter = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHighestQuality)         exporter?.outputURL = outputURL         exporter?.determineCompatibleFileTypes(completionHandler: { types in             guard let type = types.first else { return }             exporter?.outputFileType = type             exporter?.exportAsynchronously(completionHandler: {                 if let error = exporter?.error { print(error)                 }             })         })     } This code works great with HTTP streaming, but for HLS asset.isExportable is equal to false. After removing check for asset.isExportable exporter?.determineCompatibleFileTypes passes empty array inside closure. If setting outputFileType to .mp4 or .mov I'm receiving error inside exportAsynchronously completionHandler: Error Domain=AVFoundationErrorDomain Code=-11838 "Operation Stopped" UserInfo={NSLocalizedFailureReason=The operation is not supported for this media., NSLocalizedDescription=Operation Stopped, NSUnderlyingError=0x6000025abd50 {Error Domain=NSOSStatusErrorDomain Code=-16976 "(null)" Why does this happen? AVAssetExportSession cannot combine all parts of .m3u8 to .mp4? Is there any alternative way to cache streamed video via HLS?
Posted
by Chopyhoo.
Last updated
.
Post marked as solved
3 Replies
3.7k Views
Hi!I was working on iOS app and found out a strange behaviour of UITabBarController. In one particular case after push to UIViewController with hidden tab bar and going back it shortens the size of UITabBar. The tab bar is translucent and not opaque. This thing happens only if we previously presented UIViewController on a UISplitViewController which is embeded as one of the items of the UITabBarController.I've made a sample app to show this thing happen. https://github.com/Chopyhoo/UITabBar-testOpen the app. As you can see there is a normal sized tab bar. Go to the Present tab and tap the button in the middle of the screen.There will be presented I am presented screen. Tap the close navigation button.Then go to the Push tab and tap the Push button in the middle of the screen.You will see a screen with hidden tab bar. Go back.And here it is. The size of the tab bar is shortened. P.S. You can see that in the moment of pushing the I am pushed screen the UITabBar layout is behaving wierd
Posted
by Chopyhoo.
Last updated
.