media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
893 stars 126 forks source link

How to provide subtitle without link, just plain text? #797

Open wiedymi opened 2 weeks ago

wiedymi commented 2 weeks ago

I see in code we can provide .data as subtitle, but we do not store it in temp file, only id is stored there. Is that expected?

https://github.com/media-kit/media-kit/blob/96c66171bceb7e348dc49a85ecb9ebbc7d7dc304/media_kit/lib/src/player/native/player/real.dart#L1277

alexmercerind commented 2 weeks ago

Using SubtitleTrack.data factory constructor?

wiedymi commented 2 weeks ago

@alexmercerind yes

alexmercerind commented 2 weeks ago

It should work, it's intentional. Does it fail for you?

wiedymi commented 13 hours ago

image This is my code, in subtitleContent is plain string of .ass subtitles. But it does not work.