The company needs the following: Click a button to play a video, up to 4 simultaneous playback, double-click a video to make it full-screen, click and then restore the original look. There are two types of iOS players, Mpmovieplayercontroller,avaudioplayer. First of all I tried the former, found that can not let two video playback at the same time, when playing the second video, the first automatically stopped, and later found some information to try the latter, the perfect solution to the problem.
Multiple players play at the same time, the information from: http://ios.jobbole.com/84287/, the introduction of the very detailed, the article after the project can download the demo, here is not much to say.
Double-click Fullscreen to exit full screen: I'm using gestures.
Double-click Full screen
UITapGestureRecognizer *doubletapgesturerecognizer = [[UITapGestureRecognizer alloc]initwithtarget:self action:@ Selector (DOUBLETAP:)];
[Doubletapgesturerecognizer Setnumberoftapsrequired:2];
[Player.view Addgesturerecognizer:doubletapgesturerecognizer];
Single-Exit fullscreen
UITapGestureRecognizer *singletapgesturerecognizer = [[UITapGestureRecognizer alloc]initwithtarget:self action:@ Selector (SINGLETAP:)];
[Singletapgesturerecognizer setnumberoftapsrequired:1];
[Player.view Addgesturerecognizer:singletapgesturerecognizer];
A double-click is not detected and the call is clicked
[Singletapgesturerecognizer Requiregesturerecognizertofail:doubletapgesturerecognizer];
Save the player's frame with a global variable first, and assign the previously saved value to the player when exiting full screen.
IOS multiple players play simultaneously, double-click Fullscreen, single exit fullscreen