Skip to content

Bersaelor/WallStreaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WallStreaming

Small example demonstrating how to play a video on a wall using ARKit.

Video on the wall

This became possible when iOS 11.3 / ARKit "1.5" added the .vertical option for the .planeDetection parameter of ARWorldTrackingConfiguration.

The only "trick" was to use SpriteKit's SKVideoNode in an standard SpriteKit SKScene:

    let playerItem = AVPlayerItem(url: streamURL)
    let player = AVPlayer(playerItem: playerItem)
    let videoNode = SKVideoNode(avPlayer: player)
    scene.addChild(videoNode)

and setting the texture of the virtual wall added where ARKit detects the vertical surface:

    guard let material = plane.materials.first else { return }
    material.diffuse.contents = scene

About

ARKit demo that streams a video on a wall

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages