WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
226889
[Swift] [iOS 14.5] - Incorrect playback state reported by requestMediaPlaybackState on website first launch
https://bugs.webkit.org/show_bug.cgi?id=226889
Summary
[Swift] [iOS 14.5] - Incorrect playback state reported by requestMediaPlaybac...
Nishant Bhasin
Reported
2021-06-10 11:31:27 PDT
Created
attachment 431098
[details]
Screen recording of simulator showing incorrect state reported by requestMediaPlaybackState Hi, I work on Firefox iOS and wanted to try out the following code that allows us to request media playback state. However I always get media state as `playing` on first launch of website. Steps to reproduce: - Open a media website (Ex. youtube, soundcloud) using WKWebView - When the website is fully loaded try to run the following code on the same website to get its media state Actual result: - The code will always print playing on first launch even though nothing is playing Expected result: - The code should show paused or suspended as there is no media playing on those websites ``` webView.requestMediaPlaybackState({ state in switch state { case .none: print("TAB - none") case .paused: print("TAB - paused") case .playing: print("TAB - playing") case .suspended: print("TAB - suspended") @unknown default: fatalError() } }) ``` API Link:
https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h#L377
Attachments
Screen recording of simulator showing incorrect state reported by requestMediaPlaybackState
(13.76 MB, video/quicktime)
2021-06-10 11:31 PDT
,
Nishant Bhasin
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-06-17 11:32:30 PDT
<
rdar://problem/79462265
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug