{"action":"created","issue":{"url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/55","repository_url":"https://api.github.com/repos/MillmanY/MMPlayerView","labels_url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/55/comments","events_url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/55/events","html_url":"https://github.com/MillmanY/MMPlayerView/issues/55","id":367629514,"node_id":"MDU6SXNzdWUzNjc2Mjk1MTQ=","number":55,"title":"How to pass video with Present transition","user":{"login":"Cez95","id":28368429,"node_id":"MDQ6VXNlcjI4MzY4NDI5","avatar_url":"https://avatars3.githubusercontent.com/u/28368429?v=4","gravatar_id":"","url":"https://api.github.com/users/Cez95","html_url":"https://github.com/Cez95","followers_url":"https://api.github.com/users/Cez95/followers","following_url":"https://api.github.com/users/Cez95/following{/other_user}","gists_url":"https://api.github.com/users/Cez95/gists{/gist_id}","starred_url":"https://api.github.com/users/Cez95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cez95/subscriptions","organizations_url":"https://api.github.com/users/Cez95/orgs","repos_url":"https://api.github.com/users/Cez95/repos","events_url":"https://api.github.com/users/Cez95/events{/privacy}","received_events_url":"https://api.github.com/users/Cez95/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-10-08T03:37:31Z","updated_at":"2018-10-08T14:37:19Z","closed_at":null,"author_association":"NONE","body":"I am trying to pass the layer in a present transition (modal) and I don't want to re-download the video after I segue. This is my current implementation but it doesn't work properly\r\n\r\nFirst VC:\r\n    // Used as the layer to play video for cells that display video\r\n    public let mmPlayerLayer: MMPlayerLayer = {\r\n        let view = MMPlayerLayer()\r\n        view.cacheType = .memory(count: 5)\r\n        view.coverFitType = .fitToPlayerView\r\n        view.videoGravity = AVLayerVideoGravity.resizeAspectFill\r\n//        view.autoPlay = true\r\n        view.player?.isMuted = true\r\n        return view\r\n    }()\r\n            let vc = VideoVC(nibName: nil, bundle: nil)\r\n            self.prepare(for: UIStoryboardSegue(identifier: SEGUE_TO_VIDEO, source: self, destination: vc), sender: post)\r\n            self.mmPlayerTransition.present.pass { (_) in}\r\n            self.present(vc, animated: true, completion: {})\r\n\r\nextension FirstVC: MMPlayerFromProtocol {\r\n    var passPlayer: MMPlayerLayer {\r\n        get {\r\n            return self.mmPlayerLayer\r\n        }\r\n        \r\n    }\r\n    func transitionWillStart() {\r\n        \r\n    }\r\n    \r\n    func transitionCompleted() {\r\n    }\r\n    \r\n}\r\n\r\nSecond VC:\r\n\r\n    required init?(coder aDecoder: NSCoder) {\r\n        super.init(coder: aDecoder)\r\n\r\n        // Start Video\r\n        self.mmPlayerTransition.present.pass { (config) in\r\n            config.duration = 0.3\r\n        }\r\n\r\n    }\r\n\r\n    private lazy var mmPlayerLayer: MMPlayerLayer = {\r\n        let view = MMPlayerLayer()\r\n        view.cacheType = .memory(count: 5)\r\n        view.coverFitType = .fitToPlayerView\r\n        view.videoGravity = AVLayerVideoGravity.resizeAspectFill\r\n        view.autoPlay = true\r\n        view.player?.isMuted = true\r\n        return view\r\n    }()\r\n\r\nextension VideoVC: MMPlayerToProtocol {\r\n    var containerView: UIView {\r\n        get {\r\n            return self.videoViewThumbnail\r\n        }\r\n    }\r\n    \r\n    func transitionCompleted(player: MMPlayerLayer) {\r\n       self.mmPlayerLayer = player\r\n    }\r\n}"},"comment":{"url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/comments/427860178","html_url":"https://github.com/MillmanY/MMPlayerView/issues/55#issuecomment-427860178","issue_url":"https://api.github.com/repos/MillmanY/MMPlayerView/issues/55","id":427860178,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzg2MDE3OA==","user":{"login":"MillmanY","id":15795598,"node_id":"MDQ6VXNlcjE1Nzk1NTk4","avatar_url":"https://avatars1.githubusercontent.com/u/15795598?v=4","gravatar_id":"","url":"https://api.github.com/users/MillmanY","html_url":"https://github.com/MillmanY","followers_url":"https://api.github.com/users/MillmanY/followers","following_url":"https://api.github.com/users/MillmanY/following{/other_user}","gists_url":"https://api.github.com/users/MillmanY/gists{/gist_id}","starred_url":"https://api.github.com/users/MillmanY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MillmanY/subscriptions","organizations_url":"https://api.github.com/users/MillmanY/orgs","repos_url":"https://api.github.com/users/MillmanY/repos","events_url":"https://api.github.com/users/MillmanY/events{/privacy}","received_events_url":"https://api.github.com/users/MillmanY/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T14:37:19Z","updated_at":"2018-10-08T14:37:19Z","author_association":"OWNER","body":"Can i ask why you (\"let vc = VideoVC(nibName: nil, bundle: nil)\") nibName is nil , you create subview in code ? \r\n"}}
{"actor":{"display_login":"MillmanY"}}