Skip to content

Commit ec5881b

Browse files
committed
Allow installing OpenH264 plugin on the fly
Like for webdriver this patch adds a path to prompt to allow downloading the OpenH264 plugin for Firefox if not already installed.
1 parent c5d416e commit ec5881b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tools/wpt/run.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,20 @@ def setup_kwargs(self, kwargs):
336336
kwargs["extra_prefs"].append("media.navigator.streams.fake=true")
337337

338338
if kwargs.get("gmp_path") is None and kwargs["browser_channel"] is not None:
339-
openh264_dir = os.path.join(
340-
self.browser._get_browser_binary_dir(
341-
self.venv.path, kwargs["browser_channel"]
342-
),
343-
"gmp-gmpopenh264",
339+
binary_dir = self.browser._get_browser_binary_dir(
340+
self.venv.path, kwargs["browser_channel"]
344341
)
342+
openh264_dir = os.path.join(binary_dir, "gmp-gmpopenh264")
343+
344+
if not os.path.isdir(openh264_dir):
345+
if self.prompt_install("OpenH264 GMP plugin"):
346+
logger.info("Downloading OpenH264 plugin")
347+
self.browser.install_openh264(
348+
binary_dir=binary_dir,
349+
binary=kwargs["binary"],
350+
channel=kwargs["browser_channel"],
351+
)
352+
345353
if os.path.isdir(openh264_dir):
346354
dirs = os.listdir(openh264_dir)
347355
openh264_dir = os.path.join(openh264_dir, dirs[0]) if dirs else None

0 commit comments

Comments
 (0)