When I embed a youtube video with a UIWebView, I get a 'Done' button when the video is brought up. The 'Done' button does not perform the way i want it to, how do I create my own 'Done' button?
You could overlay a view containing a button and anything else you want on top of the UIWebView and then connect things up as you see fit. You have to be careful about resizing on rotation and keep in mind that changes could be made to the you tube video presentation which are out of your control.
Solution to original problem: Use iframe embedding instead of flash embedding!
Related
I'm pretty new in ios programming. Please, help me to find native solution to get the same button in avplayer controller as it is in safari:
How to enable this button in right bottom corner and assign my action to it?
I couldn't find, how to change AVPLayerController controls. But I made custom player with my control panels, using container view and embedding AVPlayerController.
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.
I am trying to have a view that has four buttons on the top: a picture button, video button, audio button, and text button and an imageView below the buttons. If you click on the picture button, the imageView displays the picture. but if I click the video button i want the imageView to display a picture of the video that you can click and play the video. The audio button would do the same and the text button should display the text in the view.
I'm not sure what the best way to do this is because I don't know if you can add anything to a UIImageView or if I should put views on top of eachother in interface builder.
any advice is appreciated.
Hav you tried using a UITabBarViewController? I think this may be what you're looking for. A quick Google search came up with the following tutorial: http://www.iphonedevcentral.com/create-uitabbarcontroller/
You might have seen video through you tube in iPhone.
Normal MPMoviePlayerController has previous, next & play/pause buttons.
You tube - player has additional two buttons on it.
=> Add to favorites on the left side.
=> Email this video on right side.
I want to implement the same for my application.
But I am failed to find out the property or methods regarding - implementing this.
How do I need buttons on it?
When User is watching video there should no buttons on screen.
When user taps on video - a toolbar comes on top & at center
A center tool bar has generally three buttons on it ,Previous - next -play/pause
I want to add a button beside next button & previous button.
I don't think you can modify the interface of an Apple provided view.
The general approach would be to play your video and then after it's done, show a view with the desired buttons/and or options for the user.
An example of this can be seen with the YouTube app on the iPhone. After the youtube video plays, the user is sent to a summary view with links to watch the video again, favourite it, share it, etc.
I would say that it may be possible to just set the MPMoviePlayerController's movieControlMode property to MPMovieControlModeHidden and add a subview to it with your own collection of buttons, titles, etc... But MPMoviePlayerController inherits only from NSObject, so you couldn't do that. Perhaps you can subclass MPMoviePlayerController and setup your own stuff when play is called, yet again, I imagine MPMoviePlayerController would display itself as a modal fullscreen view and hide anything you setup. :-\
If all you're looking to do is mess with the look of the controls, I DO know that you can mess around with various objects' drawRect: methods to override how bars and buttons are drawn.
For example, setting up a category or subclass of UINavigationBar and implementing drawRect: as follows will result in a custom navigation bar being drawn:
- ( void )drawRect:( CGRect )rect
{
[ [ UIImage imageNamed:kSTNavigationBarBackgroundImageName ] drawInRect:CGRectMake( 0.0, 0.0, self.frame.size.width, self.frame.size.height ) ];
}
This replaces Apple's standard look for their navigation bars and replaces it with a custom image asset. We do this, among other things, for our apps.
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.