Player
public class Player : NSObject
Player uses input
to take processed frames, draw effect
and present them into the outputs
.
-
Declaration
Swift
public let effectPlayer: BNBEffectPlayer
-
Rendering modes
See moreDeclaration
Swift
public enum RenderMode
-
Setup rendering mode,
loop
by defaultDeclaration
Swift
public var renderMode: RenderMode { get set }
-
Current player
size
Declaration
Swift
public var size: CGSize { get }
-
Player
volume
in range [0, 1] where 1 is maximumDeclaration
Swift
public var volume: Float { get set }
-
Current
effect
Declaration
Swift
public var effect: BNBEffect? { get }
-
Create player
play
should be called after create, to starteffect
applyingDeclaration
Swift
public init(fps: Int = 30)
Parameters
fps
max rendering frame rate, 30 by default
-
Start playback
Declaration
Swift
public func play()
-
Pause playback
Declaration
Swift
public func pause()
-
Use provided
input
with currentoutputs
Declaration
Swift
public func use(input: Input?)
-
Use provided
outputs
with currentinput
Declaration
Swift
public func use(outputs: [Output])
-
Load
effect
with pathDeclaration
Swift
public func load(effect: String, sync: Bool = false, completion: ((BNBEffect?) -> Void)? = nil) -> BNBEffect?
-
Setup callback on
resize
eventDeclaration
Swift
public func onResize(action: @escaping (CGSize) -> Void)
Parameters
action
callback is fired when
input
gives frame with changedsize
-
Setup callback on
render
eventDeclaration
Swift
public func onRender(action: @escaping (Bool, Int64) -> Void)
Parameters
action
callback which reports
status
andframeNumber
, if success -
Draw and present rendered result synchronously, can be used only in
manual
rendering mode.Declaration
Swift
public func render() -> Bool