I wanted to try out the new VideoPlayer view for SwiftUI so got setup on the beta but I've found that it seems all AVPlayer code (that works fine on iOS 13) fails to get playback on iOS 14 beta. This is happening in both SwiftUI and UIKit projects.
An existing SwiftUI project that hooked into AVPlayerLayer demonstrating the issue can be found here: https://github.com/ChrisMash/AVPlayer-SwiftUI
Or, starting a new SwiftUI project in Xcode 12 beta and swapping the ContentView for this:
Results in no playback and the following in the console:
The playlist must be downloading ok as it figures out the duration and the bounds of the video are determined, but no segments play back.
The same happens trying to playback audio, such as the one used here: https://github.com/ChrisMash/AVPlayer-SwiftUI/blob/master/AVPlayer-SwiftUI/AudioView.swift#L101
An existing SwiftUI project that hooked into AVPlayerLayer demonstrating the issue can be found here: https://github.com/ChrisMash/AVPlayer-SwiftUI
Or, starting a new SwiftUI project in Xcode 12 beta and swapping the ContentView for this:
Code Block import SwiftUI import AVKit struct ContentView: View { private let player = AVPlayer(url: URL(string: "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8")!) var body: some View { VideoPlayer(player: player) } }
Results in no playback and the following in the console:
Code Block 2020-06-24 19:23:54.605855+0100 avplayertest[57466:2749118] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000018852e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 2020-06-24 19:23:54.607971+0100 avplayertest[57466:2748921] <CATransformLayer: 0x6000018d5c20> - changing property masksToBounds in transform-only layer, will have no effect 2020-06-24 19:23:54.608505+0100 avplayertest[57466:2748921] <CATransformLayer: 0x60000189f280> - changing property masksToBounds in transform-only layer, will have no effect 2020-06-24 19:23:54.625581+0100 avplayertest[57466:2748921] <CATransformLayer: 0x6000018c0420> - changing property masksToBounds in transform-only layer, will have no effect 2020-06-24 19:23:54.640030+0100 avplayertest[57466:2748921] <CATransformLayer: 0x600001898980> - changing property masksToBounds in transform-only layer, will have no effect 2020-06-24 19:23:54.641123+0100 avplayertest[57466:2748921] <CATransformLayer: 0x600001898940> - changing property masksToBounds in transform-only layer, will have no effect 2020-06-24 19:23:54.683197+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.683322+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.683428+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.683929+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.684047+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.684197+0100 avplayertest[57466:2749118] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:54.800758+0100 avplayertest[57466:2749119] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed 2020-06-24 19:23:55.077096+0100 avplayertest[57466:2748921] [] [19:23:55.077] fpfsi_createTrackIDArray signalled err=-12783 (kFigBaseObjectError_ValueNotAvailable) (no tracks) at /Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia_Sim/EmbeddedCoreMedia-2729.5.1.3/Prototypes/Player/FigPlayer_Stream.m:44591 2020-06-24 19:23:55.144983+0100 avplayertest[57466:2749191] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:55.145154+0100 avplayertest[57466:2749191] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:55.145271+0100 avplayertest[57466:2749191] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:23:55.280019+0100 avplayertest[57466:2749229] HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range 2020-06-24 19:23:55.280292+0100 avplayertest[57466:2749229] HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range 2020-06-24 19:23:55.292466+0100 avplayertest[57466:2749229] [aqme] 255: AQDefaultDevice (1): output stream 0: null buffer 2020-06-24 19:23:55.292861+0100 avplayertest[57466:2749229] [aqme] 1778: EXCEPTION thrown (-50): error != 0 2020-06-24 19:24:10.280929+0100 avplayertest[57466:2749117] [aqme] 182: timed out after 15.000s (0 1); suspension count=0 (IOSuspensions: ) 2020-06-24 19:24:10.281361+0100 avplayertest[57466:2749117] 244: CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681). 2020-06-24 19:24:10.422221+0100 avplayertest[57466:2749119] [] [19:24:10.422] URLAssetLoadValuesAsyncForTrackProperties signalled err=-12174 (kFigAssetError_TrackNotFound) (Asset has no tracks) at /Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia_Sim/EmbeddedCoreMedia-2729.5.1.3/Prototypes/FigAsset/FigAsset_URL.c:1636 2020-06-24 19:24:11.114546+0100 avplayertest[57466:2749474] [connection] nw_connection_add_timestamp_locked_on_nw_queue [C3] Hit maximum timestamp count, will start dropping events 2020-06-24 19:24:11.166547+0100 avplayertest[57466:2749474] [connection] nw_connection_add_timestamp_locked_on_nw_queue [C2] Hit maximum timestamp count, will start dropping events 2020-06-24 19:24:17.072454+0100 avplayertest[57466:2749546] HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range 2020-06-24 19:24:17.072842+0100 avplayertest[57466:2749546] HALB_IOBufferManager_Client::GetIOBuffer: the stream index is out of range 2020-06-24 19:24:17.084947+0100 avplayertest[57466:2749546] [aqme] 255: AQDefaultDevice (1): output stream 0: null buffer 2020-06-24 19:24:17.085684+0100 avplayertest[57466:2749546] [aqme] 1778: EXCEPTION thrown (-50): error != 0 2020-06-24 19:24:32.073777+0100 avplayertest[57466:2749128] [aqme] 182: timed out after 15.000s (1 2); suspension count=0 (IOSuspensions: ) 2020-06-24 19:24:32.087220+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.087359+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.087482+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.088921+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.089049+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.089189+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.093109+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.093268+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0 2020-06-24 19:24:32.093387+0100 avplayertest[57466:2749450] AudioObjectRemovePropertyListener: no object with given ID 0
The playlist must be downloading ok as it figures out the duration and the bounds of the video are determined, but no segments play back.
The same happens trying to playback audio, such as the one used here: https://github.com/ChrisMash/AVPlayer-SwiftUI/blob/master/AVPlayer-SwiftUI/AudioView.swift#L101