- Notifications
You must be signed in to change notification settings - Fork13
ARKit demo that streams a video on a wall
License
NotificationsYou must be signed in to change notification settings
Bersaelor/WallStreaming
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Small example demonstrating how to play a video on a wall usingARKit.
This became possible when iOS 11.3 / ARKit "1.5" added the.vertical
option for the.planeDetection
parameter ofARWorldTrackingConfiguration
.
The only "trick" was to useSpriteKit
'sSKVideoNode
in an standardSpriteKit
SKScene
:
letplayerItem=AVPlayerItem(url: streamURL)letplayer=AVPlayer(playerItem: playerItem)letvideoNode=SKVideoNode(avPlayer: player) scene.addChild(videoNode)
and setting the texture of the virtual wall added whereARKit
detects the vertical surface:
guardlet material= plane.materials.firstelse{return} material.diffuse.contents= scene