 import AVKit
 
 final class ClipSharingViewController: NSViewController {
+
+    struct Constants {
+        // Limit shared clips to a maximum of 5 minutes.
+        static let maximumDuration: Float64 = 60 * 5
+        static let humanReadableMaxDuration = "5 minutes"
+    }
 
     let assetURL: URL
     let asset: AVURLAsset

        })
    }

    private func showProgressUI() {
        progressIndicator.isIndeterminate = false
        progressIndicator.minValue = 0


        guard let item = player.currentItem else { return }

        let range = CMTimeRangeFromTimeToTime(start: item.reversePlaybackEndTime, end: item.forwardPlaybackEndTime)
        guard CMTimeGetSeconds(range.duration) <= Constants.maximumDuration else {
            showTimeLimitError()
            return
        }

        showProgressUI()

        renderer = ClipRenderer(
