swiftavfoundationavplayeravplayeritemavplayerlayer

Avplayer implement subtitles using .srt file in iOS swift


How to implement subtitles using .srt file with avplayer in iOS. When using the avplayer is there a way to use .srt file in avplayer to show the subtitle on the player


Solution

  • You can't just put .srt file in your AVPlayer and show them. If you can put subtitles inside your .m3u8 HLS stream on server side - this will be the solution to handle subtitles by AVPLayer automatically.

    Until then - I'm using this library

    Very simple to use and is handling all for you.