[video_player_avplay] Fixed an issue where subtitles for content with pre-roll/insesrted ads in DASH could not be rendered.#1007
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the caption selection logic in video_player.dart to include start-time checks for both text and picture captions. A logic error was identified in the picture caption implementation where the greater-than operator was used instead of the less-than operator for the start time check, which would cause captions to be hidden incorrectly during their display window.
| position > captions.pictureCaption!.end || | ||
| position > captions.pictureCaption!.start) |
There was a problem hiding this comment.
The logic for picture captions uses the wrong operator for the start time check. It should use the less-than operator (<) to hide the caption if the playback position is before the start time. Currently, it uses the greater-than operator (>), which will cause the caption to be hidden as soon as the playback reaches its intended start time.
| position > captions.pictureCaption!.end || | |
| position > captions.pictureCaption!.start) | |
| position > captions.pictureCaption!.end || | |
| position < captions.pictureCaption!.start) |
No description provided.