Bug 1647522 - [1.0] Dispatch onFullscreen without metadata when there is an existing media session. r=geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D91476
This commit is contained in:
Eugen Sawin 2020-10-01 13:30:53 +00:00
Родитель 0262bd4e96
Коммит 4730cbf48f
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -55,7 +55,7 @@ class GeckoViewMediaControl extends GeckoViewChildModule {
if (element && !mediaElement) {
// Non-media element fullscreen.
return;
debug`No fullscreen media element found.`;
}
const message = {

Просмотреть файл

@ -305,16 +305,19 @@ public class MediaSession {
/**
* The duration of the media in seconds.
* 0.0 if unknown.
*/
public final double duration;
/**
* The width of the video in device pixels.
* 0 if unknown.
*/
public final long width;
/**
* The height of the video in device pixels.
* 0 if unknown.
*/
public final long height;
@ -726,7 +729,8 @@ public class MediaSession {
final long features = Feature.fromBundle(
message.getBundle("features"));
delegate.onFeatures(mSession, mMediaSession, features);
} else if (FULLSCREEN_EVENT.equals(event)) {
} else if (FULLSCREEN_EVENT.equals(event) &&
mMediaSession.isActive()) {
final boolean enabled = message.getBoolean("enabled");
final ElementMetadata meta =
ElementMetadata.fromBundle(