To summarize my question:
I have the same structure of manifest as in that example https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/creating_a_master_playlist:
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/low/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/lo_mid/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/hi_mid/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=640000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/high/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=64000,CODECS="mp4a.40.5"
http://example.com/audio/index.m3u8
And case the next: I play the video with audio (by AVPlayer)-> tap button “Audio mode” and want to switch to “Only audio mode” and play only http://example.com/audio/index.m3u8. without downloading video chunks. Also vice versa(switch from audio only to audio with video). Is It possible?
What I have tried:
Select media option selectMediaOption as described in developer.apple.com/documentation/avfoundation/mediaplaybackandselection/selectingsubtitlesandalternativeaudiotracks
Remove player from view as described in developer.apple.com/documentation/avfoundation/mediaplaybackandselection/creatingabasicvideoplayeriosandtvos/playingaudiofromavideoassetinthebackground
Set player view frame to 0x0
All above options together
And the result in all cases the same: Audio is playing but I see(by Charles proxy) that AVPLayer also download video chunks. Is it possible to avoid downloading video chunks and save user traffic?
Topic:
Media Technologies
SubTopic:
General
Tags: