Conversation
|
@kirill09 is this working for you? :) |
yes |
|
@kirill09 thank you sooo much for this PR :) whats about the conflicts? could you check them? |
|
@kirill09 I think these changes from you are very important and give chewie a big plus. I would appreciate it, if you have a second look here into this PR and the merge conflicts, so we can have subtitles in chewie :) |
|
I fixed the conflicts. I will check everything now. @nstrelow if you got time you can also have a quick look. Maybe I am too fast 😂 |
|
Ok, tested everything, here are my results:
subtitle: Subtitles([
Subtitle('0\n00:00:00 --> 00:00:10\nHello from Subtitles :)'),
]),
subtitleBuilder: (context, subtitle) {
return Text(subtitle);
},Honestly this is not really user or developer friendly. It's very easy in Dart to export a simple model for this. Yes, model is existing but factory constructor is horrible ^^ sorry to say that. Also: the parameter: subtitle was existing as a parameter but was not passed into the constructor, so I had to fix that. My recommendation: I'll refactor the Subtitle model to pass user-friendly parameters rather then a string like above. /cc @nstrelow Edit: I would also prefer that subtitles appear inside the Video and not in the chewie container. |
| /// Defines a custom RoutePageBuilder for the fullscreen | ||
| final ChewieRoutePageBuilder routePageBuilder; | ||
|
|
||
| Subtitles subtitle; |
There was a problem hiding this comment.
This wasn't mention in the constructor. Already fixed.
lib/src/subtitle_model.dart
Outdated
|
|
||
| static Duration stringToDuration(String value) { | ||
| final component = value.split(':'); | ||
| return Duration( |
There was a problem hiding this comment.
Added check to also pass: 00:00:00 if milliseconds not needed. Already fixed.
lib/src/subtitle_model.dart
Outdated
| } | ||
|
|
||
| class Subtitle { | ||
| factory Subtitle(String value) { |
There was a problem hiding this comment.
factory constructor will be refactored so it's more user friendly to use.
lib/src/cupertino_controls.dart
Outdated
| children: <Widget>[ | ||
| _buildTopBar(backgroundColor, iconColor, barHeight, buttonPadding), | ||
| _buildHitArea(), | ||
| _buildSubtitles(chewieController.subtitle), |
There was a problem hiding this comment.
Doesn't align relatively to the video aspect ratio. Will be fixed.
|
Is this PR ready to merged? |
Nope, I am working on it 🧑🏻💻 |
|
Hey guys 👋 Sorry for the delay. I moved many times within Germany and now I can continue my work on this important feature. I already got it working, but it's hidden by the controls and I want to make the subtitles aware of the controls. Be prepared 💪🏼 |


subtitle display