Revert "add basic support for mediaSession"
This reverts commit edd5eeb4c0.
It break prepare mode on Android devices.
This commit is contained in:
@@ -22,20 +22,7 @@ function AudioPlayer(props) {
|
|||||||
const [timerCount, setTimerCount] = useState(0);
|
const [timerCount, setTimerCount] = useState(0);
|
||||||
const [timerID, setTimerID] = useState(null);
|
const [timerID, setTimerID] = useState(null);
|
||||||
|
|
||||||
// init mediaSession API
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
navigator.mediaSession.setActionHandler("stop", () => {
|
|
||||||
props.setPlayingFile({});
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// media session related staff
|
|
||||||
navigator.mediaSession.metadata = new window.MediaMetadata({
|
|
||||||
title: props.playingFile.filename,
|
|
||||||
album: props.playingFile.foldername,
|
|
||||||
artwork: [{ src: "/favicon.png", type: "image/png" }],
|
|
||||||
});
|
|
||||||
// no playing file
|
// no playing file
|
||||||
if (props.playingFile.id === undefined) {
|
if (props.playingFile.id === undefined) {
|
||||||
setPlayingURL("");
|
setPlayingURL("");
|
||||||
@@ -75,7 +62,7 @@ function AudioPlayer(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [props.playingFile, raw, prepare, selectedFfmpegConfig]);
|
}, [props.playingFile.id, raw, prepare, selectedFfmpegConfig]);
|
||||||
|
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user