Bug 225532 - [iOS] fix inconsistency around the meaning of `rate` and `defaultPlaybackRate` between WebKit and AVKit
Summary: [iOS] fix inconsistency around the meaning of `rate` and `defaultPlaybackRate...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-07 11:52 PDT by Devin Rousso
Modified: 2021-08-09 19:25 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.37 KB, patch)
2021-05-07 11:54 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (3.35 KB, patch)
2021-05-07 12:45 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-05-07 11:52:58 PDT
In AVKit, the `defaultPlaybackRate` is used when playback starts, such as resuming after pausing.

In WebKit, however, `defaultPlaybackRate` is only used when first loading and after ending scanning, instead using the `playbackRate` is used in all other cases, including when resuming after pausing.
Comment 1 Devin Rousso 2021-05-07 11:53:14 PDT
<rdar://problem/77629276>
Comment 2 Devin Rousso 2021-05-07 11:54:55 PDT
Created attachment 428016 [details]
Patch
Comment 3 Peng Liu 2021-05-07 12:23:28 PDT
Comment on attachment 428016 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=428016&action=review

> Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm:130
> +    [m_playerController setRate:isPlaying ? playbackRate : 0.];

Is this change intended?

> Source/WebCore/platform/ios/WebAVPlayerController.mm:201
> +    // ending scanning, instead using the `playbackRate` is used in all other cases, including when

Nit.
s/instead using/instead/
Comment 4 Devin Rousso 2021-05-07 12:37:08 PDT
Comment on attachment 428016 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=428016&action=review

>> Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm:130
>> +    [m_playerController setRate:isPlaying ? playbackRate : 0.];
> 
> Is this change intended?

Yes.  This is because ultimately we want the `rate` to be the source of truth, so we want to set it last.

>> Source/WebCore/platform/ios/WebAVPlayerController.mm:201
>> +    // ending scanning, instead using the `playbackRate` is used in all other cases, including when
> 
> Nit.
> s/instead using/instead/

Oops, will change :)
Comment 5 Devin Rousso 2021-05-07 12:45:36 PDT
Created attachment 428025 [details]
Patch
Comment 6 EWS 2021-05-07 15:01:07 PDT
Committed r277203 (237475@main): <https://commits.webkit.org/237475@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428025 [details].