0xced / XCDYouTubeKit

YouTube video player for iOS, tvOS and macOS
MIT License
2.92k stars 627 forks source link

Show Subtitles #377

Closed ogezue closed 4 years ago

ogezue commented 6 years ago

I have enabled to display subtitles on my youtube settings for every video, but I don't get them in AVPlayer. Is there a setting in XCDYoutubeKit to enable them?

SoneeJohn commented 6 years ago

Unfortunately, there isn’t.

ogezue commented 6 years ago

are there alternatives?

SoneeJohn commented 6 years ago

@ogezue You will most likely have to do download the video and then process it by adding the subtitles manually. If you want to show then while streaming (which is what you seem that you want) then you will have to build additional custom work.

ogezue commented 6 years ago

I don't have any idea how to achieve this. Can you point me into the right direction? Why is it working in Browser?

gonzo-oin commented 4 years ago

@ogezue You can use YouTube API for downloading subtiles and integrating manually to the AVAsset. You also can use an alternative player like VLC or ffmpeg, it may be more easy to integrate subtiles.