pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

Captions (ClosedCaptionFile) not working

Open IbrahimYildirim opened this issue 2 years ago • 1 comments

Hi,

Thank you so much for creating this package. Of all the the YouTube packages, I love this the most.

But I have issue with captions. I am adding a .srt caption file to the video, but it is not showing up.

This is how i have implemented it

  @override
  void initState() {
    _controller = PodPlayerController(
      playVideoFrom: PlayVideoFrom.youtube(
        widget.videoUrl,
        closedCaptionFile: _loadCaptions(),
        videoPlayerOptions: VideoPlayerOptions(
          mixWithOthers: true,
        ),
      ),
      podPlayerConfig: const PodPlayerConfig(
        videoQualityPriority: [1080, 720],
      ),
    )..initialise();
    super.initState();
  }

  Future<ClosedCaptionFile> _loadCaptions() async {
    final String fileContents =
        await DefaultAssetBundle.of(context).loadString('assets/captions/initiation_video.srt');
    return SubRipCaptionFile(fileContents);
  }

Using pod_player: 0.1.0 flutter: 3.3.4

IbrahimYildirim avatar Nov 08 '22 14:11 IbrahimYildirim

Please also if possible implement, an auto-generated captions for videos.

ps6067966 avatar Nov 24 '22 08:11 ps6067966