360 video player for iOS written in swift - a subset of SceneKit that works
An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more!
See the wiki! or:
pod 'DDDKit'
import DDDKit
import AVFoundation
class ViewController: DDD360VideoViewController {
override func viewDidLoad() {
super.viewDidLoad()
show(from: myVideoURL)
}
}
// B&W filter:
@IBAction func didPressBW(_ sender: Any) {
let program = try! DDDShaderProgram(fragment: defaultShader, shaderModifiers: [
.fragment: "gl_FragColor = vec4(vec3(gl_FragColor.x + gl_FragColor.y + gl_FragColor.z) / 3.0, 1.0);",
])
videoNode.material.shaderProgram = program
}
node.geometry = DDDGeometry.Cube()
let videoTexture = DDDVideoTexture(player: player) // AVPlayer with 360 cubic video
node.material.set(
property: videoTexture,
for: "SamplerY",
and: "SamplerUV"
)
See the wiki!
Guillaume Sabran, [email protected], CTO @Pie
DDDKit is available under the MIT license. See the LICENSE file for more info.