-
Notifications
You must be signed in to change notification settings - Fork 0
/
SmartuPlayer.swift
43 lines (37 loc) · 1.14 KB
/
SmartuPlayer.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// SmartuPlayer.swift
// SmartStream
//
// Created by Hieu Nguyen on 3/14/16.
// Copyright © 2016 SmartStream. All rights reserved.
//
import UIKit
let ItemDidEndNotification = "com.smartu.channelmanager.itemDidEnd"
let ItemAboutToEndNotification = "com.smartu.channelmanager.itemAboutToEnd"
let maxNumBufferPlayers = 5
let maxItemsBeforeFetch = 3
let bufferTimeConstant = 5
let fadeInTimeConstant = 2.0
let fadeOutTimeConstant = 3.0
enum PlayerType: Int {
case Native = 0, Youtube, Web, Tweet
}
enum PlaybackStatus: Int {
case Init = 0, DidStart, Playing, Pause, Stop, WillEnd, DidEnd, Error
}
protocol SmartuPlayer {
func bufferItem(item: ChannelItem!)
func startItem(item: ChannelItem!)
func playItem()
func pauseItem()
func stopItem()
func nextItem()
func resetBounds(bounds: CGRect)
func getItem() -> ChannelItem?
func getPlayerId() -> String
func getPlayerViews() -> [UIView]
}
protocol SmartuPlayerDelegate: class {
func playbackStatus(playerId: String, playerType: PlayerType, status: PlaybackStatus, progress: Double, totalDuration: Double)
func isPlaying(item: ChannelItem!) -> Bool
}