Mayil-AI-Sandbox / vlc-ios

Clone of vlc ios for debugging
Other
1 stars 0 forks source link

Remaining time: Invalid display when the playback starts #1

Open NobleMathews opened 3 months ago

NobleMathews commented 3 months ago

The remaining time displayed above the progress bar does not display the correct value when the playback starts. It seems that the issue happens during the buffering state:

mayil-ai[bot] commented 3 months ago

To address the incorrect remaining time displayed above the progress bar during the buffering state, follow these steps:

- (void)updateTransportBarPosition
{
    VLCPlaybackService *controller = [VLCPlaybackService sharedInstance];
    VLCTransportBar *transportBar = self.transportBar;

    if (controller.mediaPlayer.state == VLCMediaPlayerStateBuffering) {
        transportBar.remainingTimeLabel.text = NSLocalizedString(@"Buffering...", nil);
    } else {
        transportBar.remainingTimeLabel.text = [[controller remainingTime] stringValue];
    }

    transportBar.markerTimeLabel.text = [[controller playedTime] stringValue];
    transportBar.playbackFraction = controller.playbackPosition;
}
- (void)playbackPositionUpdated:(VLCPlaybackService *)controller
{
    [self updateActivityIndicatorForState:controller.mediaPlayer.state];

    if (self.bottomOverlayView.alpha != 0.0) {
        [self updateTransportBarPosition];
    }
}

Remember to use the NSLocalizedString function for the buffering placeholder text to support localization, and ensure that the VLCMediaPlayerStateBuffering constant is correctly referenced according to the VLC-iOS project's conventions.

Code snippets to check

mayil-ai[bot] commented 3 months ago

To address the incorrect remaining time displayed above the progress bar in the iOS mobile app during the buffering state, follow these steps:

Please note that the methods timeIsValid and calculateRemainingTime are hypothetical and should be replaced with the actual methods used in your codebase to validate the time value and calculate the remaining time. The provided code snippets are conceptual and should be adapted to fit the actual implementation details of your application.

Here are some code snippets that may help you get started:

💡 To rerun Mayil, comment mayil-ai rerun on this issue. Mayil will incorporate any new context added to the ticket. For specific guidance, include additional details in your rerun comment!