Multimedia technology-Improve your app's grid! A

Source: Internet
Author: User

    1. Video playback
    2. Video capture
    3. Video recording
    4. Video compression
1. Video playback 1.1 related two frames: iOS8.0 MediaPlayer iOS9.0 avfoundation 1.2 Play mode IOS 8.0
    • Mpmovieplayerviewcontroller with views
    • Ignoring the mpmovieplayercontroller of the graph
IOS 9.0
    • Avplayerviewcontroller
1.3 Mpmovieplayerviewcontroller
Mpmovieplayerviewcontroller steps to implement playback
  1. Get Resource Path
  2. Initializing the player
  3. To play present
1.4 MPMoviePlayerController
MPMoviePlayerController steps to implement playback
  1. Get Resource Path
  2. Initializing the player
  3. Add the player view to the view of the current controller and set the frame
  4. Ready to play, start playing
  5. Next song
Note: The player needs a strong reference
MPMoviePlayerController the current controller must set a strong reference to the player to set the player's style ControlStyle
  • Mpmoviecontrolstylenone//The button without controller is None
  • mpmoviecontrolstyleembedded//embedded, and is the default
  • Mpmoviecontrolstylefullscreen//Full screen style
  • Mpmoviecontrolstyledefault = mpmoviecontrolstyleembedded//Default Style
1.5 Avplayerviewcontroller Two frames: Avfoundation and Avkit
Playback steps
  1. Get Resource Path
  2. Initializing the player
  3. Add the PLAYERVC view to the current controller's view and set frame or present out PLAYERVC
  4. Start playback
1.6 Play the next song
Play the next song
  1. Implementation method: Notification
  2. The received notification key Mpmovieplayerplaybackdidfinishreasonuserinfokey, the returned data is the reason for the end of Mpmoviefinishreason (nsnumber) playback,
    • mpmoviefinishreasonplaybackended Playback End
    • Mpmoviefinishreasonplaybackerror Playback Error
    • mpmoviefinishreasonuserexited User exit
  3. Determine if the video is a normal end play, and determine how the reason ends
  4. Set contentURL
  5. To play
Comparison of 1.7 MPMoviePlayerController and Mpmovieplayerviewcontroller
Common
  • Can play the video
  • Play the next song with notification implementation
Similarities and differences.
  1. Mpmovieplayerviewcontroller with the view of the playback controller, and is full-screen display, MPMoviePlayerController ignoring the diagram, you need to add to the current controller view and set the frame
  2. MPMoviePlayerController usage Scenario: Circle of Friends
  3. The controller must have a strong reference to the MPMoviePlayerController when it is used
    1. Cause: MPMoviePlayerController disappears after Alloc init after the Viewdidload method, so the controller must have a strong reference to it
  4. MPMoviePlayerController can be set ControlStyle
  5. Playback in different ways:
    1. Mpmovieplayerviewcontroller needs present.
    2. MPMoviePlayerController Call Play Play
2. Video interception related frame: Avfoundationavassetimage
  1. Get Resource Path
  2. Packaging Avasset
  3. Create a avassetimagegenerator for the collector
  4. Intercept
Struct is the difference between uiimage and cgimageref that cannot be placed in an array?
3. Video recording update in 4. Video Compression update

Multimedia technology-Improve your app's grid! A

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.