JWCastController

@interface JWCastController : NSObject

Controller for enabling casting using the JWPlayerController.

  • Player instance.

    Note

    the instance of JWPlayerController in use.

    Declaration

    Objective-C

    @property (nonatomic, weak, readwrite) JWPlayerController *_Nullable player;
  • Chromecast Application ID of the receiver application to which you wish to cast.

    Note

    Set this property to a receiver’s Application ID before scanning for devices in order to restrict the scan to Chromecast devices that support the receiver. Leaving this value nil results in scanning for all Chromecast devices.

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite)
        NSString *_Nonnull chromeCastReceiverAppID;
  • Delegate of the JWCastController.

    Note

    Delegate must adopt the JWCastingDelegate protocol. The delegate is not retained.

    Declaration

    Objective-C

    @property (nonatomic, weak, readwrite, nullable) id<JWCastingDelegate> delegate;
  • Casting device currently connected to the player.

    Note

    Set to nil if not connected to any casting devices.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) JWCastingDevice *connectedDevice;
  • List of casting devices that are currently online.

    Note

    scanForDevices must be called in order to start listening for devices.

    Declaration

    Objective-C

    @property (nonatomic, readonly)
        NSArray<JWCastingDevice *> *_Nonnull availableDevices;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Initialize the controller with a player.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPlayer:(nonnull JWPlayerController *)player;

    Parameters

    player

    JWPlayerController object currently in use.

  • Scans for casting devices.

    Declaration

    Objective-C

    - (void)scanForDevices;
  • Connects the castController to a casting device.

    Declaration

    Objective-C

    - (void)connectToDevice:(nonnull JWCastingDevice *)device;

    Parameters

    device

    The casting device to which the user would like to cast. A list of available devices can be obtained from the availableDevices property.

  • Disconnects the castController from the connected casting device.

    Declaration

    Objective-C

    - (void)disconnect;
  • Casts the file being currently reproduced by the linked JWPlayerController instance.

    Note

    You must be connected to a casting device in order to cast.

    Declaration

    Objective-C

    - (void)cast;
  • Stops the casting and resumes on the JWPlayerController instance when the cast reproduction left off.

    Note

    Calling this method does not disconnect from the casting device.

    Declaration

    Objective-C

    - (void)stopCasting;