From f434ba3e8d764fec676add585e654d6a8e21b081 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 13 Jul 2021 00:20:02 +0530 Subject: [PATCH] Confirming to Visibility behavior --- MVMCoreUI/Behaviors/PlayAudioBehavior.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Behaviors/PlayAudioBehavior.swift b/MVMCoreUI/Behaviors/PlayAudioBehavior.swift index 12a98022..ebb9f46c 100644 --- a/MVMCoreUI/Behaviors/PlayAudioBehavior.swift +++ b/MVMCoreUI/Behaviors/PlayAudioBehavior.swift @@ -24,7 +24,8 @@ public class PagePlayAudioBehaviorModel: PageBehaviorModelProtocol { public init() { } } -public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior { +public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior, PageVisibilityBehavior { + //-------------------------------------------------- // MARK: - Active Model //-------------------------------------------------- @@ -63,6 +64,12 @@ public class PagePlayAudioBehavior: PageCustomActionHandlerBehavior { return true } + //-------------------------------------------------- + // MARK: - PageVisibilityBehavior + //-------------------------------------------------- + + public func onPageShown(_ delegateObject: MVMCoreUIDelegateObject?) { } + public func onPageHidden(_ delegateObject: MVMCoreUIDelegateObject?) { //Stop player Self.activeAudioPlayerDelegate?.pause()