hmhv/YoutubePlayer-in-WKWebView

Cannot get time play on videos

Opened this issue · 1 comments

We have this error
Screen Shot 2022-03-29 at 15 31 20

Step to reproduce this issue:
1 - Play a youtube video using this framework
2 - debug and get value of getCurrentTime. It will appear 0
3 - Change mode in Portrait or Landscape mode.
4 - Repeat step 2

If we debugging on this code to get the time of the video, we always get 0
Screen Shot 2022-03-29 at 15 51 32
getCurrentTime is from YoutubePlayer-in-WKWebView

Framework YoutubePlayer-in-WKWebView

hmhv commented

I checked it with fixed example code and i can get correct current time.
Did you play any special movie?

    } else if (sender == self.pauseButton) {
        [self.playerView getCurrentTime:^(float time, NSError * _Nullable error) {
            if (!error) {
                [wself appendStatusText:[NSString stringWithFormat:@"pause time: %.0f seconds\n", time]];
            }
        }];
        [self.playerView pauseVideo];
    } else if (sender == self.reverseButton) {

スクリーンショット 2022-04-01 23 48 17