Skip to content

Commit

Permalink
AudioPlayerAgent에서 Offset, Milliseconds로 제공하는 Property추가 (#1154)
Browse files Browse the repository at this point in the history
## Summary
- AudioPlayerAgent에서 Offset, Milliseconds로 제공하는 Property추가
- milliseconds로 제공하고 필요시에 사용처에서 seconds로 변환해서 사용할 수 있는 선택권 부여
  • Loading branch information
ParkJongSang authored Apr 15, 2024
1 parent 9ef853c commit 460a654
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public final class AudioPlayerAgent: AudioPlayerAgentProtocol {
}
}

public var offsetInMilliSeconds: Int? {
audioPlayerDispatchQueue.sync {
latestPlayer?.offset.truncatedMilliSeconds
}
}

public var volume: Float = 1.0 {
didSet {
audioPlayerDispatchQueue.sync {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public protocol AudioPlayerAgentProtocol: CapabilityAgentable, TypedNotifyable {
/// This function retrieves the duration(seconds) of the current `MediaPlayable` handled by the `AudioPlayerAgent`.
var duration: Int? { get }

/// Returns the current time of the current player item.
///
/// This function retrieves the offset(milliseconds) of the current `MediaPlayable` handled by the `AudioPlayerAgent`.
var offsetInMilliSeconds: Int? { get }

/// The audio playback volume for the player.
///
/// This function retrieves the volume of the current `MediaPlayable` handled by the `AudioPlayerAgent`.
Expand Down

0 comments on commit 460a654

Please sign in to comment.