Skip to content

Commit

Permalink
feat(VideoPlayer): added videoPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
gevorg94 committed Nov 14, 2016
1 parent 4bd47ac commit 4ef7631
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions ios/RNVideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class RNVideoPlayer: RCTView {

var source: NSString? {
set {
configure()
}
get {
return nil
Expand Down Expand Up @@ -42,4 +43,23 @@ class RNVideoPlayer: RCTView {
return nil
}
}

func configure() {
let renderView = RenderView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
renderView.backgroundColor = UIColor.green
self.addSubview(renderView)
let bundleURL = Bundle.main.resourceURL!
let movieURL = URL(string: "Simons_Cat.mp4", relativeTo: bundleURL)!
let sepiot = SepiaToneFilter()

do {
movie = try MovieInput(url: movieURL, playAtActualSpeed: true, loop: true)

movie --> sepiot --> renderView
movie.runBenchmark = true;
movie.start()
} catch {
print("Something went wrong: \(error)")
}
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions ios/RNVideoProcessingManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import Foundation

@objc(RNVideoProcessing)
class RNVideoProcessing: RCTViewManager {
@objc(RNVideoProcessingManager)
class RNVideoProcessingManager: RCTViewManager {

@objc override func view() -> UIView! {
return RNVideoPlayer()
Expand Down

0 comments on commit 4ef7631

Please sign in to comment.