比较修订

Control de audio o reproducción de video con tu teclado

修订版本 209463:

由robertobeneditcontador于提交的修订 209463

修订版本 243244:

由edgarrod71于提交的修订 243244

关键词:

搜索结果概要:

This page explains the technical documentation on how to control media in Firefox by using the Media Session API.
Esta página explica la documentación técnica en cómo controlar los medios en Firefox usando la API para Sesión de Medios.

内容:

__TOC__ {for not fx81}{note}This article applies to a feature that's available on Firefox 81 and over.{/note}{/for} =What is the media control feature?= You control media (audio or video) playback inside Firefox without clicking on the video or audio itself. You can now control it by pressing the hardware control buttons on a keyboard or headset, pressing the button on the virtual control interface or by ending commands via specific protocol, such as [https://specifications.freedesktop.org/mpris-spec/2.2 MPRIS]. {note}This depends on website developers using the [https://w3c.github.io/mediasession/ MediaSession API].{/note} =What platform supports this feature?= You can use this feature on MacOS (OSX 10.12.1 or above), Windows (Windows 8.1 or above), Linux (gtk-based distributions). =How are media control supported?= *Physical hardware media control keys: *Virtual media control keys, each platform has different virtual controller interfaces, which are implemented by different platform frameworks: **[https://bug1615665.bmoattachments.org/attachment.cgi?id=9129321 Interface on Windows] (using [https://docs.microsoft.com/en-us/uwp/api/windows.media.systemmediatransportcontrols SMTC]) **[https://snapforum.s3.amazonaws.com/original/1X/4d50bdd4cd114266fe60aa7e0175f06173c19846.jpg Interface on Linux] (using [https://specifications.freedesktop.org/mpris-spec/2.2/ MPRIS]) **[https://media.idownloadblog.com/wp-content/uploads/2016/10/MacBook-Pro-Touch-Bar-Control-Strip-005.jpg Interface on MacOS touch bar] (using [https://developer.apple.com/documentation/mediaplayer MediaPlayer]) *Using an app which uses platform specific API to involve controlling media: =What kinds of media can be controlled by this feature?= Currently we only support controlling media playing from '''audio''' and '''video''', so it '''cannot''' control media from web-audio, web-speech and Flash plugin. *If an audible media is playing from audio and video, then it’s able to be controlled. *If a playable media enters fullscreen *If a playable media enters picture-in-picture mode =What kinds of media can NOT be controlled by this feature?= Mediafrom '''web-audio''', '''web-speech''' and '''Flash plugin''' cannot be controlled. There are some exceptions: *Inaudible media (silent videos that don't have an audio track, such as GIF-like images) *Notification sounds =If I have multiple tabs playing media, which tab would be controlled?= If there are multiple tabs playing at the same time, you could control the last tab playing media, unless you are playing in [[About Picture-in-Picture in Firefox | Picture-in-Picture mode]]. In this case, then picture-in-picture video belongs to would always be the tab that is being controlled. =Why sometimes when I press media control keys, it controls other apps but not Firefox? Or, other apps are also being controlled at the same time?= Each platform has its own mechanism for which applications control audio. In some cases, multiple applications might try to control the media keys at the same time. If this happens, try to close any other apps that are trying to control your media control keys.
__TOC__ {for not fx81}{note}Este artículo aplica a una característica que está disponible desde Firefox 81 en adelante.{/note}{/for} =¿Qué es la característica de control de medios?= Puedes controlar la reproducción de medios (audio o video) dentro de Firefox sin hacer click en el video o audio. Puedes ahora controlarlo presionando los botones de control de hardware en un teclado o audífonos, presionando el botón en la interfaz de control virtual o enviando comandos por medio de un protocolo específico, como [https://specifications.freedesktop.org/mpris-spec/2.2 MPRIS]. {note}Esto depende en los desarrolladores de sitios web que usan [https://w3c.github.io/mediasession/ MediaSession API].{/note} =¿Qué plataforma soporta esta característica?= Puedes usar esta característica en MacOS (OSX 10.12.1 o posteriores), Windows (Windows 8.1 oposteriores), Linux (distribuciones basadas en Gtk). =How are media control supported?= *Physical hardware media control keys: *Virtual media control keys, each platform has different virtual controller interfaces, which are implemented by different platform frameworks: **[https://bug1615665.bmoattachments.org/attachment.cgi?id=9129321 Interface on Windows] (using [https://docs.microsoft.com/en-us/uwp/api/windows.media.systemmediatransportcontrols SMTC]) **[https://snapforum.s3.amazonaws.com/original/1X/4d50bdd4cd114266fe60aa7e0175f06173c19846.jpg Interface on Linux] (using [https://specifications.freedesktop.org/mpris-spec/2.2/ MPRIS]) **[https://media.idownloadblog.com/wp-content/uploads/2016/10/MacBook-Pro-Touch-Bar-Control-Strip-005.jpg Interface on MacOS touch bar] (using [https://developer.apple.com/documentation/mediaplayer MediaPlayer]) *Using an app which uses platform specific API to involve controlling media: =What kinds of media can be controlled by this feature?= Currently we only support controlling media playing from '''audio''' and '''video''', so it '''cannot''' control media from web-audio, web-speech and Flash plugin. *If an audible media is playing from audio and video, then it’s able to be controlled. *If a playable media enters fullscreen *If a playable media enters picture-in-picture mode =What kinds of media can NOT be controlled by this feature?= Mediafrom '''web-audio''', '''web-speech''' and '''Flash plugin''' cannot be controlled. There are some exceptions: *Inaudible media (silent videos that don't have an audio track, such as GIF-like images) *Notification sounds =If I have multiple tabs playing media, which tab would be controlled?= If there are multiple tabs playing at the same time, you could control the last tab playing media, unless you are playing in [[About Picture-in-Picture in Firefox | Picture-in-Picture mode]]. In this case, then picture-in-picture video belongs to would always be the tab that is being controlled. =Why sometimes when I press media control keys, it controls other apps but not Firefox? Or, other apps are also being controlled at the same time?= Each platform has its own mechanism for which applications control audio. In some cases, multiple applications might try to control the media keys at the same time. If this happens, try to close any other apps that are trying to control your media control keys.

返回历史记录