Post

Replies

Boosts

Views

Activity

AVPlayer: escaped characters displayed wrong from WebVTT subtitles (HLS)
quotes are displayed incorrectly in subtitles of AVPlayerViewController when streaming VOD content using HLS. single quote ' (escaped ') is displayed as apos; double quotes " (escaped ") is displayed as quot; following the vtt specification. The same stream works fine in VLC player, showing quotes correctly in subtitles. subtitle vtt files use Content-Type: text/vtt WEBVTT X-TIMESTAMP-MAP=LOCAL:490014:06:04.000,MPEGTS:158764568760056 example line: 490014:05:46.000 --> 490014:05:50.440 align:start line:83% position:14% and the playlist has: #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",LANGUAGE="da",NAME="Dansk",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound",URI="subs/dan_5/playlist.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=780000,CODECS="mp4a.40.5,avc1.42c01e",RESOLUTION=256x144,AUDIO="audio-aac",SUBTITLES="subs" lære dig endnu bedre at kende." adding 'wvtt' to CODECS list in playlist does not make a difference. Is this a known bug? Is there a workaround? I guess the AVResourceLoaderDelegate can be used to intercept and parse the subtitle files, but it seems like quite a hack and not really intended to be used for this.
2
0
955
Dec ’25
CoreMediaErrorDomain -12888: Bandwidth down-stepping when using 2sec segment duration
the problem is when using HLS live stream with AVPlayer on iOS/ tvOS the player chooses first highest bandwidth then slowly steps down to lowest (within 1-3min) and eventually steps up again then repeats to step down. the AVPlayer error log sends events: errorStatusCode: -12888, errorDomain: Optional("CoreMediaErrorDomain"), errorComment: Optional("The operation couldn't be completed. (CoreMediaErrorDomain error -12888 - Playlist File unchanged for longer than 1.5 * target duration we use standard segments in CMAF format, 2sec duration #EXTM3U #EXT-X-VERSION:6 #EXT-X-TARGETDURATION:2 #EXT-X-MEDIA-SEQUENCE:147065903 #EXT-X-MAP:URI="video_1_4660000_init.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2" #EXT-X-PROGRAM-DATE-TIME:2025-04-30T12:51:07 #EXTINF:2.000, video_1_4660000_t17460174670001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 #EXTINF:2.000, video_1_4660000_t17460174690001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 #EXTINF:2.000, video_1_4660000_t17460174710001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 when using 6sec segments the player stays stable at highest bandwidth. is there a way to avoid this error? in AVPlayer or HLS configuration?
2
0
568
May ’25
iOS app suspended state
How can I detect when my app goes from background to suspended state? or better about to be suspended.. AppDelegate has method for entering background and there's even a Notification for this, but I can't find anything about suspended. And I guess receiveMemoryWarning is not the right one.
0
0
922
Sep ’22
MPNowPlayingInfoCenter not responding - app freezes
I have an issue with updating MPNowPlayingInfoCenter when trying to read nowPlayingInfo I don't get a response leading to blocking the current thread indefinitely. I'm updating MPNowPlayingInfoCenter on main thread which results in an app freeze. func staticUpdate() {     logger.log(.debug, "start static update")     infoCenter.nowPlayingInfo = nowPlayingInfo     logger.log(.debug, "end static update") } func dynamicUpdate() {     logger.log(.debug, "start update - read")     var mpInfo = infoCenter.nowPlayingInfo ?? [String: Any]()     logger.log(.debug, "start update - write") ...     infoCenter.nowPlayingInfo = mpInfo     logger.log(.debug, "end update") } /* 2022-04-25 09:28:19.051435+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:128] start static update 2022-04-25 09:28:19.051834+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:130] end static update 2022-04-25 09:28:19.052251+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:186] start update - read */ I'm overwriting nowPlayingInfo when media changes, then I'm updating it on any status changes (progress, status,...) (see timestamps, we read ~1ms after write but never reach infoCenter.nowPlayingInfo = mpInfo) Questions: shouldn't infoCenter.nowPlayingInfo always be readable? can I update infoCenter from any queue? (this would solve only app freeze..)
1
0
967
May ’22
DispatchQueue: best way to create serial queue
Docs say: "For serial tasks, set the target of your serial queue to one of the global concurrent queues" but how exactly? DispatchQueue(label: "", target: .global(qos: .background)) // or DispatchQueue(label: "", qos: .background, target: .global(qos: .background)) or is it the same? context: We use quite a few serial queues in our app. In general each service (e.g. analytics, downloading, etc) has it's own serial queue to sync. access to it's resources.
1
0
2.0k
Sep ’21
AVPlayer: escaped characters displayed wrong from WebVTT subtitles (HLS)
quotes are displayed incorrectly in subtitles of AVPlayerViewController when streaming VOD content using HLS. single quote ' (escaped ') is displayed as apos; double quotes " (escaped ") is displayed as quot; following the vtt specification. The same stream works fine in VLC player, showing quotes correctly in subtitles. subtitle vtt files use Content-Type: text/vtt WEBVTT X-TIMESTAMP-MAP=LOCAL:490014:06:04.000,MPEGTS:158764568760056 example line: 490014:05:46.000 --> 490014:05:50.440 align:start line:83% position:14% and the playlist has: #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",LANGUAGE="da",NAME="Dansk",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound",URI="subs/dan_5/playlist.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=780000,CODECS="mp4a.40.5,avc1.42c01e",RESOLUTION=256x144,AUDIO="audio-aac",SUBTITLES="subs" lære dig endnu bedre at kende." adding 'wvtt' to CODECS list in playlist does not make a difference. Is this a known bug? Is there a workaround? I guess the AVResourceLoaderDelegate can be used to intercept and parse the subtitle files, but it seems like quite a hack and not really intended to be used for this.
Replies
2
Boosts
0
Views
955
Activity
Dec ’25
CoreMediaErrorDomain -12888: Bandwidth down-stepping when using 2sec segment duration
the problem is when using HLS live stream with AVPlayer on iOS/ tvOS the player chooses first highest bandwidth then slowly steps down to lowest (within 1-3min) and eventually steps up again then repeats to step down. the AVPlayer error log sends events: errorStatusCode: -12888, errorDomain: Optional("CoreMediaErrorDomain"), errorComment: Optional("The operation couldn't be completed. (CoreMediaErrorDomain error -12888 - Playlist File unchanged for longer than 1.5 * target duration we use standard segments in CMAF format, 2sec duration #EXTM3U #EXT-X-VERSION:6 #EXT-X-TARGETDURATION:2 #EXT-X-MEDIA-SEQUENCE:147065903 #EXT-X-MAP:URI="video_1_4660000_init.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2" #EXT-X-PROGRAM-DATE-TIME:2025-04-30T12:51:07 #EXTINF:2.000, video_1_4660000_t17460174670001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 #EXTINF:2.000, video_1_4660000_t17460174690001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 #EXTINF:2.000, video_1_4660000_t17460174710001555.mp4?device_profile=cmaf_cbcs_verimatrix_cei%26seg_size=2%26cmaf=2 when using 6sec segments the player stays stable at highest bandwidth. is there a way to avoid this error? in AVPlayer or HLS configuration?
Replies
2
Boosts
0
Views
568
Activity
May ’25
iOS app suspended state
How can I detect when my app goes from background to suspended state? or better about to be suspended.. AppDelegate has method for entering background and there's even a Notification for this, but I can't find anything about suspended. And I guess receiveMemoryWarning is not the right one.
Replies
0
Boosts
0
Views
922
Activity
Sep ’22
MPNowPlayingInfoCenter not responding - app freezes
I have an issue with updating MPNowPlayingInfoCenter when trying to read nowPlayingInfo I don't get a response leading to blocking the current thread indefinitely. I'm updating MPNowPlayingInfoCenter on main thread which results in an app freeze. func staticUpdate() {     logger.log(.debug, "start static update")     infoCenter.nowPlayingInfo = nowPlayingInfo     logger.log(.debug, "end static update") } func dynamicUpdate() {     logger.log(.debug, "start update - read")     var mpInfo = infoCenter.nowPlayingInfo ?? [String: Any]()     logger.log(.debug, "start update - write") ...     infoCenter.nowPlayingInfo = mpInfo     logger.log(.debug, "end update") } /* 2022-04-25 09:28:19.051435+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:128] start static update 2022-04-25 09:28:19.051834+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:130] end static update 2022-04-25 09:28:19.052251+0200 [Debug] [main] [NowPlayingInfoCenterController.swift:186] start update - read */ I'm overwriting nowPlayingInfo when media changes, then I'm updating it on any status changes (progress, status,...) (see timestamps, we read ~1ms after write but never reach infoCenter.nowPlayingInfo = mpInfo) Questions: shouldn't infoCenter.nowPlayingInfo always be readable? can I update infoCenter from any queue? (this would solve only app freeze..)
Replies
1
Boosts
0
Views
967
Activity
May ’22
DispatchQueue: best way to create serial queue
Docs say: "For serial tasks, set the target of your serial queue to one of the global concurrent queues" but how exactly? DispatchQueue(label: "", target: .global(qos: .background)) // or DispatchQueue(label: "", qos: .background, target: .global(qos: .background)) or is it the same? context: We use quite a few serial queues in our app. In general each service (e.g. analytics, downloading, etc) has it's own serial queue to sync. access to it's resources.
Replies
1
Boosts
0
Views
2.0k
Activity
Sep ’21