In the work need to display in the video playback interface to control the volume of the slider, so learn a bit about volume control (to use the real machine)
Avplayer: Provides a Volume control API, but only supports IOS7
Avaudioplayer: Provides a volume control API that is currently supported
Mpmusicplayercontroller: Provides a Volume control API, but supports IOS7 below
MPMoviePlayerController: Seemingly does not support volume control temporarily
To use the system to play the audio with the control of the little buddies.
Use Mpvolumeview to display on the interface and to control the volume of the device by sliding the slider. The position of the slider reflects the current system audio output volume The first time it is displayed. When the user drags the slider, the update volume changes. The volume size also changes. Using the method is very simple, create mpvolumeview add to play the video interface can be displayed. (Note that you want to use true machine debugging to see the effect). The Created Volume control object is added to the view and is displayed in the location of the corresponding parent view.
The slider can be customized to suit your needs.
Mpvolumeview *volumeview = [[Mpvolumeview alloc] init];
Volumeview.frame=cgrectmake (10,20, 200, 30);
[Volumeview Setshowsvolumeslider:yes];
[Volumeview Setshowsroutebutton:no];
[Volumeview SizeToFit];
Set Slider picture
[Volumeview setvolumethumbimage:[uiimage imagenamed:@ "Pingfen_select"] forstate:uicontrolstatenormal];
You can use this method to give a background color to a thin line
[Volumeview setmaximumvolumesliderimage:[uiimage imagenamed:@ "Pingfen_select"] forstate:uicontrolstatenormal];
[Self.viewaddSubview:volumeView];