forked from sahin/mobileplayer-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleViewController.swift
44 lines (37 loc) · 1.42 KB
/
ExampleViewController.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
44
//
// ExampleViewController.swift
// MobilePlayer
//
// Created by Baris Sencan on 23/11/2015.
// Copyright © 2015 MovieLaLa. All rights reserved.
//
import UIKit
class ExampleViewController: UIViewController {
let codeImageView = UIImageView(frame: CGRectZero)
let videoURL = NSURL(string: "https://movielalavideos.blob.core.windows.net/videos/563cb51788b8c6db4b000376.mp4")!
let videoTitle = "Star Wars: Episode VII - The Force Awakens - International Trailer"
let videoID = "1"
init() {
super.init(nibName: nil, bundle: nil)
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Show Player", style: .Plain, target: self, action: "showButtonDidGetTapped")
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(red: 0.11, green: 0.11, blue: 0.11, alpha: 1)
view.addSubview(codeImageView)
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
let size = view.frame.size
let top = topLayoutGuide.length
codeImageView.sizeToFit()
codeImageView.frame.origin.x = (size.width - codeImageView.frame.size.width) / 2
codeImageView.frame.origin.y = top + (size.height - top - codeImageView.frame.size.height) / 2
}
func showButtonDidGetTapped() {
fatalError("showButtonDidGetTapped() has not been implemented")
}
}