A node that displays video content.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 3.2+
Like any other node, you can put the movie node anywhere inside the node tree and SpriteKit will render it properly. For example, you might use a video node to animate some visual behaviors that would be expensive to define using a collection of textures.
A video node offers only a subset of the features available to the
A video node is always stretched uniformly.
A video node cannot be colorized. However, a video node can be added as a child of a
SKEffectto add Core Image filters for color treatments and other effects.
A video node always uses an alpha blend mode.
A video node cannot use custom shaders or lighting.
When a video node is created, its
size property is initialized to the base size of the video content, but you can change it if you want. The video content is automatically stretched to the new size. As with a sprite node, the
anchor property defines where the content is displayed relative to the node position.
If you need more precise control over the video playback behavior, you can use AVFoundation to create an
AVPlayer object for your video content and then use this object to initialize the
SKVideo node. Then, instead of using the node’s playback methods, you use the
AVPlayer object to control playback. The video content is automatically displayed in the video node. For more information, see AVFoundation Programming Guide.