Is there a way to play (rewind/fwd) a paused movie with left right gesture in objective c - objective-c

I have a video clip that will work like a intro video when application starts. Video contains many objects that comes from all directions and incorporates with each other.
I have two ways to do this:
I start video in paused mode. Video goes forward or backward with finger left-right movement, exactly similar to the play strip of a MPMoviePlayerController. (video will remain paused and will not play)
I make every object separate and inside a UIScrollView I move them as per the video describes with the help of - (void)scrollViewDidScroll:(UIScrollView *)scrollView method.
2nd way is too complicated because the video is too lengthy and has near 45 objects. So how to go for 1st option?

You should export your movie as a serie of image. Then use [UIImageView animationImages:listOfImages] and bind a UIGestureRecognizer on your imageView and display an image instead of another depending on the direction of the slide.

Related

SceneKit Move Camera

There is a big scene,eg:a house ,I want to use TapGes to move camera to see different rooms. Now I have two questions:
1.I can not get the 3D point from this tapPoint in the scene
Is there any other way?
Here are some examples that may help.
57018359 - this post one tells you how to touch a 2d screen (tap) and translate it to 3d coordinates with you deciding the depth (z), like if you wanted to tap the screen and place an object in 3d space.
57003908 - this post tells you how to select an object with a hitTest (tap). For example, if you showed the front of a house with a door and tap it, then the function would return your door node provided you name the node "door" and took some kind of action when it's touched. Then you could reposition your camera based on that position. You'll want to go iterate through all results because there might be overlapping or plus Z nodes
55129224 - this post gives you quick example of creating a camera class. You can use this to reposition your camera or move it forward and back, etc.

SKAudioNode volume adjustment delayed

I am developing a game where an SKAudioNode plays the game music. When the player starts a new game, I want the music to fade in so I wrote the following code:
SKAudioNode *SFXNode = [[SKAudioNode alloc] initWithfile:#"GameMusic.mp3"];
[SFXNode runAction:[SKAction changeVolumeTo:0 duration:0]];
SFXNode.positional = NO;
[self addChild:SFXNode];
[SFXNode runAction:[SKAction changeVolumeTo:1 duration:1]];
However, when the scene initiates, the music plays at full volume for a split second, then it mutes and fades back in as it is supposed to. Does anyone have any idea why this is happening? (The music is only full volume after the user has triggered the modal segue to the scene, but before it has been displayed on the screen. As soon as the scene is displayed the music fades in normally). Also, the music does seem to be positional: as the player moves about in the scene the volume changes which I do not want happening. Solutions top either of these problems are much appreciated. Thank you!
This is because your volume change is happening after the audio is sent to the audio buffer. You need to do reset the volume before update happens. Now you can't do this as soon as you create the audio, you need to do it after it is added to the AudioEngine, so I would recommend doing this when your scene moves to the view (in the didMoveToView function).
The code to actually change the volume should be something like
((AVAudioMixerNode *)SFXNode.avAudioNode).volume = 0 but I would recommend checking if avAudioNode exists first and that it does conform to the AVAudioMixerNode protocol

Unity2d; How to raise(lift) camera during game mode at a fixed y axis minimum

I may be making this harder than what it really is, but I am also pretty new to developing games. Currently I am making a practice scene to get back used to the unity engine as I have not had time to use it since last summer. My issue is that I can not figure out how to lift the camera in game mode. Notice my photo below, and how much of the "underground" is showing. I want to raise the camera to keep it at the very least a specific y axis value, so that I can make less of the ground visible, and more of the background visible. If I am over complicating this, please also let me know. Thank you
If main camera is still then just lift the camera in scene view you can see changes in game view.
Or if camera moves with respect to player then you have to use a script and attach it to camera and get a reference of player transform in the script and according to the player position change position of the camera. Add an offset value in y component of the camera.

How to hear sound from mpmovieplayer at a specific time using UISlider?

I'm working on an iOS movie editor project. For this editor, i use MPMoviePlayer to show the video file selected by the user.
I use custom controls, and I have a UISlider that enables the user to move the player's currentTime position. When the user touches the slider, movie is paused and its currentTime changes along with the UISlider's value.
Everything works perfectly, but now i need to let the user hear the sound at this currentTime position.
For those who know iMovie, when you move your mouse over a movie event, you see the image and hear the sound at this position, and that's what i'd like in my editor.
I've tried to call player's play method with à NSTimer to stop after 0.2 seconds, but the result is kind of messy.
Has anyone already achieved to do something like this ?
Thanks !
Best regards.
Seeking takes time; that's why you've ended up using a timer. The real problem here is that MPMoviePlayerController, while convenient because it gives you controls, is a blunt instrument; it's just a massive simplified convenience built on top of AVFoundation. But you don't need the built-in controls, so I would suggest throwing away your entire implementation and getting down to the real stuff, using AVFoundation instead (AVPlayer etc). Now you have a coherent way to seek and get a notification when the seek has completed (seekToTime:completionHandler:), so you'll be able to start playing as soon as possible. Plus, AVFoundation is the level where you'll be doing all your "editing" anyway.

How to acheive animation effects like(word puzzle game) in iphone application?

i need to achieve an animation effect like (the Effects in "Pic Something","Pic Reveal" and so on) in my app.
What i am saying is i need to implement this tasks
Task1: when the user touches one Letter, then it change its frame(current position) to another frame(target position).
Task2:when the user touch the Letter(in Target position), it comes back to its original position again.
this can be clearly understood if u see the sample Apps.
I didn't find out any samples on internet also.
Thanks in Advance..
Take a look at UIView animation and animation blocks in iOS, that's what you need. With them you can create any animation you like. Here's a nice tutorial.
And about the whole system you described - I would create an NSDictionary of UIView positions and attach those to the corresponding tags of UIViews- this way you will always know from which place every UIView came from.