set the ad volume to 0 when the player is muted on iOS
This commit is contained in:
parent
edf7eee287
commit
9519c7bae7
@ -76,6 +76,10 @@ class RCTIMAAdsManager: NSObject, IMAAdsLoaderDelegate, IMAAdsManagerDelegate {
|
|||||||
// MARK: - IMAAdsManagerDelegate
|
// MARK: - IMAAdsManagerDelegate
|
||||||
|
|
||||||
func adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent) {
|
func adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent) {
|
||||||
|
// Mute ad if the main player is muted
|
||||||
|
if (_video.isMuted()) {
|
||||||
|
adsManager.volume = 0;
|
||||||
|
}
|
||||||
// Play each ad once it has been loaded
|
// Play each ad once it has been loaded
|
||||||
if event.type == IMAAdEventType.LOADED {
|
if event.type == IMAAdEventType.LOADED {
|
||||||
adsManager.start()
|
adsManager.start()
|
||||||
|
@ -496,6 +496,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
applyModifiers()
|
applyModifiers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
func isMuted() -> Bool {
|
||||||
|
return _muted
|
||||||
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
func setMuted(_ muted:Bool) {
|
func setMuted(_ muted:Bool) {
|
||||||
_muted = muted
|
_muted = muted
|
||||||
|
Loading…
Reference in New Issue
Block a user