I need to implement my react app project for ironSource, and i’m struggling with one problem. I have an mediaPlayer in my project, that looks like this:
const VideoPlayer = () => {
const [muted, setMuted] = useState(true);
const handleVideoInteraction = () => {
if (muted) {
setMuted(false);
} else {
openStore();
document.getElementById("myVideo").pause();
}
};
return (
<div className={s.playerWrapper} onClick={handleVideoInteraction}>
{showBlur && (
<div className={s.blurWrapper} onClick={openStore}>
<div className={`${s.blur}`} />
<p className={s.tapToSee}>tap to see more</p>
</div>
)}
<video
className={`${s.video}}
width="430"
height="730"
autoPlay
muted={muted}
playsInline
id="myVideo"
>
<source
src=<videoSrc>
type="video/webm"
/>
Your browser does not support the video tag.
</video>
</div>
);
};
its inside of my app:
export default VideoPlayer;
const App = () => {
const muteVideo = (volume) => {
const mediaElements = document.querySelectorAll("audio, video");
mediaElements.forEach((element) => {
if (volume > 0) {
element.muted = true;
} else {
element.muted = false;
}
});
};
window.muteAllVideo = muteVideo;
return <Playable />;
and then i have mandatory event listener for ironSource Network ‘audioVolumeChange’
i’m trying to do this:
dapi.addEventListener("audioVolumeChange", (volume) =>
audioVolumeChangeCallback(volume)
);
}
function audioVolumeChangeCallback(volume) {
window.muteAllVideo(volume);
}
Idea is that this event fires when user tries to mute app via iPhone switcher and this must mute my app, but in reality sound does not mute. I keep getting one response from ironSource QA
Critical bugs: Issue on all devices: Creative is playing sound even though the player mute button is enabled. To fix this issue make sure to add a listener to the audioVolumeChange event, read more on our DAPI implementation guideline (link: https://developers.is.com/ironsource-mobile/general/interactive-requirements/
I tried everything already. Maybe someone here can help, please.
I keep getting one response from ironSource QA
Critical bugs: Issue on all devices: Creative is playing sound even though the player mute button is enabled. To fix this issue make sure to add a listener to the audioVolumeChange event, read more on our DAPI implementation guideline (link: https://developers.is.com/ironsource-mobile/general/interactive-requirements/