9
9
import UIKit
10
10
import MediaPlayer
11
11
12
- enum ScalingMode {
12
+ public enum ScalingMode {
13
13
case AspectFill
14
14
case AspectFit
15
15
case Fill
16
16
case None
17
17
}
18
18
19
- class VideoSplashViewController : UIViewController {
19
+ public class VideoSplashViewController : UIViewController {
20
20
21
21
private let moviePlayer = MPMoviePlayerController ( )
22
- var contentURL : NSURL = NSURL ( ) {
22
+ public var contentURL : NSURL = NSURL ( ) {
23
23
didSet {
24
24
setMoviePlayer ( contentURL)
25
25
}
26
26
}
27
27
28
- var videoFrame : CGRect = CGRect ( )
29
- var startTime : CGFloat = 0.0
30
- var duration : CGFloat = 0.0
31
- var backgroundColor : UIColor = UIColor . blackColor ( ) {
28
+ public var videoFrame : CGRect = CGRect ( )
29
+ public var startTime : CGFloat = 0.0
30
+ public var duration : CGFloat = 0.0
31
+ public var backgroundColor : UIColor = UIColor . blackColor ( ) {
32
32
didSet {
33
33
view. backgroundColor = backgroundColor
34
34
}
35
35
}
36
- var alpha : CGFloat = CGFloat ( ) {
36
+ public var alpha : CGFloat = CGFloat ( ) {
37
37
didSet {
38
38
moviePlayer. view. alpha = alpha
39
39
}
40
40
}
41
- var alwaysRepeat : Bool = true {
41
+ public var alwaysRepeat : Bool = true {
42
42
didSet {
43
43
if alwaysRepeat {
44
44
moviePlayer. repeatMode = MPMovieRepeatMode . One
@@ -47,7 +47,7 @@ class VideoSplashViewController: UIViewController {
47
47
}
48
48
}
49
49
}
50
- var fillMode : ScalingMode = . AspectFill {
50
+ public var fillMode : ScalingMode = . AspectFill {
51
51
didSet {
52
52
switch fillMode {
53
53
case . AspectFill:
@@ -64,7 +64,7 @@ class VideoSplashViewController: UIViewController {
64
64
}
65
65
}
66
66
67
- override func viewDidAppear( animated: Bool ) {
67
+ override public func viewDidAppear( animated: Bool ) {
68
68
moviePlayer. view. frame = videoFrame
69
69
moviePlayer. controlStyle = MPMovieControlStyle . None
70
70
moviePlayer. movieSourceType = MPMovieSourceType . File
@@ -87,11 +87,11 @@ class VideoSplashViewController: UIViewController {
87
87
}
88
88
}
89
89
90
- override func viewDidLoad( ) {
90
+ override public func viewDidLoad( ) {
91
91
super. viewDidLoad ( )
92
92
}
93
93
94
- override func didReceiveMemoryWarning( ) {
94
+ override public func didReceiveMemoryWarning( ) {
95
95
super. didReceiveMemoryWarning ( )
96
96
}
97
97
0 commit comments