IOS multiple players play simultaneously, double-click Fullscreen, single exit fullscreen

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.