You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Periscope-VideoViewController
2
2
Video view controller with [Periscope](https://itunes.apple.com/us/app/periscope/id972909677?mt=8) fast rewind control.
3
3
4
-
Tutorial on how to create this component can be found [here](https://medium.com/@gontovnik/building-periscope-fast-rewind-control-for-ios-5cb6801db0fd#.go2t3gdec).
4
+
Tutorial on how to create this component can be found [here](https://medium.com/@gontovnik/building-periscope-fast-rewind-control-for-ios-5cb6801db0fd#.go2t3gdec).
Copy file name to clipboardExpand all lines: VideoViewController/TimelineView.swift
+30-30Lines changed: 30 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -22,70 +22,70 @@
22
22
23
23
import UIKit
24
24
25
-
publicclassTimelineView:UIView{
25
+
openclassTimelineView:UIView{
26
26
27
27
// MARK: - Vars
28
28
29
29
/// The duration of the video in seconds.
30
-
publicvarduration:NSTimeInterval=0.0{
30
+
openvarduration:TimeInterval=0.0{
31
31
didSet {setNeedsDisplay()}
32
32
}
33
33
34
34
/// Time in seconds when rewind began.
35
-
publicvarinitialTime:NSTimeInterval=0.0{
35
+
openvarinitialTime:TimeInterval=0.0{
36
36
didSet {
37
37
currentTime = initialTime
38
38
}
39
39
}
40
40
41
41
/// Current timeline time in seconds.
42
-
publicvarcurrentTime:NSTimeInterval=0.0{
42
+
openvarcurrentTime:TimeInterval=0.0{
43
43
didSet {
44
44
setNeedsDisplay()
45
45
currentTimeDidChange?(currentTime)
46
46
}
47
47
}
48
48
49
49
/// Internal zoom variable.
50
-
privatevar_zoom:CGFloat=1.0{
50
+
fileprivatevar_zoom:CGFloat=1.0{
51
51
didSet {setNeedsDisplay()}
52
52
}
53
53
54
54
/// The zoom of the timeline view. The higher zoom value, the more accurate rewind is. Default is 1.0.
55
-
publicvarzoom:CGFloat{
55
+
openvarzoom:CGFloat{
56
56
get{return _zoom }
57
57
set{ _zoom =max(min(newValue, maxZoom), minZoom)}
58
58
}
59
59
60
60
/// Indicates minimum zoom value. Default is 1.0.
61
-
publicvarminZoom:CGFloat=1.0{
61
+
openvarminZoom:CGFloat=1.0{
62
62
didSet { zoom = _zoom }
63
63
}
64
64
65
65
/// Indicates maximum zoom value. Default is 3.5.
66
-
publicvarmaxZoom:CGFloat=3.5{
66
+
openvarmaxZoom:CGFloat=3.5{
67
67
didSet { zoom = _zoom }
68
68
}
69
69
70
70
/// The width of a line representing a specific time interval on a timeline. If zoom is not equal 1, then actual interval width equals to intervalWidth * zoom. Value will be used during rewind for calculations — for example, if zoom is 1, intervalWidth is 30 and intervalDuration is 15, then when user moves 10pixels left or right we will rewind by +5 or -5 seconds;
71
-
publicvarintervalWidth:CGFloat=24.0{
71
+
openvarintervalWidth:CGFloat=24.0{
72
72
didSet {setNeedsDisplay()}
73
73
}
74
74
75
75
/// The duration of an interval in seconds. If video is 55 seconds and interval is 15 seconds — then we will have 3 full intervals and one not full interval. Value will be used during rewind for calculations.
76
-
publicvarintervalDuration:CGFloat=15.0{
76
+
openvarintervalDuration:CGFloat=15.0{
77
77
didSet {setNeedsDisplay()}
78
78
}
79
79
80
80
/// Block which will be triggered everytime currentTime value changes.
0 commit comments