Skip to content

Commit

Permalink
chore() add doc about events
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainPetit1 committed Nov 23, 2022
1 parent 37b7169 commit df71065
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/ApiVideoPlayer/PlayerEvents.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
import AVFoundation
import Foundation
public class PlayerEvents {
/// Events called when the player is preparing for a video
public var didPrepare: (() -> Void)?
/// Events called when the player is ready to play video
public var didReady: (() -> Void)?
/// Events called when the video is paused
public var didPause: (() -> Void)?
/// Events called when the video is playing
public var didPlay: (() -> Void)?
/// Events called when the video is replayed
public var didReplay: (() -> Void)?
/// Events called when the player is muted
public var didMute: (() -> Void)?
/// Events called when the player is unmuted
public var didUnMute: (() -> Void)?
/// Events called when the video is replayed in a loop
public var didLoop: (() -> Void)?
/// Events called when the player volume is changed
public var didSetVolume: ((_ volume: Float) -> Void)?
/// Events called when the player is seeking in the video
public var didSeek: ((_ from: CMTime, _ to: CMTime) -> Void)?
/// Events called when the video ended
public var didEnd: (() -> Void)?
/// Events called when there is an error with the player or video
public var didError: ((_ error: Error) -> Void)?
/// Events called when the size of the video changed
public var didVideoSizeChanged: ((_ size: CGSize) -> Void)?

public init(
Expand Down

0 comments on commit df71065

Please sign in to comment.