IOS video playback and ios video playback

Source: Internet
Author: User

IOS video playback and ios video playback

  • This is a simple video playing framework based on UIView. It can be a small window or a full screen window.
  • Loading the Video framework in a simple way: loading a line of code! Update a line of code!

  • Download link: https://github.com/huyp/YVideoPlayer
Function
  • Support for local and Network Videos
  • Start & pause
  • Maximize & restore
  • Upper and lower adjustments on the left side of the image: brightness
  • Up/down adjustment on the right side of the image: volume
  • Slide left and right: fast forward and fast return
Introduction
  • This is a subclass of UIView, which can be loaded to any location you need.
  • It can be a small window or a full screen window.
  • Supports Direction recognition and automatically maximizes the horizontal screen.

 

 

Use loading:
Import header file # import "YVideoPlayerView. h"
YVideoPlayerView = [YVideoPlayerView initWithVideoName: @ "video name 1" frame: CGRectMake (200,150,) path: @ "http: // videoPath" onViewControll: self]; initialization Method + (instancetype) initWithVideoName :( NSString *) name frame :( CGRect) frame path :( NSString *) path onViewControll :( UIViewController *) OnViewController; name: Video name frame: Video Location path: video path onViewController: load the ViewController where the video is located-> generally write self
Update:
YVideoPlayerView = [yVideoPlayerView updateVideoWithName: @ "video name 2" path: @ "http: // videoPath2" onViewController: self]; Note: This is an object method-(instancetype) updateVideoWithName :( NSString *) name path :( NSString *) path onViewController :( UIViewController *) OnViewController; name: Video name path: Video path onViewController: load the ViewController where the video is located-> generally write self here, you do not need to override the frame-refer to the initialization time
Reminder
  • This framework is a pure ARC, compatible system> = iOS6.0, iPhone \ iPad horizontal and vertical screen
  • The screen must be locked in the horizontal or vertical direction by the mobile phone.
  • The App must be enabled at least.LandScape LeftOrLandScape RightOne of these items. For example, other pages of the App cannot be switched to the screen. Use the code to lock it!
    • Write the following code in the root view that does not require screen conversion:
      - (UIInterfaceOrientationMask)supportedInterfaceOrientations {      return UIInterfaceOrientationMaskPortrait;  }
    • Write the following code in the ViewController that loads YVideoPlayerView:
      // Only rotate this page-(BOOL) shouldAutorotate {return YES;}-(UIInterfaceOrientationMask) supportedInterfaceOrientations {if (yVideoPlayerView. canOrientationChange = YES) {// The Portrait screen is displayed. return UIInterfaceOrientationMaskAllButUpsideDown;} return UIInterfaceOrientationMaskPortrait ;}

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.