Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Example of iOS application with two players

This example demonstrates how two or more players can be displayed in one application. Each of the players can be used to play a different stream.

Work with code of the example

To analyze the code, let's take TwoPlayers example version with hash 088a74d, which can be downloaded with build 2.2.4.

View class for the main view of the application: ViewController (header file ViewController.h; implementation file ViewController.m).

Functions of establishing connection, creating stream and starting playback work the same as described in the example Player.
Unlike the example Player, method for establishing connection is called when Connect button is tapped.

(ViewController.m, line 253)

[self connect]; 


This example has two views for displaying video and two corresponding Play buttons; corresponding method is called to start playing when one of the buttons is tapped.

(ViewController.m, line 270)

[self play1Stream]; 


(ViewController.m, line 291)

[self play2Stream]; 


Playback is stopped when corresponding Stop button is tapped: FPWCSApi2Stream method stop is called for corresponding stream

(ViewController.m, line 262)

[player1Stream stop:&error]; 


(ViewController.m, line 283)

[player2Stream stop:&error]; 
  • No labels