This document describes the steps required to change media.
When it is needed to change media we have to destroy the player and recreate it.
The important things to make sure is when adding the player back to the view hierarchy we need to provide is with a frame and when removing the player we need to make sure to call destroy + removing player view.
When creating the player:
// playerContainer is the view holding the player view self.playerContainer.addSubview(self.player.view) self.player.view.frame = self.playerContainer.bounds
// playerContainer is the view holding the player view [self.playerContainer addSubview:self.player.view]; self.player.view.frame = self.playerContainer.bounds;
When destroying the player:
self.player.view.removeFromSuperview() self.player.destroy() self.player = nil // now you can create the player again with your own method.
[self.player.view removeFromSuperview]; [self.player destroy]; self.player = nil; // now you can create the player again with your own method.
PlayKit iOS samples repo has a dedicated samples with more details.
Have Questions or Need Help?
Check out the Kaltura Player SDK Forum page for different ways of getting in touch.