Skip to content

Commit acc2a27

Browse files
committed
Use local time for live playhead calculation
1 parent 702df31 commit acc2a27

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

adobe-edge/ios/Connector/AdobeEdgeHandler.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,14 @@ class AdobeEdgeHandler {
514514

515515
if mediaLength == Double.infinity {
516516
// If content is live, the playhead must be the current second of the day.
517-
let now = Date().timeIntervalSince1970
518-
return Int(now.truncatingRemainder(dividingBy: 86400))
517+
let now = Date()
518+
let calendar = Calendar.current
519+
let seconds =
520+
calendar.component(.hour, from: now) * 3600 +
521+
calendar.component(.minute, from: now) * 60 +
522+
calendar.component(.second, from: now)
523+
524+
return seconds
519525
}
520526

521527
return Int(playhead)

0 commit comments

Comments
 (0)