VKPlayerControllerBase Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | VKPlayerControllerBase.h |
Overview
- A Player object which is subclass of NSObject, player can be used in embedded and/or fullscreen or non UI. Also, more than one instance can be added in a same view without causing any problem like interfereing… Player is similar to Apple’s native API “MPMovieController”, so it’s as easy as using the MPMovieController
– initBase
Initialization of VKPlayerControllerBase object
- (id)initBaseReturn Value
VKPlayerControllerBase object
Declared In
VKPlayerControllerBase.h
– initWithURLString:
Initialization of VKPlayerControllerBase object with the url string object
- (id)initWithURLString:(NSString *)urlStringParameters
urlString |
The location of the file or remote stream url. If it’s a file then it must be located either in your app directory or on a remote server |
|---|
Return Value
VKPlayerControllerBase object
Declared In
VKPlayerControllerBase.h
– createUICenter
This method creates UI elements in the center of the screen
- (void)createUICenterDeclared In
VKPlayerControllerBase.h
– play
This method plays the stream/file if urlstring is given in the initialization or content url is set
- (void)playDeclared In
VKPlayerControllerBase.h
– stepToNextFrame
Update the screen with the following video frame
- (void)stepToNextFrameDeclared In
VKPlayerControllerBase.h
– setStreamCurrentDuration:
Set current duration in files both for located locally or located remotely
- (void)setStreamCurrentDuration:(float)valueParameters
value |
A double value in seconds |
|---|
Declared In
VKPlayerControllerBase.h
– changeAudioStream
Cycle/Change to next the audio stream if remote stream/file has more than 1 audio stream
- (void)changeAudioStreamDeclared In
VKPlayerControllerBase.h
– changeVideoStream
Cycle/Change to next the video stream if remote stream/file has more than 1 video stream
- (void)changeVideoStreamDeclared In
VKPlayerControllerBase.h
– setMute:
Mute audio
- (void)setMute:(BOOL)valueParameters
value |
If YES, audio will be muted |
|---|
Discussion
This does not have any effect on MPVolumeView or not have any relation with MPVolumeView
Declared In
VKPlayerControllerBase.h
– setVolumeLevel:
Set player’s volume level
- (void)setVolumeLevel:(float)valueParameters
value |
must be between 0.0 & 1.0, when value is 0.0, player is muted, default is 1.0 |
|---|
Discussion
This does not have any effect on MPVolumeView or not have any relation with MPVolumeView
Declared In
VKPlayerControllerBase.h
– playableAudioStreams
Retreive all audio streams in stream
- (NSArray *)playableAudioStreamsDeclared In
VKPlayerControllerBase.h
– playableVideoStreams
Retreive all videos streams in stream
- (NSArray *)playableVideoStreamsDeclared In
VKPlayerControllerBase.h
– snapshot
Get snapshot of glview in UIImage format
- (UIImage *)snapshotReturn Value
UIImage object
Discussion
Sample code to show how to save the snapshot
NSArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString documentsDirectory = [paths objectAtIndex:0]; NSString savedImagePath = [documentsDirectory stringByAppendingPathComponent:@“savedImage.png”]; UIImage image = [self snapshot]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:NO];
Declared In
VKPlayerControllerBase.h
– snapshotOriginalSize
Get snapshot from video stream in original size in UIImage format
- (UIImage *)snapshotOriginalSizeReturn Value
UIImage object
Discussion
It’s slower than getting snapshot from glview
Sample code to show how to save the snapshot
NSArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString documentsDirectory = [paths objectAtIndex:0]; NSString savedImagePath = [documentsDirectory stringByAppendingPathComponent:@“savedImage.png”]; UIImage image = [self snapshot]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:NO];
Declared In
VKPlayerControllerBase.h
– startRecording
Start recording file/network stream
- (void)startRecordingDeclared In
VKPlayerControllerBase.h
– stopRecording
Stop recording file/network stream
- (void)stopRecordingDeclared In
VKPlayerControllerBase.h
– stopDurationTimer
Stops duration Timer
- (void)stopDurationTimerDeclared In
VKPlayerControllerBase.h
– startDurationTimer
Starts duration Timer
- (void)startDurationTimerDeclared In
VKPlayerControllerBase.h
– startElapsedTimer
Starts elapsed Timer
- (void)startElapsedTimerDeclared In
VKPlayerControllerBase.h
– stopElapsedTimer
Stops elapsed Timer
- (void)stopElapsedTimerDeclared In
VKPlayerControllerBase.h
– onTimerElapsedFired:
Timer callback when the elapsed timer is fired
- (void)onTimerElapsedFired:(NSTimer *)timerParameters
timer |
NSTimer object instance for elapsed timer |
|---|
Declared In
VKPlayerControllerBase.h
– showControlPanel:willExpire:
Show/Hide control panel on the screen
- (void)showControlPanel:(BOOL)show willExpire:(BOOL)expireParameters
show |
Specify YES, If you want to show control panel components on the screen. Specify NO, If you want to hide control panel components. |
|---|---|
expire |
Specify YES, If you want the control panel to hide after a certain amount of time |
Declared In
VKPlayerControllerBase.h
– setFullScreen:animated:
Make embedded player fullscreen or make fullscreen player embedded
- (void)setFullScreen:(BOOL)value animated:(BOOL)animatedParameters
value |
Specify YES, If you want to show the player in fullscreen, does not have any effect on fullscreen player. Specify NO, If you want to show the player in embedded, does not have any effect on embedded player |
|---|---|
animated |
Specify YES If the transitions will be animated |
Declared In
VKPlayerControllerBase.h
contentURLString
The location of the file or remote stream url in string format. If it’s a file then it must be located either in your app directory or on a remote server
@property (nonatomic, retain) NSString *contentURLStringDeclared In
VKPlayerControllerBase.h
decoderOptions
Streaming options according to the used protocol
@property (nonatomic, retain) NSDictionary *decoderOptionsDeclared In
VKPlayerControllerBase.h
decoderState
Indicates the decoder states in VKDecoderState enumerations
@property (nonatomic, readonly) VKDecoderState decoderStateDeclared In
VKPlayerControllerBase.h
barTitle
The bar title of Video Player
@property (nonatomic, retain) NSString *barTitleDeclared In
VKPlayerControllerBase.h
delegate
Set your Parent View Controller as delegate If you want to be notified for state changes
@property (nonatomic, assign) id<VKPlayerControllerDelegate> delegateDeclared In
VKPlayerControllerBase.h
customIODelegate
Set your Parent View Controller as delegate If you want to be provide custom I/O data to ffmpeg, it’s very useful when decoding a(n) audio/video stream in memory
@property (nonatomic, assign) id<VKPlayerCustomIODelegate> customIODelegateDeclared In
VKPlayerControllerBase.h
statusBarHidden
Specify YES to hide status bar, default is NO. Effective only in fullscreen presenting
@property (nonatomic, assign, getter=isStatusBarHidden) BOOL statusBarHiddenDeclared In
VKPlayerControllerBase.h
staturBarInitialText
A text shown when first loading media stream/file.
@property (nonatomic, readonly) NSString *staturBarInitialTextDeclared In
VKPlayerControllerBase.h
view
VKPlayerControllerBase view object, any custom views must be added on this
@property (nonatomic, retain, readonly) UIView *viewDeclared In
VKPlayerControllerBase.h
renderView
The video rendering view, opengl configuration is done to be ready for rendering
@property (nonatomic, readonly) VKGLES2View *renderViewDeclared In
VKPlayerControllerBase.h
backgroundColor
The background color of player, default is black
@property (nonatomic, retain) UIColor *backgroundColorDeclared In
VKPlayerControllerBase.h
containerVc
An empty and transparent UIViewController used for fullscreen - embedded transitioning. Do not set it If you have a very powerful reason to do that
@property (nonatomic, assign) UIViewController *containerVcDeclared In
VKPlayerControllerBase.h
fullScreen
Indicates the state of player presenting mode. If set, then this makes embedded player fullscreen or makes fullscreen player embedded
@property (nonatomic, assign, getter=isFullScreen) BOOL fullScreenDeclared In
VKPlayerControllerBase.h
initialPlaybackTime
The time, specified in seconds within the video timeline, when playback should start
@property (nonatomic, assign) int64_t initialPlaybackTimeDeclared In
VKPlayerControllerBase.h
loopPlayback
Loops movie playback
@property (nonatomic, assign) int loopPlaybackDeclared In
VKPlayerControllerBase.h
autoStopAtEnd
Stop player when video is done playing
@property (nonatomic, assign) BOOL autoStopAtEndDeclared In
VKPlayerControllerBase.h
allowsAirPlay
Specify YES to show video in extended screen, default is No
@property (nonatomic, assign) BOOL allowsAirPlayDeclared In
VKPlayerControllerBase.h
mainScreenIsMobile
Indicates the active screen is mobile or not. (If not using airplay or TV connection with cable, this value is always YES)
@property (nonatomic, readonly) BOOL mainScreenIsMobileDeclared In
VKPlayerControllerBase.h
showPictureOnInitialBuffering
Specify YES to show first video picture during the initial buffering, default is NO
@property (nonatomic, assign) BOOL showPictureOnInitialBufferingDeclared In
VKPlayerControllerBase.h
fillScreen
Specify YES to fit video frames fill to the player view, default is NO
@property (nonatomic, assign) BOOL fillScreenDeclared In
VKPlayerControllerBase.h
allowsMicCapturing
Specify YES to setup VideoKit AVAudioSession property also suitable for microphone capturing, default is NO. (this property is effectiveless in tvOS platform)
@property (nonatomic, assign) BOOL allowsMicCapturingDeclared In
VKPlayerControllerBase.h
enableCustomIO
Specify YES to enable providing custom I/O data to ffmpeg, it’s very useful when decoding a(n) audio/video stream in memory, default is NO
@property (nonatomic, assign) BOOL enableCustomIODeclared In
VKPlayerControllerBase.h
customIO
This is a helper struct for implementing custom IO feature. Please see the struct details for more info.
@property (nonatomic, readonly) struct VKPlayerCustomIO *customIODeclared In
VKPlayerControllerBase.h
enableICYMetadata
Specify YES to enable metadata information for http shoutcast/icy protocols, default is NO.
@property (nonatomic, assign) BOOL enableICYMetadataDeclared In
VKPlayerControllerBase.h
recordingEnabled
Specify YES to enable recording functionality, default is NO
@property (nonatomic, assign, getter=isRecordingEnabled) BOOL recordingEnabledDeclared In
VKPlayerControllerBase.h
username
If license-form is not accessible, fill this parameter with your username taken from our server
@property (nonatomic, retain) NSString *usernameDeclared In
VKPlayerControllerBase.h
secret
If license-form is not accessible, fill this parameter with your secret taken from our server
@property (nonatomic, retain) NSString *secretDeclared In
VKPlayerControllerBase.h