I have a video that needs to be activated when scanning a qr-code. When starting a video needs to be shown full-screen and without controls (volume and other buttons). Is there a code for this? Also is it possible to disable all functions of the iphone, so the user needs to view the full video? I would be so greatfull f somebody would answer me..
You can set the controlStyle property of an MPMoviePlayerController to MPMovieControlStyleNone. You'll have a fullscreen movie with no controls. Just remember to set the delegate so you can dismiss the video when it finishes playing.
Related
I have a tablewview and by click a table row a subview appear as player and play audio in my app . I added play in background mode and controls it while in background , it works .
The problem I have is , when I move to another view (exactly when the subview being disappear) I can't control or stop the audio.
how can I let the controls keep detect the audio playing while I'm in any other views of my app? also how can I let the subview appear when I back to my view again to allow stop or show the progress status?
I hope anybody can help
Please see the above link to find this solution and must read "Comment"... :)
Playing music in background ios app
another link may help you...iOS SDK : playing music on the background and switching views
You will have to keep a Strong reference to your view, or, at least, to your object currently playing a sound.
I'll suggest using a protocol between viewControllers to let the parent view controller catch the reference before dismissing the view containing the player.
You'll find much more explanation at Ray Wenderlich website's Audio playing tutorial.
In the new American Idol app there are embedded videos that, if you tap them, start playing and showing "pause" and "augment" buttons. When you tap the augment button, you get an animation that smoothly launches the full screen MPMoviePlayerController. Do you know how did they make it?
I have implemented something like this by adding a gesture tap on that and implement the logic of the gesture. On a tap I have added a view with buttons like share (in my case). I am sorry I don't have that code anymore.
In my new app,I have to show videos in MPMovieplayer.Client gave me the design as in screenshot
I want to know whether it is possible to customize like this(including the top like,skip buttons and the custom slider)
If it is possible,help me to learn more about that
You can do it pretty easily with AV Foundation specifically AVPlayer class, it is the framwork underneath MPMoviePlayer. It will give you the options to have an abstract video/audio player and you'll be able to create you own customize UI
Here's an example code to start with AVPlayer
AVPlayer will work, but I hear it can be more complicated than working with a more higer level solution like MPMoviePlayer. I've been working on making my own customized UI for a video stream using MPMoviePlayer.
Whenever you create your MPMoviePlayer object, just set control style to none with: MPMovieControlStyleNone this leaves your video player ready for you to make customize controls. I suggest using a UIToolbar and then setting UIBarButtonItems onto your toolbar. Once your toolbar has all your buttons, add the toolbar to the subview with the addSubview method. You can then add functionality to the buttons and slider with the MPMediaPlayback Protocol with methods like play and pause. By the way, the top like and skip buttons could just be UIButtons which are pretty customizable. Lastly, if you want the controls to disappear on a tap then look into Gesture Recognizers.
Of course you can style your buttons and position your toolbar as needed, but this should get you a basic start.
Here's a custom class I wrote that works in iOS6 and newer.
https://github.com/busterbooth/bbMoviePlayer
You can control and re-skin just about every aspect of the MPMoviePlayer as long as you do the following.
MPMoviePlayerController *mp= [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:#"http://example.com/video.file"]];
mp.controlStyle = MPMovieControlStyleNone;
How can we display the UiImagepicker controller interface with both camera and video mode, as it is in the default camera application on iPhone.
UIImagePickerController has a mediaTypes property, which is an array of types you want to support (image, video, or both):
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instp/UIImagePickerController/mediaTypes
The way it has it within the OS is that it changes the picker via a slider in the bottom toolbar.
When the value changes from photo to video via the slider, you could recreate the UIImagePickerController with the appropriate mediaType and reload the view.
I do not know if this would be as seemless as the iPhone included way of doing things without testing it, however, this would allow you to change the picker being used from one to the other.
I have implemented a listing of videos in a UITableView. When I touch on a particular video then the video plays in an MPMovieplayer. Now, I want to make it so that if I touch on a next button, then the next video in the UITableView will play. How can I implement this?
Search for "MPMoviePlayer overlay" on stack overflow
Put an overlay over the movie with a previous and next button on it.
Make the buttons target methods that control MPMoviePlayer.