Skip to content

Remove invalid documentation for pause method of HTMLMediaElement #1666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

thkruz
Copy link
Contributor

@thkruz thkruz commented Dec 29, 2023

Fairly simple one. Since there is no return value, the paused property should be used for testing if a media element is paused instead of the pause method.

Looking at the spec

The paused attribute represents whether the media element is paused or not.

That comment has been there 6 years, so I am not sure of the origin, but it confused me so I made the PR.

References:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/pause
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/paused

Since there is no return value, the paused property should be used for testing if a media element is paused instead.
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@@ -1811,11 +1811,11 @@
"properties": {
"property": {
"parent": {
"comment" : "Refers to either the parent WindowProxy, or itself.\n\nIt can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done automatically by prettier, but I can remove it if it is an issue. It does appear to be a valid correction as well.

@thkruz
Copy link
Contributor Author

thkruz commented Dec 29, 2023

@microsoft-github-policy-service agree

@saschanaz
Copy link
Contributor

Yeah, it has been there forever since 2015:

{
"name": "pause",
"comment": "/**\r\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\r\n */"
},

Perhaps it was somewhere from MSDN?

@saschanaz
Copy link
Contributor

LGTM

@github-actions github-actions bot merged commit fab1989 into microsoft:main Dec 29, 2023
Copy link
Contributor

Merging because @saschanaz is a code-owner of all the changes - thanks!

@thkruz
Copy link
Contributor Author

thkruz commented Dec 29, 2023

Yeah, it has been there forever since 2015:

Haha yea when I saw that I assumed I was wrong since no one else has fixed it.

Perhaps it was somewhere from MSDN?

I couldn't find it on google, but who knows what i might have found back then.

Regardless, glad to help. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants