muted="" in video tag not working?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
roytam1

muted="" in video tag not working?

Unread post by roytam1 » 2018-02-08, 02:26

I just found that Pale Moon don't mute the video when I have a look in Baidu Tieba forum list, which contains a video tag like this:

Code: Select all

<video src="http://tb-video.bdstatic.com/tieba-smallvideo-transcode/33_2f0fcab4613e9c10669dea1f202eecbd_1.mp4" class="video_auto" autoplay="" muted="" height="135" width="240"></video>
And Pale Moon autoplays it without muting.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35478
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: muted="" in video tag not working?

Unread post by Moonchild » 2018-02-08, 13:04

This is most likely bug #1424871 -- "muted" as a property works just fine on original <video> elements.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

roytam1

Re: muted="" in video tag not working?

Unread post by roytam1 » 2018-02-09, 14:46

hmm, create a hack for that then ;)

Code: Select all

diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index d9e500a49..abca0e2ec 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3240,6 +3240,8 @@ void HTMLMediaElement::FirstFrameLoaded()

   ChangeDelayLoadStatus(false);

+  if (HasAttr(kNameSpaceID_None, nsGkAtoms::muted)) SetMuted(true);
+
   if (mDecoder && mAllowSuspendAfterFirstFrame && mPaused &&
       !HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) &&
       mPreloadAction == HTMLMediaElement::PRELOAD_METADATA) {

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35478
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: muted="" in video tag not working?

Unread post by Moonchild » 2018-02-09, 22:14

Wouldn't call that a hack, per se. Does it work as-intended?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

roytam1

Re: muted="" in video tag not working?

Unread post by roytam1 » 2018-02-10, 00:35

Moonchild wrote:Wouldn't call that a hack, per se. Does it work as-intended?
It works as-intended, but it doesn't solve not-calling DoneCreatingElement() when cloning element(which is root of this bug) so I classify it as hackfix.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35478
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: muted="" in video tag not working?

Unread post by Moonchild » 2018-02-10, 06:25

I'll keep an eye on the BZ bug then and add it as a workaround for now.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked