При нажатии любой кнопки управления медиа на экране блокировки происходит разблокировка экрана. До Chrome 92 такого не было. Как обойти?
Вот исходный код:
navigator.mediaSession.metadata = new MediaMetadata(
{
title: document.getElementById("SelectFile").selectedIndex + "/" + (document.getElementById("SelectFile").length - 1) + ". " + document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].value,
artist: document.getElementById("SelectPlist").selectedIndex + "/" + (document.getElementById("SelectPlist").length - 1) + ". " + document.getElementById("SelectPlist")[document.getElementById("SelectPlist").selectedIndex].value,
artwork:
[
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "96x96",
type: "image/png",
},
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "128x128",
type: "image/png",
},
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "192x192",
type: "image/png",
},
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "256x256",
type: "image/png",
},
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "384x384",
type: "image/png",
},
{
src: document.getElementById("SelectFile")[document.getElementById("SelectFile").selectedIndex].id.split("±")[1],
sizes: "512x512",
type: "image/png",
}
]
});
navigator.mediaSession.setActionHandler("seekto", (e) =>
{
document.getElementById("InputTime").value = e.seekTime;
document.getElementById("InputTime").dispatchEvent(new Event("input"));//#InputTimeInput();
});
navigator.mediaSession.setActionHandler("seekbackward", () =>
{
document.getElementById("InputTime").value = document.querySelector("video").currentTime - 5;
document.getElementById("InputTime").dispatchEvent(new Event("input"));//#InputTimeInput();
});
navigator.mediaSession.setActionHandler("seekforward", () =>
{
document.getElementById("InputTime").value = document.querySelector("video").currentTime + 5;
document.getElementById("InputTime").dispatchEvent(new Event("input"));//#InputTimeInput();
});
navigator.mediaSession.setActionHandler("previoustrack", () =>
{
document.getElementById("ButtonBack").dispatchEvent(new Event("click"));//#ButtonBackClick();
});
navigator.mediaSession.setActionHandler("nexttrack", () =>
{
document.getElementById("ButtonNext").dispatchEvent(new Event("click"));//#ButtonNextClick();
});
navigator.mediaSession.setActionHandler("play", () =>
{
document.querySelector("video").play();
});
navigator.mediaSession.setActionHandler("pause", () =>
{
document.querySelector("video").pause();
});