Commit df45eda6ed6f37e382f7f98e1b003ae9b0589e21
1 parent
8d05af0c
Exists in
newLive
no message
Showing
8 changed files
with
1025 additions
and
19 deletions
Show diff stats
YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj
... | ... | @@ -48,6 +48,8 @@ |
48 | 48 | 599B2CE21DE52F7E00B4F7FD /* UMSocialShareScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 599B2CD01DE52F7E00B4F7FD /* UMSocialShareScrollView.m */; }; |
49 | 49 | 599B2CE31DE52F7E00B4F7FD /* UMSocialUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 599B2CD21DE52F7E00B4F7FD /* UMSocialUIManager.m */; }; |
50 | 50 | 59AE3DF91ECE8A90003E2C62 /* pinyin.c in Sources */ = {isa = PBXBuildFile; fileRef = 59AE3DF71ECE8A90003E2C62 /* pinyin.c */; }; |
51 | + 59AE3DFB1ECECD7D003E2C62 /* LiveInforViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */; }; | |
52 | + 59AE3DFD1ECED5B1003E2C62 /* MoivePlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */; }; | |
51 | 53 | 59BA13251E25CF2B00540DE0 /* AliyunPlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */; }; |
52 | 54 | 59BA13271E25CF4B00540DE0 /* AliyunPlayerSDK.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
53 | 55 | 59BA13311E25D1C000540DE0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 59BA13301E25D1C000540DE0 /* Reachability.m */; }; |
... | ... | @@ -332,6 +334,8 @@ |
332 | 334 | 599B2CD21DE52F7E00B4F7FD /* UMSocialUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UMSocialUIManager.m; sourceTree = "<group>"; }; |
333 | 335 | 59AE3DF71ECE8A90003E2C62 /* pinyin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pinyin.c; sourceTree = "<group>"; }; |
334 | 336 | 59AE3DF81ECE8A90003E2C62 /* pinyin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pinyin.h; sourceTree = "<group>"; }; |
337 | + 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveInforViewController.swift; sourceTree = "<group>"; }; | |
338 | + 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoivePlayerViewController.swift; sourceTree = "<group>"; }; | |
335 | 339 | 59BA13241E25CF2B00540DE0 /* AliyunPlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AliyunPlayerSDK.framework; path = YouerLiveVideo/lib/AliyunPlayerSDK.framework; sourceTree = "<group>"; }; |
336 | 340 | 59BA132F1E25D1C000540DE0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; |
337 | 341 | 59BA13301E25D1C000540DE0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; |
... | ... | @@ -613,6 +617,8 @@ |
613 | 617 | isa = PBXGroup; |
614 | 618 | children = ( |
615 | 619 | 5904FC471ECA8B8C00E631FF /* ResourceViewController.swift */, |
620 | + 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */, | |
621 | + 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */, | |
616 | 622 | 597185B41ECA990C00D7F478 /* Resource.storyboard */, |
617 | 623 | ); |
618 | 624 | path = Resource; |
... | ... | @@ -1499,6 +1505,7 @@ |
1499 | 1505 | BF25DFF31DDAA36A003EC0C1 /* Timeline.swift in Sources */, |
1500 | 1506 | BF25DFFE1DDAA36A003EC0C1 /* SDWebImageDownloader.m in Sources */, |
1501 | 1507 | BF7B75A51E305A6D0011D5C7 /* MJRefreshConst.m in Sources */, |
1508 | + 59AE3DFB1ECECD7D003E2C62 /* LiveInforViewController.swift in Sources */, | |
1502 | 1509 | BF7B759B1E305A6D0011D5C7 /* MJRefreshAutoGifFooter.m in Sources */, |
1503 | 1510 | BF7B75A81E305A6D0011D5C7 /* UIScrollView+MJRefresh.m in Sources */, |
1504 | 1511 | BF25E0021DDAA36A003EC0C1 /* UIButton+WebCache.m in Sources */, |
... | ... | @@ -1512,6 +1519,7 @@ |
1512 | 1519 | BFDFDED21DD55C0D0040F102 /* network.swift in Sources */, |
1513 | 1520 | 599B2CE11DE52F7E00B4F7FD /* UMShareMenuSelectionView.m in Sources */, |
1514 | 1521 | BF25DFFF1DDAA36A003EC0C1 /* SDWebImageDownloaderOperation.m in Sources */, |
1522 | + 59AE3DFD1ECED5B1003E2C62 /* MoivePlayerViewController.swift in Sources */, | |
1515 | 1523 | BF25DFF01DDAA36A003EC0C1 /* SessionDelegate.swift in Sources */, |
1516 | 1524 | BF25DFE31DDAA36A003EC0C1 /* Alamofire.swift in Sources */, |
1517 | 1525 | BF25DFEC1DDAA36A003EC0C1 /* Response.swift in Sources */, | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift
0 → 100644
... | ... | @@ -0,0 +1,88 @@ |
1 | +// | |
2 | +// LiveInforViewController.swift | |
3 | +// YouerLiveVideo | |
4 | +// | |
5 | +// Created by 左丞 on 2017/5/19. | |
6 | +// Copyright © 2017年 左丞. All rights reserved. | |
7 | +// | |
8 | + | |
9 | +import UIKit | |
10 | + | |
11 | +class LiveInforViewController: UIViewController { | |
12 | + | |
13 | + | |
14 | + @IBOutlet weak var player: UIView! | |
15 | + @IBOutlet weak var livePalyer: UIView! | |
16 | + @IBOutlet weak var updataPersonPhoto: UIImageView! | |
17 | + @IBOutlet weak var updataPersonName: UILabel! | |
18 | + @IBOutlet weak var updataTime: UILabel! | |
19 | + | |
20 | + var tvStation:TVStationSubject! | |
21 | + override func viewDidLoad() { | |
22 | + super.viewDidLoad() | |
23 | + AppDelegate.instance().httpServer.getResourceModel(parameters: ["f_id":"2be92331-ea5a-41c9-9025-c954d7df904c" as AnyObject]) { (str, error) in | |
24 | + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | |
25 | + self.tvStation = TVStationSubject(json: json.contentData()) | |
26 | + self.setAllInfor() | |
27 | + }, failHandler: { (error) in | |
28 | + | |
29 | + }) | |
30 | + } | |
31 | + // Do any additional setup after loading the view. | |
32 | + } | |
33 | + | |
34 | + func setAllInfor(){ | |
35 | + updataTime.text = setDateToString(date: dateFromISO8601(dateString: tvStation.f_CreatorTime)) | |
36 | + updataPersonName.text = "上传者: \(tvStation.f_CreatorName!)" | |
37 | + updataPersonPhoto.layer.cornerRadius = updataPersonPhoto.frame.size.height/2 | |
38 | + updataPersonPhoto.layer.masksToBounds = true | |
39 | + updataPersonPhoto.sd_setImage(with: URL(string: tvStation.f_Img), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) | |
40 | + } | |
41 | + | |
42 | + override func didReceiveMemoryWarning() { | |
43 | + super.didReceiveMemoryWarning() | |
44 | + // Dispose of any resources that can be recreated. | |
45 | + } | |
46 | + | |
47 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
48 | + if segue.identifier == "player"{ | |
49 | + let vc = segue.destination as! MoivePlayerViewController | |
50 | + vc.mSourceURL = URL(string: "http://vote-weiyun.oss-cn-hangzhou.aliyuncs.com/Videos/c0b2ddd5-46df-41b1-ac4f-bf5e06ee50c0.mp4") | |
51 | + vc.isFullAndHiddenAllBtn = true | |
52 | + } | |
53 | + | |
54 | + } | |
55 | + | |
56 | + /* | |
57 | + // MARK: - Navigation | |
58 | + | |
59 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | |
60 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
61 | + // Get the new view controller using segue.destinationViewController. | |
62 | + // Pass the selected object to the new view controller. | |
63 | + } | |
64 | + */ | |
65 | + | |
66 | +} | |
67 | + | |
68 | +extension LiveInforViewController:UITableViewDelegate,UITableViewDataSource{ | |
69 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
70 | + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! RemainCell | |
71 | + return cell | |
72 | + } | |
73 | + | |
74 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
75 | + return 3 | |
76 | + } | |
77 | +} | |
78 | + | |
79 | +class RemainCell: UITableViewCell { | |
80 | + | |
81 | + | |
82 | + @IBOutlet weak var remainContent: UILabel! | |
83 | + @IBOutlet weak var remainName: UILabel! | |
84 | + @IBOutlet weak var remainPhoto: UIImageView! | |
85 | + | |
86 | +} | |
87 | + | |
88 | + | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/Resource/MoivePlayerViewController.swift
0 → 100644
... | ... | @@ -0,0 +1,599 @@ |
1 | +// | |
2 | +// MoivePlayerViewController.swift | |
3 | +// XSTVideoPalyer | |
4 | +// | |
5 | +// Created by 左丞 on 16/11/23. | |
6 | +// Copyright © 2016年 左丞. All rights reserved. | |
7 | +// | |
8 | + | |
9 | +import UIKit | |
10 | +import Foundation | |
11 | +import MediaPlayer | |
12 | + | |
13 | +enum GestrueType { | |
14 | + case None | |
15 | + case Volume | |
16 | + case Brightness | |
17 | + case Progress | |
18 | +} | |
19 | + | |
20 | + | |
21 | +class MoivePlayerViewController: UIViewController,AliVcAccessKeyProtocol{ | |
22 | + | |
23 | + @IBOutlet weak var pauseImageBtn: UIButton! | |
24 | + @IBOutlet weak var endTime: UILabel! | |
25 | + @IBOutlet weak var startTime: UILabel! | |
26 | + @IBOutlet weak var slider: UISlider! | |
27 | + @IBOutlet weak var screenHorizontalBtn: UIButton! | |
28 | + var mPlayerView:UIView! | |
29 | + var activityBackgroundView:UIView! | |
30 | + var activityIndicator:UIActivityIndicatorView! | |
31 | + var mPlayer:AliVcMediaPlayer! | |
32 | + var systemBrightness:CGFloat!//屏幕亮度 | |
33 | + var conn:Reachability! | |
34 | + var isReplay:Bool = false | |
35 | + var mPaused:Bool = false | |
36 | + var mSourceURL:URL! | |
37 | + | |
38 | + var isLive:Bool = true | |
39 | + var accessKeyID = "LTAIDOJoPQejwtoF" | |
40 | + var accessKeySecret = "rCRMo1TFvBWIkKASB59DRmRJxm9GyK" | |
41 | + var liveTeacherPicture:String="" | |
42 | + var liveTeacherName:String! | |
43 | + var timer:Timer! | |
44 | + var activePersonNum:NSInteger = 0 | |
45 | + var mTimer:Timer! | |
46 | + var bSeeking:Bool = false | |
47 | + var gestureType:GestrueType = .None | |
48 | + var originalLocation:CGPoint! | |
49 | + var progressValue:CGFloat = 0 | |
50 | + var liveOrVideoUrlString:String = "" | |
51 | + var isAllBtnHidden:Bool = false | |
52 | + var isFullAndHiddenAllBtn:Bool = false | |
53 | + func getAccessKeyIDSecret() -> AliVcAccesskey! { | |
54 | + let accessKey = AliVcAccesskey() | |
55 | + accessKey.accessKeyId = accessKeyID | |
56 | + accessKey.accessKeySecret = accessKeySecret | |
57 | + return accessKey | |
58 | + } | |
59 | + override func viewDidLoad() { | |
60 | + super.viewDidLoad() | |
61 | + mSourceURL = URL(string:liveOrVideoUrlString) | |
62 | + AliVcMediaPlayer.setAccessKeyDelegate(self) | |
63 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.becomeActive), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) | |
64 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.resignActive), name: NSNotification.Name.UIApplicationWillResignActive, object: nil) | |
65 | + | |
66 | + playMoive() | |
67 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.networkStateChange), name: NSNotification.Name.reachabilityChanged, object: nil) | |
68 | + conn = Reachability.forInternetConnection() | |
69 | + conn.startNotifier() | |
70 | + hiddenAllBtn() | |
71 | + displayAllBtn() | |
72 | + | |
73 | + // Do any additional setup after loading the view. | |
74 | + } | |
75 | + | |
76 | + // 返回状态栏的样式 | |
77 | + override var preferredStatusBarStyle: UIStatusBarStyle{ | |
78 | + return UIStatusBarStyle.lightContent | |
79 | + } | |
80 | + | |
81 | + override func viewWillDisappear(_ animated: Bool) { | |
82 | + super.viewWillDisappear(animated) | |
83 | + if timer != nil{ | |
84 | + timer.invalidate() | |
85 | + timer = nil | |
86 | + } | |
87 | + if mTimer != nil{ | |
88 | + mTimer.invalidate() | |
89 | + mTimer = nil | |
90 | + } | |
91 | + } | |
92 | + | |
93 | + override func viewDidAppear(_ animated: Bool) { | |
94 | + super.viewDidAppear(animated) | |
95 | + displayAllBtn() | |
96 | + systemBrightness = UIScreen.main.brightness | |
97 | + | |
98 | + if mSourceURL == nil{ | |
99 | + self.dismiss(animated: true, completion: nil) | |
100 | + AppDelegate.instance().window?.makeToast("该直播或点播不存在") | |
101 | + return | |
102 | + } | |
103 | + | |
104 | + AppDelegate.instance().blockRotation = true | |
105 | + } | |
106 | + | |
107 | + override func viewDidDisappear(_ animated: Bool) { | |
108 | + super.viewDidDisappear(animated) | |
109 | + UIScreen.main.brightness = systemBrightness | |
110 | + } | |
111 | + | |
112 | + func becomeActive(){ | |
113 | + EnterForeGroundPlayVideo() | |
114 | + | |
115 | + } | |
116 | + | |
117 | + func resignActive(){ | |
118 | + EnterBackGroundPauseVideo() | |
119 | + } | |
120 | + | |
121 | + func EnterBackGroundPauseVideo(){ | |
122 | + if mPlayer != nil && !mPaused { | |
123 | + mPlayer.pause() | |
124 | + pauseImageBtn.isHidden = false | |
125 | + } | |
126 | + UIScreen.main.brightness = systemBrightness | |
127 | + } | |
128 | + | |
129 | + func EnterForeGroundPlayVideo(){ | |
130 | + if mPlayer != nil && !mPaused { | |
131 | + mPlayer.play() | |
132 | + | |
133 | + } | |
134 | + UIScreen.main.brightness = systemBrightness | |
135 | + } | |
136 | + | |
137 | + func networkStateChange(){ | |
138 | + if mSourceURL != nil && mSourceURL.isFileURL{ | |
139 | + checkNetworkState() | |
140 | + } | |
141 | + } | |
142 | + | |
143 | + func checkNetworkState(){ | |
144 | + let wifi = Reachability.forLocalWiFi() | |
145 | + conn = Reachability.forInternetConnection() | |
146 | + if wifi?.currentReachabilityStatus() != NotReachable{ | |
147 | + NSLog("有wifi") | |
148 | + }else if conn.currentReachabilityStatus() != NotReachable{ | |
149 | + NSLog("使用手机自带网络进行上网") | |
150 | + }else{ | |
151 | + NSLog("没有网络") | |
152 | + } | |
153 | + } | |
154 | + func displayAllBtn(){ | |
155 | + if isFullAndHiddenAllBtn{ | |
156 | + pauseImageBtn.isHidden = false | |
157 | + return | |
158 | + } | |
159 | + isAllBtnHidden = false | |
160 | + for i in 0...2{ | |
161 | + self.view.viewWithTag(200+i)?.isHidden = false | |
162 | + } | |
163 | + if !isLive{ | |
164 | + displaySlider() | |
165 | + } | |
166 | + if timer != nil{ | |
167 | + timer.invalidate() | |
168 | + timer = nil | |
169 | + } | |
170 | + timer = Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(MoivePlayerViewController.hiddenAllBtn), userInfo: nil, repeats: false) | |
171 | + } | |
172 | + | |
173 | + func hiddenAllBtn(){ | |
174 | + isAllBtnHidden = true | |
175 | + for i in 0...6{ | |
176 | + self.view.viewWithTag(200+i)?.isHidden = true | |
177 | + } | |
178 | + } | |
179 | + | |
180 | + func displaySlider(){ | |
181 | + if isFullAndHiddenAllBtn{ | |
182 | + return | |
183 | + } | |
184 | + for i in 3...6{ | |
185 | + self.view.viewWithTag(200+i)?.isHidden = false | |
186 | + } | |
187 | + } | |
188 | + | |
189 | + func setupControls(){ | |
190 | + mPlayerView = UIView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight())) | |
191 | + mPlayerView.backgroundColor = UIColor.clear | |
192 | + self.view.insertSubview(mPlayerView, at: 0) | |
193 | + //缓冲指示 | |
194 | + activityBackgroundView = UIView() | |
195 | + activityBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.5) | |
196 | + activityBackgroundView.alpha = 0 | |
197 | + activityBackgroundView.center = mPlayerView.center | |
198 | + activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) | |
199 | + activityIndicator.hidesWhenStopped = true | |
200 | + activityIndicator.center = mPlayerView.center | |
201 | + activityIndicator.alpha = 0 | |
202 | + } | |
203 | + | |
204 | + func playMoive(){ | |
205 | + if mSourceURL == nil{ | |
206 | + return | |
207 | + } | |
208 | + setupControls() | |
209 | + mPlayer = AliVcMediaPlayer() | |
210 | + mPlayer.create(mPlayerView) | |
211 | + mPlayer.scalingMode = scalingModeAspectFit | |
212 | + mPlayer.view.isUserInteractionEnabled = true | |
213 | + addPlayerObserver() | |
214 | + if isLive{ | |
215 | + mPlayer.mediaType = 1 | |
216 | + }else{ | |
217 | + mPlayer.mediaType = 0 | |
218 | + mTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(MoivePlayerViewController.onTick(_:)), userInfo: nil, repeats: true) | |
219 | + | |
220 | + } | |
221 | + mPlayer.timeout = 25000 | |
222 | + mPlayer.dropBufferDuration = 8000 | |
223 | + mPlayer.scalingMode = scalingModeAspectFitWithCropping | |
224 | + isReplay = false | |
225 | + bSeeking = false | |
226 | + var err = mPlayer.prepare(toPlay: mSourceURL) | |
227 | + if err != ALIVC_SUCCESS{ | |
228 | + activityBackgroundView.removeFromSuperview() | |
229 | + activityIndicator.removeFromSuperview() | |
230 | + return | |
231 | + } | |
232 | + err = mPlayer.play() | |
233 | + if err != ALIVC_SUCCESS{ | |
234 | + return | |
235 | + } | |
236 | + changeMPlayFrame() | |
237 | + showLoadingIndicators() | |
238 | + mPlayer.pause() | |
239 | + pauseImageBtn.isHidden = false | |
240 | + } | |
241 | + func onTick(_ timer:Timer){ | |
242 | + if self.bSeeking { | |
243 | + return | |
244 | + } | |
245 | + if self.mPlayer != nil{ | |
246 | + self.slider.value = Float(self.mPlayer.currentPosition) | |
247 | + self.startTime.text = self.creatTime(timeInter: self.mPlayer.currentPosition) | |
248 | + self.endTime.text = self.creatTime(timeInter: self.mPlayer.duration) | |
249 | + } | |
250 | + } | |
251 | + func replayMoive(){ | |
252 | + mPlayer.prepare(toPlay: mSourceURL) | |
253 | + isReplay = false | |
254 | + bSeeking = false | |
255 | + mPlayer.play() | |
256 | + | |
257 | + } | |
258 | + | |
259 | + @IBAction func isHorScreenClickAction(_ sender: UIButton) { | |
260 | + screenHorizontalBtn.isSelected = !screenHorizontalBtn.isSelected | |
261 | + if screenHorizontalBtn.isSelected{ | |
262 | + screenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "screen_part"), for: .normal) | |
263 | + displayAllBtn() | |
264 | + UIApplication.shared.statusBarOrientation = .landscapeRight | |
265 | + UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI_2)) | |
266 | + UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenHeight(), height: getScreenWidth()) | |
267 | + }else{ | |
268 | + screenHorizontalBtn.setBackgroundImage(#imageLiteral(resourceName: "screen_full"), for: .normal) | |
269 | + UIApplication.shared.statusBarOrientation = .portrait | |
270 | + UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: 0) | |
271 | + UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) | |
272 | + } | |
273 | + changeMPlayFrame() | |
274 | + } | |
275 | + | |
276 | + override var shouldAutorotate: Bool{ | |
277 | + return false | |
278 | + } | |
279 | + | |
280 | + @IBAction func backBtnClickAction(_ sender: UIButton) { | |
281 | + if screenHorizontalBtn.isSelected{ | |
282 | + isHorScreenClickAction(screenHorizontalBtn) | |
283 | + displayAllBtn() | |
284 | + }else{ | |
285 | + UIApplication.shared.statusBarOrientation = .portrait | |
286 | + UIApplication.shared.keyWindow?.transform = CGAffineTransform(rotationAngle: 0) | |
287 | + UIApplication.shared.keyWindow?.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) | |
288 | + AppDelegate.instance().blockRotation = false | |
289 | + if mPlayer != nil{ | |
290 | + mPlayer.destroy() | |
291 | + } | |
292 | + removePlayerObserver() | |
293 | + mPlayer = nil | |
294 | + mSourceURL = nil | |
295 | + self.dismiss(animated: true, completion: nil) | |
296 | + } | |
297 | + } | |
298 | + | |
299 | + @IBAction func playPauseClickAction(_ sender: UIButton) { | |
300 | + if sender == pauseImageBtn{ | |
301 | + sender.isHidden = true | |
302 | + } | |
303 | + displayAllBtn() | |
304 | + if mPlayer != nil{ | |
305 | + if sender.isSelected{ | |
306 | + sender.setBackgroundImage(#imageLiteral(resourceName: "starLive"), for: .normal) | |
307 | + if isReplay { | |
308 | + if isLive{ | |
309 | + mPlayer.prepare(toPlay: mSourceURL) | |
310 | + }else{ | |
311 | + mPlayer.play() | |
312 | + } | |
313 | + isReplay = false | |
314 | + bSeeking = false | |
315 | + } | |
316 | + mPlayer.muteMode = false | |
317 | + }else{ | |
318 | + isReplay = true | |
319 | + sender.setBackgroundImage(#imageLiteral(resourceName: "pause"), for: .normal) | |
320 | + mPaused = true | |
321 | + mPlayer.pause() | |
322 | + pauseImageBtn.isHidden = false | |
323 | + } | |
324 | + sender.isSelected = !sender.isSelected | |
325 | + } | |
326 | + // self.perform(#selector(MoivePlayerViewController.hideControls(com)), with: nil, afterDelay: fadeDelay) | |
327 | + | |
328 | + } | |
329 | + | |
330 | + @IBAction func sliderPanAction(_ sender: UISlider) { | |
331 | + displayAllBtn() | |
332 | + bSeeking = true | |
333 | + startTime.text = creatTime(timeInter: TimeInterval(sender.value)) | |
334 | + if mPlayer != nil{ | |
335 | + mPlayer.seek(to: TimeInterval(sender.value)) | |
336 | + } | |
337 | + } | |
338 | + | |
339 | + func showLoadingIndicators(){ | |
340 | + self.view.addSubview(activityBackgroundView) | |
341 | + self.view.addSubview(activityIndicator) | |
342 | + activityIndicator.startAnimating() | |
343 | + UIView.animate(withDuration: 0.2, animations: { | |
344 | + self.activityBackgroundView.alpha = 1 | |
345 | + self.activityIndicator.alpha = 1 | |
346 | + }) | |
347 | + } | |
348 | + | |
349 | + func hideLoadingIndicators(){ | |
350 | + UIView.animate(withDuration: 0.2, delay: 0, options: .layoutSubviews, animations: { | |
351 | + self.activityBackgroundView.alpha = 0 | |
352 | + self.activityIndicator.alpha = 0 | |
353 | + | |
354 | + }) { (finish) in | |
355 | + self.activityBackgroundView.removeFromSuperview() | |
356 | + self.activityIndicator.removeFromSuperview() | |
357 | + | |
358 | + } | |
359 | + } | |
360 | + | |
361 | + func changeMPlayFrame(){ | |
362 | + if mPlayer != nil && mPlayer.videoWidth != 0{ | |
363 | + let widthbi = CGFloat(mPlayer.videoWidth)/getScreenWidth() | |
364 | + let heightBi = CGFloat(mPlayer.videoHeight)/getScreenHeight() | |
365 | + if widthbi < heightBi || getScreenWidth()>getScreenHeight(){ | |
366 | + mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight()) | |
367 | + }else{ | |
368 | + mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: CGFloat(ceil(CGFloat(mPlayer.videoHeight)/widthbi))) | |
369 | + } | |
370 | + }else{ | |
371 | + mPlayerView.frame = CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenWidth()/5*3) | |
372 | + } | |
373 | + mPlayerView.center = self.view.center | |
374 | + mPlayer.view = mPlayerView | |
375 | + activityIndicator.center = mPlayerView.center | |
376 | + activityBackgroundView.center = mPlayerView.center | |
377 | + } | |
378 | + | |
379 | + func OnVideoPrepared(noti:Notification){ | |
380 | + slider.maximumValue = Float(mPlayer.duration) | |
381 | + slider.value = Float(mPlayer.currentPosition) | |
382 | + timer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(MoivePlayerViewController.hiddenAllBtn), userInfo: nil, repeats: false) | |
383 | + changeMPlayFrame() | |
384 | + endTime.text = creatTime(timeInter: mPlayer.duration) | |
385 | + hideLoadingIndicators() | |
386 | + } | |
387 | + | |
388 | + func creatTime(timeInter:TimeInterval)->String{ | |
389 | + if timeInter > 0{ | |
390 | + let seconds = Int(timeInter)/1000 | |
391 | + return "\(seconds/60/60):\(seconds/60%60):\(seconds%60)" | |
392 | + } | |
393 | + return "0:00:00" | |
394 | + } | |
395 | + | |
396 | + func OnVideoError(noti:Notification){ | |
397 | + isReplay = true | |
398 | + var error_msg = "未知的错误" | |
399 | + let error_code:AliVcMovieErrorCode = mPlayer.errorCode | |
400 | + switch error_code { | |
401 | + case ALIVC_ERR_FUNCTION_DENIED: | |
402 | + error_msg = "未授权" | |
403 | + case ALIVC_ERR_ILLEGALSTATUS: | |
404 | + error_msg = "非法的播放流程" | |
405 | + case ALIVC_ERR_INVALID_INPUTFILE: | |
406 | + error_msg = " 主播还未开播..." | |
407 | + hideLoadingIndicators() | |
408 | + case ALIVC_ERR_NO_INPUTFILE: | |
409 | + error_msg = "无输入文件" | |
410 | + hideLoadingIndicators() | |
411 | + case ALIVC_ERR_NO_NETWORK: | |
412 | + error_msg = "网络连接失败" | |
413 | + case ALIVC_ERR_NO_SUPPORT_CODEC: | |
414 | + error_msg = "不支持的视频编码格式" | |
415 | + hideLoadingIndicators() | |
416 | + case ALIVC_ERR_NO_VIEW: | |
417 | + error_msg = "无显示窗口" | |
418 | + hideLoadingIndicators() | |
419 | + case ALIVC_ERR_NO_MEMORY: | |
420 | + error_msg = "内存不足" | |
421 | + case ALIVC_ERR_DOWNLOAD_TIMEOUT: | |
422 | + error_msg = "网络超时" | |
423 | + case ALIVC_ERR_UNKOWN: | |
424 | + error_msg = "未知错误" | |
425 | + default: | |
426 | + break; | |
427 | + } | |
428 | + if error_code > 500||error_code == ALIVC_ERR_FUNCTION_DENIED{ | |
429 | + mPlayer.reset() | |
430 | + let alertView = UIAlertController(title: nil, message: error_msg, preferredStyle: .alert) | |
431 | + alertView.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) | |
432 | + self.present(alertView, animated: true, completion: nil) | |
433 | + } | |
434 | + if error_code == ALIVC_ERR_DOWNLOAD_TIMEOUT{ | |
435 | + mPlayer.pause() | |
436 | + pauseImageBtn.isHidden = false | |
437 | + | |
438 | + let alertView = UIAlertController(title: nil, message: error_msg, preferredStyle: .alert) | |
439 | + alertView.addAction(UIAlertAction(title: "等待", style: .cancel, handler: nil)) | |
440 | + alertView.addAction(UIAlertAction(title: "重新连接", style: .default, handler: { (action) in | |
441 | + self.mPlayer.stop() | |
442 | + self.showLoadingIndicators() | |
443 | + self.isReplay = true | |
444 | +// replay() | |
445 | + })) | |
446 | + self.present(alertView, animated: true, completion: nil) | |
447 | + | |
448 | + } | |
449 | + | |
450 | + } | |
451 | + | |
452 | + func OnVideoFinish(noti:Notification){ | |
453 | + isReplay = true | |
454 | + playPauseClickAction(self.view.viewWithTag(202) as! UIButton) | |
455 | + mPlayer.stop() | |
456 | + } | |
457 | + | |
458 | + func OnSeekDone(noti:Notification){ | |
459 | + bSeeking = false | |
460 | + } | |
461 | + | |
462 | + func OnStartCache(noti:Notification){ | |
463 | + showLoadingIndicators() | |
464 | + } | |
465 | + | |
466 | + func OnEndCache(noti:Notification){ | |
467 | + hideLoadingIndicators() | |
468 | + } | |
469 | + | |
470 | + | |
471 | + func addPlayerObserver(){ | |
472 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoPrepared(noti:)), name: NSNotification.Name.AliVcMediaPlayerLoadDidPrepared, object: mPlayer) | |
473 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoError(noti:)), name: NSNotification.Name.AliVcMediaPlayerPlaybackError, object: mPlayer) | |
474 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnVideoFinish(noti:)), name: NSNotification.Name.AliVcMediaPlayerPlaybackDidFinish, object: mPlayer) | |
475 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnSeekDone(noti:)), name: NSNotification.Name.AliVcMediaPlayerSeekingDidFinish, object: mPlayer) | |
476 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnStartCache(noti:)), name: NSNotification.Name.AliVcMediaPlayerStartCaching, object: mPlayer) | |
477 | + NotificationCenter.default.addObserver(self, selector: #selector(MoivePlayerViewController.OnEndCache(noti:)), name: NSNotification.Name.AliVcMediaPlayerEndCaching, object: mPlayer) | |
478 | + | |
479 | + } | |
480 | + | |
481 | + func removePlayerObserver(){ | |
482 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerLoadDidPrepared, object: mPlayer) | |
483 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerPlaybackError, object: mPlayer) | |
484 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerPlaybackDidFinish, object: mPlayer) | |
485 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerSeekingDidFinish, object: mPlayer) | |
486 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerStartCaching, object: mPlayer) | |
487 | + NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AliVcMediaPlayerEndCaching, object: mPlayer) | |
488 | + } | |
489 | + | |
490 | + override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
491 | + bSeeking = true | |
492 | + originalLocation = CGPoint(x: 0, y: 0) | |
493 | + progressValue = 0 | |
494 | + } | |
495 | + | |
496 | + override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { | |
497 | + displayAllBtn() | |
498 | + let touch = touches.first | |
499 | + let currenLocation = touch!.location(in: self.view) | |
500 | + let offset_x = currenLocation.x - originalLocation.x | |
501 | + let offset_y = currenLocation.y - originalLocation.y | |
502 | + if __CGPointEqualToPoint(originalLocation, CGPointZero){ | |
503 | + originalLocation = currenLocation | |
504 | + return | |
505 | + } | |
506 | + originalLocation = currenLocation | |
507 | + if abs(offset_x) <= abs(offset_y){ | |
508 | + gestureType = .Volume | |
509 | + }else if abs(offset_x) > abs(offset_y) { | |
510 | + gestureType = .Progress | |
511 | + } | |
512 | + if gestureType == .Progress{ | |
513 | + if mPlayer != nil{ | |
514 | + if offset_x > 0{ | |
515 | + if slider.value+ProgressStep*1000 <= Float(mPlayer.duration){ | |
516 | + slider.value = slider.value+ProgressStep*1000 | |
517 | + startTime.text = creatTime(timeInter: TimeInterval(slider.value)) | |
518 | + }else{ | |
519 | + slider.value = Float(mPlayer.duration) | |
520 | + startTime.text = creatTime(timeInter: mPlayer.duration) | |
521 | + } | |
522 | + }else{ | |
523 | + if slider.value-ProgressStep*1000 >= 0{ | |
524 | + slider.value = slider.value-ProgressStep*1000 | |
525 | + startTime.text = creatTime(timeInter: TimeInterval(slider.value)) | |
526 | + }else{ | |
527 | + slider.value = 0 | |
528 | + startTime.text = "0:0:0" | |
529 | + } | |
530 | + } | |
531 | + } | |
532 | + }else if gestureType == .Volume{ | |
533 | + volumeAdd(step: offset_y > 0 ? -VolumeStep : VolumeStep) | |
534 | + } | |
535 | + | |
536 | + } | |
537 | + | |
538 | + var VolumeStep:CGFloat = 0.02 | |
539 | + var ProgressStep:Float = 5 | |
540 | + override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { | |
541 | + switch gestureType { | |
542 | + case .None: | |
543 | + if !isAllBtnHidden{ | |
544 | + playPauseClickAction(self.view.viewWithTag(202) as! UIButton) | |
545 | + } | |
546 | + break | |
547 | + case .Brightness: | |
548 | + progressValue = 0 | |
549 | + gestureType = .None | |
550 | + | |
551 | + case .Progress: | |
552 | + gestureType = .None | |
553 | + if mPlayer != nil{ | |
554 | + mPlayer.seek(to: TimeInterval(slider.value)) | |
555 | + } | |
556 | + progressValue = 0 | |
557 | + default: | |
558 | + break | |
559 | + } | |
560 | + bSeeking = false | |
561 | + displayAllBtn() | |
562 | + } | |
563 | + | |
564 | + //func willShowComments(_ seek: Bool) -> CGFloat { | |
565 | + // return commentNUM | |
566 | + //} | |
567 | + | |
568 | + | |
569 | + override func didReceiveMemoryWarning() { | |
570 | + super.didReceiveMemoryWarning() | |
571 | + // Dispose of any resources that can be recreated. | |
572 | + } | |
573 | + | |
574 | + func volumeAdd(step:CGFloat){ | |
575 | + let volumeView = MPVolumeView() | |
576 | + var volumeSlider:UISlider! | |
577 | + for view in volumeView.subviews { | |
578 | + if view.classForCoder.description() == "MPVolumeSlider"{ | |
579 | + volumeSlider = view as? UISlider | |
580 | + break | |
581 | + } | |
582 | + } | |
583 | + volumeSlider.value = volumeSlider.value+Float(step) | |
584 | + } | |
585 | + // MARK: - 销毁通知 | |
586 | + deinit { | |
587 | + NotificationCenter.default.removeObserver(self) | |
588 | + } | |
589 | + /* | |
590 | + // MARK: - Navigation | |
591 | + | |
592 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | |
593 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
594 | + // Get the new view controller using segue.destinationViewController. | |
595 | + // Pass the selected object to the new view controller. | |
596 | + } | |
597 | + */ | |
598 | + | |
599 | +} | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard
... | ... | @@ -5,6 +5,304 @@ |
5 | 5 | </device> |
6 | 6 | <dependencies> |
7 | 7 | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> |
8 | + <capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | |
9 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
8 | 10 | </dependencies> |
9 | - <scenes/> | |
11 | + <scenes> | |
12 | + <!--Live Infor View Controller--> | |
13 | + <scene sceneID="QrF-a4-VNS"> | |
14 | + <objects> | |
15 | + <viewController storyboardIdentifier="LiveInforViewControllerVC" id="s4r-mT-PYC" customClass="LiveInforViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController"> | |
16 | + <layoutGuides> | |
17 | + <viewControllerLayoutGuide type="top" id="snl-VP-dYK"/> | |
18 | + <viewControllerLayoutGuide type="bottom" id="kPK-zX-bXF"/> | |
19 | + </layoutGuides> | |
20 | + <view key="view" contentMode="scaleToFill" id="ryJ-PM-vNa"> | |
21 | + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |
22 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
23 | + <subviews> | |
24 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gC6-xK-DuK"> | |
25 | + <rect key="frame" x="0.0" y="20" width="375" height="197"/> | |
26 | + <subviews> | |
27 | + <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lhy-r0-VWQ"> | |
28 | + <rect key="frame" x="0.0" y="0.0" width="375" height="197"/> | |
29 | + <connections> | |
30 | + <segue destination="AG5-Hc-gbL" kind="embed" identifier="player" id="7RX-MD-Wib"/> | |
31 | + </connections> | |
32 | + </containerView> | |
33 | + </subviews> | |
34 | + <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> | |
35 | + <constraints> | |
36 | + <constraint firstItem="Lhy-r0-VWQ" firstAttribute="leading" secondItem="gC6-xK-DuK" secondAttribute="leading" id="8Xf-WG-xO3"/> | |
37 | + <constraint firstAttribute="bottom" secondItem="Lhy-r0-VWQ" secondAttribute="bottom" id="Ovx-fX-8ZY"/> | |
38 | + <constraint firstAttribute="trailing" secondItem="Lhy-r0-VWQ" secondAttribute="trailing" id="eA6-YF-3Cr"/> | |
39 | + <constraint firstAttribute="width" secondItem="gC6-xK-DuK" secondAttribute="height" multiplier="375:197" id="h7W-7Q-uoS"/> | |
40 | + <constraint firstItem="Lhy-r0-VWQ" firstAttribute="top" secondItem="gC6-xK-DuK" secondAttribute="top" id="x7d-k0-shm"/> | |
41 | + </constraints> | |
42 | + </view> | |
43 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0dd-f2-HXU"> | |
44 | + <rect key="frame" x="0.0" y="217" width="375" height="50"/> | |
45 | + <subviews> | |
46 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="上传者:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vhu-tv-jE5"> | |
47 | + <rect key="frame" x="62" y="14.5" width="57" height="21"/> | |
48 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
49 | + <nil key="textColor"/> | |
50 | + <nil key="highlightedColor"/> | |
51 | + </label> | |
52 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D0M-d2-H4x"> | |
53 | + <rect key="frame" x="317" y="14.5" width="42" height="21"/> | |
54 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
55 | + <nil key="textColor"/> | |
56 | + <nil key="highlightedColor"/> | |
57 | + </label> | |
58 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="defphoto.png" translatesAutoresizingMaskIntoConstraints="NO" id="pV2-jS-olB"> | |
59 | + <rect key="frame" x="16" y="10" width="30" height="30"/> | |
60 | + <constraints> | |
61 | + <constraint firstAttribute="width" secondItem="pV2-jS-olB" secondAttribute="height" multiplier="1:1" id="Fnh-z5-EBT"/> | |
62 | + <constraint firstAttribute="height" constant="30" id="VWP-zt-U9q"/> | |
63 | + </constraints> | |
64 | + </imageView> | |
65 | + </subviews> | |
66 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
67 | + <constraints> | |
68 | + <constraint firstAttribute="trailing" secondItem="D0M-d2-H4x" secondAttribute="trailing" constant="16" id="13y-bV-Zop"/> | |
69 | + <constraint firstItem="D0M-d2-H4x" firstAttribute="centerY" secondItem="0dd-f2-HXU" secondAttribute="centerY" id="FEe-yZ-UIw"/> | |
70 | + <constraint firstItem="pV2-jS-olB" firstAttribute="leading" secondItem="0dd-f2-HXU" secondAttribute="leading" constant="16" id="QHU-9G-jbE"/> | |
71 | + <constraint firstItem="vhu-tv-jE5" firstAttribute="leading" secondItem="pV2-jS-olB" secondAttribute="trailing" constant="16" id="ZEN-k0-SXx"/> | |
72 | + <constraint firstItem="pV2-jS-olB" firstAttribute="centerY" secondItem="0dd-f2-HXU" secondAttribute="centerY" id="jJA-NW-4Bo"/> | |
73 | + <constraint firstAttribute="height" constant="50" id="rEQ-CU-zbj"/> | |
74 | + <constraint firstItem="vhu-tv-jE5" firstAttribute="centerY" secondItem="0dd-f2-HXU" secondAttribute="centerY" id="toz-1B-3D4"/> | |
75 | + </constraints> | |
76 | + </view> | |
77 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="评论" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="37F-vt-Ubl"> | |
78 | + <rect key="frame" x="16" y="283" width="35" height="21"/> | |
79 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
80 | + <nil key="textColor"/> | |
81 | + <nil key="highlightedColor"/> | |
82 | + </label> | |
83 | + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="105" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="YzG-te-5GE"> | |
84 | + <rect key="frame" x="0.0" y="320" width="375" height="347"/> | |
85 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
86 | + <prototypes> | |
87 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="105" id="6hZ-hT-pb5" customClass="RemainCell" customModule="YouerLiveVideo" customModuleProvider="target"> | |
88 | + <rect key="frame" x="0.0" y="28" width="375" height="105"/> | |
89 | + <autoresizingMask key="autoresizingMask"/> | |
90 | + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="6hZ-hT-pb5" id="4h2-wz-x2X"> | |
91 | + <rect key="frame" x="0.0" y="0.0" width="375" height="104"/> | |
92 | + <autoresizingMask key="autoresizingMask"/> | |
93 | + <subviews> | |
94 | + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="defphoto.png" translatesAutoresizingMaskIntoConstraints="NO" id="f7H-p9-HHC"> | |
95 | + <rect key="frame" x="16" y="37" width="30" height="30"/> | |
96 | + <constraints> | |
97 | + <constraint firstAttribute="height" constant="30" id="upk-so-mba"/> | |
98 | + </constraints> | |
99 | + </imageView> | |
100 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2sM-NA-DnB"> | |
101 | + <rect key="frame" x="54" y="37" width="37.5" height="59.5"/> | |
102 | + <fontDescription key="fontDescription" type="system" pointSize="15"/> | |
103 | + <nil key="textColor"/> | |
104 | + <nil key="highlightedColor"/> | |
105 | + </label> | |
106 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qFu-il-ers"> | |
107 | + <rect key="frame" x="54" y="8" width="42" height="21"/> | |
108 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | |
109 | + <nil key="textColor"/> | |
110 | + <nil key="highlightedColor"/> | |
111 | + </label> | |
112 | + </subviews> | |
113 | + <constraints> | |
114 | + <constraint firstItem="qFu-il-ers" firstAttribute="top" secondItem="4h2-wz-x2X" secondAttribute="top" constant="8" id="9Aa-kY-qJV"/> | |
115 | + <constraint firstItem="f7H-p9-HHC" firstAttribute="centerY" secondItem="4h2-wz-x2X" secondAttribute="centerY" id="LFp-TX-eSb"/> | |
116 | + <constraint firstItem="2sM-NA-DnB" firstAttribute="leading" secondItem="f7H-p9-HHC" secondAttribute="trailing" constant="8" id="Ry6-2n-cpe"/> | |
117 | + <constraint firstItem="2sM-NA-DnB" firstAttribute="top" secondItem="qFu-il-ers" secondAttribute="bottom" constant="8" id="WWG-Zn-SB1"/> | |
118 | + <constraint firstAttribute="bottom" secondItem="2sM-NA-DnB" secondAttribute="bottom" constant="8" id="Y0q-CO-3Xt"/> | |
119 | + <constraint firstItem="qFu-il-ers" firstAttribute="leading" secondItem="f7H-p9-HHC" secondAttribute="trailing" constant="8" id="YsK-Gj-Abx"/> | |
120 | + <constraint firstItem="f7H-p9-HHC" firstAttribute="leading" secondItem="4h2-wz-x2X" secondAttribute="leading" constant="16" id="Yy4-ay-kIH"/> | |
121 | + <constraint firstItem="f7H-p9-HHC" firstAttribute="width" secondItem="f7H-p9-HHC" secondAttribute="height" multiplier="1:1" id="elw-Rd-wMV"/> | |
122 | + </constraints> | |
123 | + </tableViewCellContentView> | |
124 | + <connections> | |
125 | + <outlet property="remainContent" destination="2sM-NA-DnB" id="aZ5-OB-Bok"/> | |
126 | + <outlet property="remainName" destination="qFu-il-ers" id="UAq-gM-WoV"/> | |
127 | + <outlet property="remainPhoto" destination="f7H-p9-HHC" id="Epp-8Y-SYZ"/> | |
128 | + </connections> | |
129 | + </tableViewCell> | |
130 | + </prototypes> | |
131 | + <connections> | |
132 | + <outlet property="dataSource" destination="s4r-mT-PYC" id="ek1-Yw-7PU"/> | |
133 | + <outlet property="delegate" destination="s4r-mT-PYC" id="ZzP-m9-r2C"/> | |
134 | + </connections> | |
135 | + </tableView> | |
136 | + </subviews> | |
137 | + <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> | |
138 | + <constraints> | |
139 | + <constraint firstItem="YzG-te-5GE" firstAttribute="leading" secondItem="ryJ-PM-vNa" secondAttribute="leading" id="0sL-KS-Byo"/> | |
140 | + <constraint firstItem="gC6-xK-DuK" firstAttribute="top" secondItem="snl-VP-dYK" secondAttribute="bottom" id="1oC-0b-69r"/> | |
141 | + <constraint firstItem="37F-vt-Ubl" firstAttribute="leading" secondItem="ryJ-PM-vNa" secondAttribute="leading" constant="16" id="2g0-tI-TxZ"/> | |
142 | + <constraint firstItem="0dd-f2-HXU" firstAttribute="leading" secondItem="ryJ-PM-vNa" secondAttribute="leading" id="A8d-I4-F4c"/> | |
143 | + <constraint firstItem="37F-vt-Ubl" firstAttribute="top" secondItem="0dd-f2-HXU" secondAttribute="bottom" constant="16" id="Sca-nt-SSo"/> | |
144 | + <constraint firstAttribute="trailing" secondItem="YzG-te-5GE" secondAttribute="trailing" id="Sgg-8M-pCD"/> | |
145 | + <constraint firstAttribute="trailing" secondItem="0dd-f2-HXU" secondAttribute="trailing" id="XPS-2M-AsX"/> | |
146 | + <constraint firstItem="0dd-f2-HXU" firstAttribute="top" secondItem="gC6-xK-DuK" secondAttribute="bottom" id="Yvf-az-aNu"/> | |
147 | + <constraint firstItem="kPK-zX-bXF" firstAttribute="top" secondItem="YzG-te-5GE" secondAttribute="bottom" id="aco-v7-Z2w"/> | |
148 | + <constraint firstItem="gC6-xK-DuK" firstAttribute="leading" secondItem="ryJ-PM-vNa" secondAttribute="leading" id="ccP-uW-9L0"/> | |
149 | + <constraint firstAttribute="trailing" secondItem="gC6-xK-DuK" secondAttribute="trailing" id="paS-4R-cgF"/> | |
150 | + <constraint firstItem="YzG-te-5GE" firstAttribute="top" secondItem="37F-vt-Ubl" secondAttribute="bottom" constant="16" id="qqu-Cb-zkI"/> | |
151 | + </constraints> | |
152 | + </view> | |
153 | + <connections> | |
154 | + <outlet property="livePalyer" destination="gC6-xK-DuK" id="GdW-rI-5cs"/> | |
155 | + <outlet property="player" destination="Lhy-r0-VWQ" id="F7N-Px-QJk"/> | |
156 | + <outlet property="updataPersonName" destination="vhu-tv-jE5" id="DKg-wh-dO1"/> | |
157 | + <outlet property="updataPersonPhoto" destination="pV2-jS-olB" id="fe1-wA-Vls"/> | |
158 | + <outlet property="updataTime" destination="D0M-d2-H4x" id="o5h-0g-DCX"/> | |
159 | + </connections> | |
160 | + </viewController> | |
161 | + <placeholder placeholderIdentifier="IBFirstResponder" id="SKN-jS-qgG" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
162 | + </objects> | |
163 | + <point key="canvasLocation" x="32.799999999999997" y="265.81709145427288"/> | |
164 | + </scene> | |
165 | + <!--Moive Player View Controller--> | |
166 | + <scene sceneID="ROY-Hr-0Qk"> | |
167 | + <objects> | |
168 | + <viewController storyboardIdentifier="MoivePlayerViewControllerVC" id="AG5-Hc-gbL" customClass="MoivePlayerViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController"> | |
169 | + <layoutGuides> | |
170 | + <viewControllerLayoutGuide type="top" id="jyA-tw-Uyk"/> | |
171 | + <viewControllerLayoutGuide type="bottom" id="oH7-yb-GUD"/> | |
172 | + </layoutGuides> | |
173 | + <view key="view" contentMode="scaleToFill" id="Rfl-kc-zCQ"> | |
174 | + <rect key="frame" x="0.0" y="0.0" width="375" height="197"/> | |
175 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
176 | + <subviews> | |
177 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Thc-Nf-cbR"> | |
178 | + <rect key="frame" x="0.0" y="-20" width="375" height="217"/> | |
179 | + <subviews> | |
180 | + <button hidden="YES" opaque="NO" tag="202" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MUs-SM-Frh"> | |
181 | + <rect key="frame" x="337" y="96" width="30" height="30"/> | |
182 | + <constraints> | |
183 | + <constraint firstAttribute="width" secondItem="MUs-SM-Frh" secondAttribute="height" multiplier="1:1" id="ItK-UQ-dV5"/> | |
184 | + <constraint firstAttribute="height" constant="30" id="v4s-t0-4WZ"/> | |
185 | + </constraints> | |
186 | + <state key="normal" backgroundImage="starLive"/> | |
187 | + <connections> | |
188 | + <action selector="playPauseClickAction:" destination="AG5-Hc-gbL" eventType="touchUpInside" id="GBR-eV-jm0"/> | |
189 | + </connections> | |
190 | + </button> | |
191 | + <button hidden="YES" opaque="NO" tag="200" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xoR-0a-vkL"> | |
192 | + <rect key="frame" x="337" y="20" width="30" height="30"/> | |
193 | + <constraints> | |
194 | + <constraint firstAttribute="width" secondItem="xoR-0a-vkL" secondAttribute="height" multiplier="1:1" id="2Bn-3Z-hmn"/> | |
195 | + <constraint firstAttribute="width" constant="30" id="4mL-wm-czK"/> | |
196 | + </constraints> | |
197 | + <state key="normal" backgroundImage="closeAlive"/> | |
198 | + <connections> | |
199 | + <action selector="backBtnClickAction:" destination="AG5-Hc-gbL" eventType="touchUpInside" id="kmy-8E-4U8"/> | |
200 | + </connections> | |
201 | + </button> | |
202 | + <button hidden="YES" opaque="NO" tag="201" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gtT-Mf-dIt"> | |
203 | + <rect key="frame" x="337" y="58" width="30" height="30"/> | |
204 | + <constraints> | |
205 | + <constraint firstAttribute="width" secondItem="gtT-Mf-dIt" secondAttribute="height" multiplier="1:1" id="O7Q-Ee-lkM"/> | |
206 | + <constraint firstAttribute="height" constant="30" id="eyK-dy-ZAb"/> | |
207 | + </constraints> | |
208 | + <state key="normal" backgroundImage="screen_full"/> | |
209 | + <connections> | |
210 | + <action selector="isHorScreenClickAction:" destination="AG5-Hc-gbL" eventType="touchUpInside" id="RHa-U8-lFw"/> | |
211 | + </connections> | |
212 | + </button> | |
213 | + <view tag="206" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jyu-RM-z6z"> | |
214 | + <rect key="frame" x="0.0" y="167" width="375" height="50"/> | |
215 | + <subviews> | |
216 | + <label opaque="NO" userInteractionEnabled="NO" tag="205" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00:00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MVE-hx-Orw"> | |
217 | + <rect key="frame" x="314" y="19" width="57" height="16"/> | |
218 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
219 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
220 | + <nil key="highlightedColor"/> | |
221 | + </label> | |
222 | + <label opaque="NO" userInteractionEnabled="NO" tag="204" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00:00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N0I-7c-9U5"> | |
223 | + <rect key="frame" x="4" y="19" width="57" height="16"/> | |
224 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
225 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
226 | + <nil key="highlightedColor"/> | |
227 | + </label> | |
228 | + <slider opaque="NO" tag="203" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="VR5-78-Tv5"> | |
229 | + <rect key="frame" x="67" y="12" width="241" height="31"/> | |
230 | + <color key="minimumTrackTintColor" red="0.50980392159999999" green="0.81176470590000005" blue="0.44705882349999998" alpha="1" colorSpace="calibratedRGB"/> | |
231 | + <color key="maximumTrackTintColor" red="0.90980392160000001" green="0.90196078430000004" blue="0.90588235289999997" alpha="1" colorSpace="calibratedRGB"/> | |
232 | + <color key="thumbTintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
233 | + <connections> | |
234 | + <action selector="sliderPanAction:" destination="AG5-Hc-gbL" eventType="valueChanged" id="ddq-LB-dDE"/> | |
235 | + </connections> | |
236 | + </slider> | |
237 | + </subviews> | |
238 | + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29097630029999999" colorSpace="calibratedRGB"/> | |
239 | + <constraints> | |
240 | + <constraint firstItem="MVE-hx-Orw" firstAttribute="width" secondItem="N0I-7c-9U5" secondAttribute="width" id="0d2-xX-4nN"/> | |
241 | + <constraint firstItem="VR5-78-Tv5" firstAttribute="centerY" secondItem="N0I-7c-9U5" secondAttribute="centerY" id="8EE-EE-sQZ"/> | |
242 | + <constraint firstItem="VR5-78-Tv5" firstAttribute="centerX" secondItem="jyu-RM-z6z" secondAttribute="centerX" id="ApZ-Ak-yhy"/> | |
243 | + <constraint firstItem="MVE-hx-Orw" firstAttribute="leading" secondItem="VR5-78-Tv5" secondAttribute="trailing" constant="8" id="Lc3-an-SXP"/> | |
244 | + <constraint firstItem="VR5-78-Tv5" firstAttribute="leading" secondItem="N0I-7c-9U5" secondAttribute="trailing" constant="8" id="M3G-DW-MW4"/> | |
245 | + <constraint firstAttribute="trailing" secondItem="MVE-hx-Orw" secondAttribute="trailing" constant="4" id="ZPh-Tc-zq2"/> | |
246 | + <constraint firstAttribute="bottom" secondItem="VR5-78-Tv5" secondAttribute="bottom" constant="8" id="Zlx-sv-yGg"/> | |
247 | + <constraint firstItem="N0I-7c-9U5" firstAttribute="leading" secondItem="jyu-RM-z6z" secondAttribute="leading" constant="4" id="fnf-ZI-7lR"/> | |
248 | + <constraint firstAttribute="height" constant="50" id="pzL-9r-PEl"/> | |
249 | + <constraint firstItem="MVE-hx-Orw" firstAttribute="centerY" secondItem="N0I-7c-9U5" secondAttribute="centerY" id="rRf-Bp-kiI"/> | |
250 | + </constraints> | |
251 | + </view> | |
252 | + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4U1-AM-dYP"> | |
253 | + <rect key="frame" x="162" y="83.5" width="50" height="50"/> | |
254 | + <constraints> | |
255 | + <constraint firstAttribute="width" secondItem="4U1-AM-dYP" secondAttribute="height" multiplier="1:1" id="HVQ-X7-j64"/> | |
256 | + <constraint firstAttribute="height" constant="50" id="nns-jU-6ym"/> | |
257 | + </constraints> | |
258 | + <state key="normal" backgroundImage="starLive"/> | |
259 | + <connections> | |
260 | + <action selector="playPauseClickAction:" destination="AG5-Hc-gbL" eventType="touchUpInside" id="0ya-jd-K9X"/> | |
261 | + </connections> | |
262 | + </button> | |
263 | + </subviews> | |
264 | + <gestureRecognizers/> | |
265 | + <constraints> | |
266 | + <constraint firstItem="MUs-SM-Frh" firstAttribute="top" secondItem="gtT-Mf-dIt" secondAttribute="bottom" constant="8" id="7TN-tG-rMh"/> | |
267 | + <constraint firstAttribute="trailing" secondItem="gtT-Mf-dIt" secondAttribute="trailing" constant="8" id="IKl-bt-8xr"/> | |
268 | + <constraint firstItem="xoR-0a-vkL" firstAttribute="top" secondItem="Thc-Nf-cbR" secondAttribute="top" constant="20" id="MZv-Tg-ytZ"/> | |
269 | + <constraint firstItem="4U1-AM-dYP" firstAttribute="centerX" secondItem="Thc-Nf-cbR" secondAttribute="centerX" id="R3s-VU-viS"/> | |
270 | + <constraint firstAttribute="bottom" secondItem="jyu-RM-z6z" secondAttribute="bottom" id="RDS-2i-FQc"/> | |
271 | + <constraint firstItem="4U1-AM-dYP" firstAttribute="centerY" secondItem="Thc-Nf-cbR" secondAttribute="centerY" id="SLZ-s7-jFa"/> | |
272 | + <constraint firstAttribute="trailing" secondItem="xoR-0a-vkL" secondAttribute="trailing" constant="8" id="SeC-Wb-vCU"/> | |
273 | + <constraint firstItem="gtT-Mf-dIt" firstAttribute="top" secondItem="xoR-0a-vkL" secondAttribute="bottom" constant="8" id="Yw0-Dn-jnC"/> | |
274 | + <constraint firstItem="jyu-RM-z6z" firstAttribute="leading" secondItem="Thc-Nf-cbR" secondAttribute="leading" id="ip2-Fm-2LR"/> | |
275 | + <constraint firstAttribute="trailing" secondItem="MUs-SM-Frh" secondAttribute="trailing" constant="8" id="ngv-X0-VLJ"/> | |
276 | + <constraint firstAttribute="trailing" secondItem="jyu-RM-z6z" secondAttribute="trailing" id="tnu-1J-WOD"/> | |
277 | + <constraint firstAttribute="trailing" secondItem="gtT-Mf-dIt" secondAttribute="trailing" constant="8" id="vdh-FT-aA6"/> | |
278 | + </constraints> | |
279 | + </view> | |
280 | + </subviews> | |
281 | + <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> | |
282 | + <constraints> | |
283 | + <constraint firstItem="Thc-Nf-cbR" firstAttribute="top" secondItem="jyA-tw-Uyk" secondAttribute="bottom" constant="-20" id="4xS-O5-iwu"/> | |
284 | + <constraint firstItem="oH7-yb-GUD" firstAttribute="top" secondItem="Thc-Nf-cbR" secondAttribute="bottom" id="F8z-Oh-aZr"/> | |
285 | + <constraint firstItem="Thc-Nf-cbR" firstAttribute="leading" secondItem="Rfl-kc-zCQ" secondAttribute="leading" id="YlV-yz-8b8"/> | |
286 | + <constraint firstAttribute="trailing" secondItem="Thc-Nf-cbR" secondAttribute="trailing" id="x6F-Qq-L1a"/> | |
287 | + </constraints> | |
288 | + </view> | |
289 | + <connections> | |
290 | + <outlet property="endTime" destination="MVE-hx-Orw" id="r7b-wF-28o"/> | |
291 | + <outlet property="pauseImageBtn" destination="4U1-AM-dYP" id="LcL-Wn-NKB"/> | |
292 | + <outlet property="screenHorizontalBtn" destination="gtT-Mf-dIt" id="Zee-tI-mrf"/> | |
293 | + <outlet property="slider" destination="VR5-78-Tv5" id="XJX-b6-dfx"/> | |
294 | + <outlet property="startTime" destination="N0I-7c-9U5" id="QN8-hu-O3X"/> | |
295 | + </connections> | |
296 | + </viewController> | |
297 | + <placeholder placeholderIdentifier="IBFirstResponder" id="Ado-Jr-Adu" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
298 | + </objects> | |
299 | + <point key="canvasLocation" x="33" y="848"/> | |
300 | + </scene> | |
301 | + </scenes> | |
302 | + <resources> | |
303 | + <image name="closeAlive" width="33" height="33"/> | |
304 | + <image name="defphoto.png" width="256" height="256"/> | |
305 | + <image name="screen_full" width="33" height="33"/> | |
306 | + <image name="starLive" width="22" height="22"/> | |
307 | + </resources> | |
10 | 308 | </document> | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift
... | ... | @@ -150,12 +150,12 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel |
150 | 150 | } |
151 | 151 | |
152 | 152 | func sectionIndexTitles(for tableView: UITableView) -> [String]? { |
153 | - if tableView == selectTableView{ | |
154 | - return [] | |
155 | - }else{ | |
156 | - return allKeys+["#"] | |
153 | + if tableView != selectTableView{ | |
154 | + if allKeys.count > 0{ | |
155 | + return allKeys+["#"] | |
156 | + } | |
157 | 157 | } |
158 | - | |
158 | + return [] | |
159 | 159 | } |
160 | 160 | |
161 | 161 | func numberOfSections(in tableView: UITableView) -> Int { |
... | ... | @@ -182,10 +182,6 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel |
182 | 182 | return 44 |
183 | 183 | } |
184 | 184 | } |
185 | - | |
186 | - func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { | |
187 | - return 1 | |
188 | - } | |
189 | 185 | } |
190 | 186 | |
191 | 187 | class SearchTVStationListCell: UITableViewCell { | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard
... | ... | @@ -145,29 +145,34 @@ |
145 | 145 | <constraint firstItem="REy-qu-6cO" firstAttribute="centerX" secondItem="q0y-9I-pQG" secondAttribute="centerX" id="zoe-K7-XTj"/> |
146 | 146 | </constraints> |
147 | 147 | </view> |
148 | - <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="123" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="o4U-1y-nqL"> | |
148 | + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="84" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="o4U-1y-nqL"> | |
149 | 149 | <rect key="frame" x="0.0" y="92" width="375" height="575"/> |
150 | 150 | <color key="backgroundColor" red="0.93503493069999999" green="0.93562394380000002" blue="0.96585971120000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
151 | + <view key="tableFooterView" contentMode="scaleToFill" id="Ur7-JI-nZm"> | |
152 | + <rect key="frame" x="0.0" y="112" width="375" height="1"/> | |
153 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
154 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
155 | + </view> | |
151 | 156 | <prototypes> |
152 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="123" id="MMn-tR-I0v" customClass="SearchTVStationListCell" customModule="YouerLiveVideo" customModuleProvider="target"> | |
153 | - <rect key="frame" x="0.0" y="28" width="375" height="123"/> | |
157 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="84" id="MMn-tR-I0v" customClass="SearchTVStationListCell" customModule="YouerLiveVideo" customModuleProvider="target"> | |
158 | + <rect key="frame" x="0.0" y="28" width="375" height="84"/> | |
154 | 159 | <autoresizingMask key="autoresizingMask"/> |
155 | 160 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="MMn-tR-I0v" id="H7d-Zz-WAS"> |
156 | - <rect key="frame" x="0.0" y="0.0" width="375" height="122"/> | |
161 | + <rect key="frame" x="0.0" y="0.0" width="375" height="83"/> | |
157 | 162 | <autoresizingMask key="autoresizingMask"/> |
158 | 163 | <subviews> |
159 | 164 | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Yk-8z-nas"> |
160 | - <rect key="frame" x="8" y="4" width="359" height="114.5"/> | |
165 | + <rect key="frame" x="8" y="4" width="359" height="75.5"/> | |
161 | 166 | <subviews> |
162 | 167 | <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="IYQ-S7-ka2"> |
163 | - <rect key="frame" x="8" y="33.5" width="80" height="48"/> | |
168 | + <rect key="frame" x="8" y="14" width="80" height="48"/> | |
164 | 169 | <constraints> |
165 | 170 | <constraint firstAttribute="width" constant="80" id="XKV-mN-TaH"/> |
166 | 171 | <constraint firstAttribute="width" secondItem="IYQ-S7-ka2" secondAttribute="height" multiplier="5:3" id="tZU-XC-3Mh"/> |
167 | 172 | </constraints> |
168 | 173 | </imageView> |
169 | 174 | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lnl-RY-Pw3"> |
170 | - <rect key="frame" x="96" y="47" width="42" height="21"/> | |
175 | + <rect key="frame" x="96" y="27.5" width="42" height="21"/> | |
171 | 176 | <fontDescription key="fontDescription" type="system" pointSize="17"/> |
172 | 177 | <nil key="textColor"/> |
173 | 178 | <nil key="highlightedColor"/> |
... | ... | @@ -204,9 +209,14 @@ |
204 | 209 | <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LO5-7p-BlF"> |
205 | 210 | <rect key="frame" x="0.0" y="92" width="375" height="575"/> |
206 | 211 | <subviews> |
207 | - <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="IbJ-62-QUz"> | |
212 | + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="IbJ-62-QUz"> | |
208 | 213 | <rect key="frame" x="0.0" y="0.0" width="375" height="575"/> |
209 | 214 | <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> |
215 | + <view key="tableFooterView" contentMode="scaleToFill" id="3xH-Ja-uTC"> | |
216 | + <rect key="frame" x="0.0" y="72" width="375" height="1"/> | |
217 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
218 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
219 | + </view> | |
210 | 220 | <prototypes> |
211 | 221 | <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" id="1Ns-5p-fDD" customClass="SearchSelectCell" customModule="YouerLiveVideo" customModuleProvider="target"> |
212 | 222 | <rect key="frame" x="0.0" y="28" width="375" height="44"/> |
... | ... | @@ -239,7 +249,7 @@ |
239 | 249 | </connections> |
240 | 250 | </tableView> |
241 | 251 | </subviews> |
242 | - <color key="backgroundColor" white="0.66666666666666663" alpha="0.50786493288590606" colorSpace="calibratedWhite"/> | |
252 | + <color key="backgroundColor" white="0.66666666669999997" alpha="0.50786493290000001" colorSpace="calibratedWhite"/> | |
243 | 253 | <constraints> |
244 | 254 | <constraint firstItem="IbJ-62-QUz" firstAttribute="leading" secondItem="LO5-7p-BlF" secondAttribute="leading" id="JAu-J6-dIy"/> |
245 | 255 | <constraint firstAttribute="bottom" secondItem="IbJ-62-QUz" secondAttribute="bottom" id="JKF-1f-M6c"/> | ... | ... |
YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStationViewController.swift
... | ... | @@ -150,6 +150,9 @@ extension TVStationViewController:UICollectionViewDelegate,UICollectionViewDeleg |
150 | 150 | let vc = Story.instantiateViewControllerWithIdentifier("TVStationInforViewControllerVC", storyName: "TVStation") as! TVStationInforViewController |
151 | 151 | vc.excellentTVStationProgram = excellentTVStationProgram[indexPath.row] |
152 | 152 | self.navigationController?.pushViewController(vc, animated: true) |
153 | + }else{ | |
154 | + let vc = Story.instantiateViewControllerWithIdentifier("LiveInforViewControllerVC", storyName: "Resource") as! LiveInforViewController | |
155 | + self.navigationController?.pushViewController(vc, animated: true) | |
153 | 156 | } |
154 | 157 | } |
155 | 158 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | ... | ... |
YouerLiveVideo/YouerLiveVideo/util/utiles.swift
... | ... | @@ -9,7 +9,11 @@ import UIKit |
9 | 9 | import Foundation |
10 | 10 | import Photos |
11 | 11 | import QuickLook |
12 | + | |
13 | +let CGPointZero = CGPoint(x:0, y:0) | |
14 | + | |
12 | 15 | class AlertController { |
16 | + | |
13 | 17 | static func creatAlert(_ title:String)->UIAlertController{ |
14 | 18 | let alert = UIAlertController(title: "消息",message: title,preferredStyle: UIAlertControllerStyle.alert) |
15 | 19 | alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in | ... | ... |