Questions tagged [skvideonode]

An SKVideoNode is a node that plays live video. A video node can be instantiated using a video file in the bundle. Or, if you need more precise control over video playback, you can instantiate the video node using an AVPlayer object. Available in iOS 7.0 and later.

47 questions
1
vote
1 answer

Spritekit - SKSpriteNode video plays sometimes and not others using AVPlayer

I have random videos playing in my app. They are of mp4 format. Using code below I select a random number which decides which video to play. It seems to play a lot of the time but other times just the sound plays with no video. I tested z value…
Eric Means
  • 123
  • 1
  • 10
1
vote
1 answer

SKVideoNode.pause() not pausing video

I have an SKVideoNode, like so - let path = "videoURL"; let url = NSURL(string: path); let asset = AVURLAsset(URL: url!,options: nil); let playerItem = AVPlayerItem(asset: asset); let playerThree = AVPlayer(playerItem: playerItem); let videoNode =…
Gerwin
  • 1,572
  • 5
  • 23
  • 51
1
vote
1 answer

Play video from camera roll in SpriteKit SKVideoNode

I've got most of this working but I'm stuck with something that might be simple. Im trying to play a video from the camera roll in SpriteKit. A video will play from the main bundle, and the video picker also works until I choose the video. I think…
Jeff
  • 840
  • 10
  • 29
0
votes
1 answer

Playing a local video in a SpriteKit scene

Working on taking around 23 ".mov" files - short animations - that will piece together to make a children's book, with a choose-your-own-adventure style to it. I feel like I have a decent grasp on what needs to be done on a macro sense, present the…
0
votes
0 answers

How to play a video from url using SKVideoNode?

I'm getting the url using PHPickerViewControllerDelegate. I've confirmed that my url has properly feed into the code but when i play the video node, no video is displayed and i dont hear any sound, so it's not a layering issue. We can call this…
0
votes
0 answers

SpriteKit; How to loop a SKVideoNode?

I am currently trying to play a video in a loop via SpriteKit. I know that I need AVFoundation and the AVPLayer() for this, however I don't know how to initialize and use this... Could someone help me with this? Here is my current code block: let…
chickenbox
  • 25
  • 6
0
votes
1 answer

Is SKVideoNode compatible with Scene Editor?

I'm trying to add .mov files to my .sks file in scene editor. Is it possible? If so, how do you do it? This is as far as i got, am i going the right direction? var videoNode: SKVideoNode? func check() { videoNode = childNode(withName: "video")…
Ojay
  • 61
  • 12
0
votes
1 answer

Initializing SKVideoNode using AVPlayer object - SWIFT

I'm playing around with ARKit and have created an app which overlays video content onto recognized images. Code is as follows: import UIKit import SceneKit import ARKit import SpriteKit class ViewController: UIViewController, ARSCNViewDelegate { …
DevB1
  • 1,235
  • 3
  • 17
  • 43
0
votes
0 answers

Cannot play video using SKVideoNode but sound is audible

While I am testing this app Xcode Simulator, I am unable to see video in SKVideoNode but the sound is audible. The same issue for both .mp4 and .mov files func showVideo() { let strVideoFile = "Beach.mov" let spriteVideo :…
0
votes
0 answers

Swift AVPlayer - Prevent 2 videos/audio from playing at once

I am using AVPlayer to play videos in a SCNNode. I want to prevent more than one video/audio from playing at a time. So if a video is playing and then another video starts, it will pause the previous video. Only allowing one video to ever be played…
0
votes
1 answer

Removing SKVideoNode does not stop the audio from the video node

I've added an SKVideoNode to my GameScene. When I try to remove the video, the video image disappears, but the audio continues to play. I've tried to stop and pause the video before removing, but the audio continues to play regardless. var…
Drew
  • 19
  • 4
0
votes
0 answers

IOS How to take a custom resizable SKVideoNode to reference a custom resizable ARImageAnchor SCNPlane's position and size

Currently, when I build to my phone I see the SCNPlane pop over an image the camera is detecting. The SCNPlane does not have an issue adjusting to the size of the image it detects. What I am having trouble with is taking the SCNPlane and replacing…
0
votes
1 answer

SpriteKit SKVideoNode does not appear on screen but sound is audible

I'm trying to get a video to appear on screen with SpriteKit, but can't see it. The FPS counter in the bottom of the screen is updated with around 60 FPS, which makes sense. The video's audio is also audible. Removing the line of code that changes…
Jordan Osterberg
  • 289
  • 3
  • 18
0
votes
1 answer

Memory leak from looping SKVideoNode (only on actual device)

I have a memory leak that I cannot diagnose. I have tried multiple approaches to creating a seamlessly looped video - Besides AVPlayerLooper, all of the approaches I've encountered and tried involve creating an observer to watch…
0
votes
1 answer

Swift SpriteKit SKVideoNode only plays once

Hi I'm trying to play video on an SKVideoNode in swift this is my code that works but it only plays once if i click on VideoSprite it doesn't play but dose print "we Clicked the video" I've searched but can't seem to find an answer thanks for…
user2164327
  • 283
  • 1
  • 2
  • 13