EcoCDN P2P WebRTC
  • Introduction
  • HLS INTEGRATION
  • HTML5 Players
  • VideoJS Player
  • Android Integration
    • Environment Configuration
    • Import Android-SDK
    • Quick Start
    • Advanced Usage
    • API & Config
  • IOS INTEGRATION
    • Requirements
    • Project Setup
    • Integration
    • Advanced Usage
Powered by GitBook
On this page
  • Switch Stream URL
  • Stop P2P
  • Stop P2P and Local Proxy

Was this helpful?

  1. IOS INTEGRATION

Advanced Usage

Switch Stream URL

When Switching to a new stream URL, before passing new stream url(m3u8) to the player, pass that URL through SWCP2pEngine instance:

swift

let newParsedURL = SWCP2pEngine.sharedInstance().parse(streamURL: NEW_ORIGINAL_URL)

objective-c

NSURL *newParsedURL = [[SWCP2pEngine sharedInstance] parseStreamURL:NEW_ORIGINAL_URL];

Stop P2P

Stop p2p streaming of current source, but keep local proxy working:

swift

override func viewDidDisappear(_ animated: Bool) {
    SWCP2pEngine.sharedInstance().stopP2p()
}

objective-c

- (void)viewDidDisappear:(BOOL)animated {
    [SWCP2pEngine.sharedInstance stopP2p];
}

Stop P2P and Local Proxy

Stop p2p streaming of current source and local proxy:

swift

SWCP2pEngine.sharedInstance().shutdown()

objective-c

[SWCP2pEngine.sharedInstance shutdown];
PreviousIntegration

Last updated 3 years ago

Was this helpful?