Player delegate
To customize the player's behavior, you can override JoinStoriesPlayerDelegate :
func onDismiss(dismissPlayer: JoinStoriesSDK.StoryPlayer.DismissPlayer) {
}
func onLinkClick(link: String) {
}
Standalone
In standalone mode, you need to add delegate reference in startPlayer method :
class PlayerOnlyViewController: UIViewController, JoinStoriesPlayerDelegate {
override func viewDidLoad() {
...
JoinStories.startPlayer(config: config, delegate: self) { _ in
...
}
...
}
}
Widget
In widget mode (thumb view and card view), you need to add reference to storyPlayerDelegate parameter widget :
class WidgetViewController: UIViewController, JoinStoriesPlayerDelegate {
let thumbView = BasicThumbViewController()
let cardView = ListStoryCardViewController()
override func viewDidLoad() {
...
thumbView.storyPlayerDelegate = self
cardView.storyPlayerDelegate = self
...
}
}