TVIAppScreenSource Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | TVIVideoSource |
| Declared in | TVIAppScreenSource.h |
Overview
TVIAppScreenSource is a TVIVideoSource that allows you to stream video of the app screen. This
class manages a RPScreenRecorder internally.
– init
Initializes a TVIAppScreenSource with default options. You may set a delegate later if you wish.
- (null_unspecified instancetype)initReturn Value
A TVIAppScreenSource, or nil if one could not be created.
Discussion
When running on the simulator nil will be returned.
Declared In
TVIAppScreenSource.h
– initWithDelegate:
Initializes a TVIAppScreenSource with a delegate and default options.
- (nullable instancetype)initWithDelegate:(nullable id<TVIAppScreenSourceDelegate>)delegateParameters
delegate |
A delegate conforming to |
|---|
Return Value
A TVIAppScreenSource, or nil if one could not be created.
Discussion
When running on the simulator nil will be returned. The delegate is called on the main queue.
Declared In
TVIAppScreenSource.h
– initWithOptions:delegate:
Initializes a TVIAppScreenSource with all configuration options.
- (nullable instancetype)initWithOptions:(nonnull TVIAppScreenSourceOptions *)options delegate:(nullable id<TVIAppScreenSourceDelegate>)delegateParameters
options |
A |
|---|---|
delegate |
A delegate conforming to |
Return Value
A TVIAppScreenSource, or nil if one could not be created.
Discussion
When running on the simulator nil will be returned. The delegate is called on the main queue.
Declared In
TVIAppScreenSource.h
delegate
The source’s delegate.
@property (nonatomic, weak, nullable) id<TVIAppScreenSourceDelegate> delegateDiscussion
The delegate is called on the main queue.
Declared In
TVIAppScreenSource.h
isAvailable
Indicates whether the screen is available for capture.
@property (nonatomic, readonly) BOOL isAvailableDiscussion
When set to YES, the screen is available for capture. Screen capture can be unavailable due to unsupported
hardware, the user’s device displaying information over AirPlay or through a TVOut session, or another app using ReplayKit.
Declared In
TVIAppScreenSource.h
isCapturing
Indicates whether the screen is being captured.
@property (nonatomic, readonly) BOOL isCapturingDiscussion
When set to YES, the screen is being captured.
Declared In
TVIAppScreenSource.h
– startCapture
Starts capture. The video pipeline will start asynchronously after this method returns.
- (void)startCaptureDiscussion
The system will lock screen orientation during screen capture. When you are done capturing video using the TVIAppScreenSource
you must call either [TVIAppScreenSource stopCapture] or [TVIAppScreenSource stopCaptureWithCompletion:].
Declared In
TVIAppScreenSource.h
– startCaptureWithCompletion:
Starts capture with a completion handler.
- (void)startCaptureWithCompletion:(nullable TVIAppScreenSourceStartedBlock)completionParameters
completion |
A handler block to be called on the main queue once capture has started, or failed to start. |
|---|
Discussion
The system will lock screen orientation during screen capture. When you are done capturing video using the TVIAppScreenSource
you must call either [TVIAppScreenSource stopCapture] or [TVIAppScreenSource stopCaptureWithCompletion:].
Declared In
TVIAppScreenSource.h
– stopCapture
Stops capture asynchronously.
- (void)stopCaptureDiscussion
This method is equivalent to calling [TVIAppScreenSource stopCaptureWithCompletion:] with a nil block.
Declared In
TVIAppScreenSource.h
– stopCaptureWithCompletion:
Stops capture asynchronously with a completion handler.
- (void)stopCaptureWithCompletion:(nullable TVIAppScreenSourceStoppedBlock)completionParameters
completion |
A handler block to be called on the main queue once the |
|---|
Discussion
Use this method to coordinate your application logic with the stopping of the source’s video pipeline.
Declared In
TVIAppScreenSource.h