문제

I am writing an iOS app and I need to stream m4a files over HTTP Live Streaming. I am using AVPlayer and a HLS Simple Media Playlist file.

If I link AVPlayer directly to an mp3 or m4a, it streams with no issues.

URL = [NSURL URLWithString:@"http://fembotics.com/bells.m4a"];
item = [AVPlayerItem playerItemWithURL:URL];
player = [AVPlayer playerWithPlayerItem:item];
[player play];

The problem happens when I set URL to a HLS playlist. Strangely, mp3 works and m4a does not.

http://fembotics.com/basicmp3.m3u8 - Working

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5220
#EXTINF:20.0,
/bells.mp3
#EXT-X-ENDLIST

http://fembotics.com/basicm4a.m3u8 - Broken

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5220
#EXTINF:20.0,
/bells.m4a
#EXT-X-ENDLIST

I tried using absolute URLs in the playlists and it makes no difference.

Has anyone seen this type of issue before? Should I try other sources for my m4a files? (I tried one purchased from iTunes and one transcoded from wav by MediaHuman Audio Converter).

도움이 되었습니까?

해결책

m3u8 on iOS only supports segmented .aac an .ts containers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top