Comments (3)
@SeongWoo-97 did you check this??https://github.com/zezo357/flutter_meedu_videoplayer/blob/master/package/example/lib/pages/network_with_subtitle_page.dart
you have to call _controller.onClosedCaptionEnabled(true);
to show captions
from flutter_meedu_videoplayer.
Hello, I have a problem with my video player. The video works fine, but the captions are not displaying. I've checked the documentation, but it's hard to find any information about captions. Here is a part of the code I've written:
` _init() async {
final result = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['mp4', 'srt'],
allowMultiple: true,
);if (result != null) { File? videoFile; File? srtFile; for (var file in result.files) { if (file.extension == 'mp4') { videoFile = File(file.path!); } else if (file.extension == 'srt') { srtFile = File(file.path!); } } if (videoFile != null) { Future<ClosedCaptionFile>? subRipCaptionFileFuture; if (srtFile != null) { subRipCaptionFileFuture = _loadSubRipCaptionFile(srtFile); } _meeduPlayerController.setDataSource( DataSource( type: DataSourceType.file, file: videoFile, closedCaptionFile: subRipCaptionFileFuture, ), autoplay: true, ); } }
}
Future _loadSubRipCaptionFile(File srtFile) async {
final srtContent = await srtFile.readAsString();
return SubRipCaptionFile(srtContent);
}
`
I would appreciate any help or guidance on how to display captions in the video player. Thanks in advance!
That's on the desktop? I didn't really implement it there,but I will try to check on it and let you know.
from flutter_meedu_videoplayer.
Can you provide the caption file?
from flutter_meedu_videoplayer.
Related Issues (20)
- How to display the video from byte? HOT 5
- The default displayed progress bar and the position after starting playback are inconsistent! HOT 7
- The issue of 'Error connecting to the service protocol' reappears HOT 14
- [Windows] mpv-dev-x86_64-20230807-git-140ec21.7z integrity check failed. HOT 45
- Abnormal playback of the new fvp version m3u8 HOT 27
- Error: while building for IOS only HOT 6
- the youtube sample does not work on windows desktop for any url HOT 34
- Discontinued HOT 13
- Information needed HOT 2
- About Full Screen Playback HOT 1
- How to pass through param to fvp? HOT 9
- A problem occurred evaluating project ':media_kit_libs_android_video'. HOT 3
- on Windows.....error GC9768DF9: Undefined name 'NativeLibrary'. HOT 5
- thumbnailImg crash HOT 1
- The video jumps back to the beginning to speed up HOT 2
- How to get information about a video, such as width, height, and length? I seem to have not found any relevant methods. HOT 1
- Error: 'Durations' is imported from both 'package:flutter/src/material/motion.dart' and 'package:flutter_meedu_videoplayer/src/helpers/durations.dart'. this.durations = const Durations(), HOT 2
- How to load subtitles(SRT), I couldn't find this method HOT 3
- Flutter 3.16.9 macOS Unable to play video HOT 4
- How to fix this failure to play in windwos HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_meedu_videoplayer.