skvideonode

Issue with SKVideoNode in SpriteKit, Simulator just shows Grey Screen

99封情书 提交于 2021-02-07 20:44:29
问题 Trying to run a 'Cut Scense Video' before entering into my game build. The game works great. I have created a separate scene, which I named "StartScene" to play my cut scene. The build succeeds, but when it gets to the cut scene part on the simulator I get a blank grey screen. I have searched online and get a lot of resizing issues with the video, however Apple Developer says this: When a video node is created, its size property is initialized to the base size of the video content, but you

Issue with SKVideoNode in SpriteKit, Simulator just shows Grey Screen

℡╲_俬逩灬. 提交于 2021-02-07 20:43:18
问题 Trying to run a 'Cut Scense Video' before entering into my game build. The game works great. I have created a separate scene, which I named "StartScene" to play my cut scene. The build succeeds, but when it gets to the cut scene part on the simulator I get a blank grey screen. I have searched online and get a lot of resizing issues with the video, however Apple Developer says this: When a video node is created, its size property is initialized to the base size of the video content, but you

Issues with vertical video orientation in SKVideoNode using Swift

柔情痞子 提交于 2019-12-23 23:24:50
问题 The following code shows my video file in correct zPosition with the other elements I'm working with, creating a background video. The problem I'm having is that the vertical video (1080x1920 pixels) gets rotated 90 degrees counterclockwise, and is stretched to fit as a landscape video. How can I ensure correct orientation without sacrificing my need to use the SKVideoNode with zPosition? let videoNode: SKVideoNode? = { guard let urlString = Bundle.main.path(forResource: "merry", ofType: "mov

SKVideoNode only on a small part of SCNSphere

给你一囗甜甜゛ 提交于 2019-12-23 07:23:09
问题 I'm using SKVideoNode as a material for my sphere for 360 video, but it only renders the video on the xy positive part of the sphere, I'm streaming the video from a URL it's a .m3u8 for reference see - SKVideoNode as texture for SCNSphere Multiple people seem to be having the same issue as me func makeSphere() { let sceneView = SCNView(frame: self.view.frame); self.view.addSubview(sceneView); var screenSize: CGRect = UIScreen.mainScreen().bounds; var screenWidth = screenSize.width; var

AVPlayer play SKVideoNode video ,I just can not control the playback

房东的猫 提交于 2019-12-23 01:29:13
问题 I am using the SpriteKit to play video,this is my code to create the SKVideoNode from AVPlayer: func CreateVideoViewWithAVPlayer(player:AVPlayer) { video = SKVideoNode(AVPlayer: player) let frameLayer=AVPlayerLayer(player: player) //video?. = CGRectMake(0, 0, 100, 100) video?.size = CGSize(width: 1024, height: 768) println(player.currentItem) video?.anchorPoint = CGPoint(x: 0, y: 0) video?.position = CGPoint(x: 0, y: 0) backgroundColor = SKColor.blackColor() self.addChild(video!) } And I

Failed to create IOSurface image (texture) with GVRSDK

雨燕双飞 提交于 2019-12-12 18:24:06
问题 I create a SKScene with SKVideoNode, then apply to a sphere geometry. Here is the key code: // Create a SKScene to play video NSString* filePath = [[NSBundle mainBundle] pathForResource:@"2222" ofType:@"mp4"]; NSURL* sourceMovieURL = [NSURL fileURLWithPath:filePath]; AVPlayer* player = [AVPlayer playerWithURL:sourceMovieURL]; SKVideoNode* videoNode = [SKVideoNode videoNodeWithAVPlayer:player]; //CGSize size = CGSizeMake(512, 512); CGSize size = [UIScreen mainScreen].bounds.size; videoNode

Determine size/aspect ratio of video for SKVideoNode in SceneKit

陌路散爱 提交于 2019-12-11 00:27:55
问题 How can I get the video size of a video from AVPlayer to set the geometry size of my node? For example, I have an SCNPlane with a width and height let planeGeo = SCNPlane(width: 5, height: 5) So now I instantiate my video player let videoURL = NSURL(string: someURL) let player = AVPlayer(URL: videoURL!) and my SKVideoNode let spriteKitScene = SKScene(size: CGSize(width: 1920, height: 1080)) spriteKitScene.scaleMode = .AspectFit videoSpriteKitNode = SKVideoNode(AVPlayer: player)

Playing back video in an SKVideoNode causes a black flash before playback begins

一笑奈何 提交于 2019-12-07 05:48:00
问题 I'm using Sprite Kit and an SKVideoNode to play back a short video. When the video node is added to the scene, be that before of after the initial set up, the player flashes black for a brief second. I have tried using an AVPlayer for the video instead of the video directly, also I've used KVO to only load the SKVideoNode when the video says it's ready to play. Either way I get a black flash before my video starts to play. Also there doesn't seem to be a way to add an AVPlayerLayer to the

ARKit / SpriteKit - set pixelBufferAttributes to SKVideoNode or make transparent pixels in video (chroma-key effect) another way

你离开我真会死。 提交于 2019-12-06 23:01:25
问题 My goal is to present 2D animated characters in the real environment using ARKit . The animated characters are part of a video at presented in the following snapshot from the video: Displaying the video itself was achieved with no problem at all using the code: func view(_ view: ARSKView, nodeFor anchor: ARAnchor) -> SKNode? { guard let urlString = Bundle.main.path(forResource: "resourceName", ofType: "mp4") else { return nil } let url = URL(fileURLWithPath: urlString) let asset = AVAsset(url

Memory leak from looping SKVideoNode (only on actual device)

梦想与她 提交于 2019-12-06 15:01:07
问题 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 AVPlayerItemDidPlayToEndTimeNotification and then either seeking to the beginning of the video (in the case of AVPlayer) or inserting the video to be looped into the video queue (in the case of AVQueuePlayer). Both seem to have similar performance, but both also have