3 Star 0 Fork 0

Gitee 极速下载 / GUIPlayerView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/guilhermearaujo/GUIPlayerView
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

GUIPlayerView

GUIPlayerView implements a simple video player using AVPlayer.

Portrait screenshot Landscape screenshot

Features

  • Stream online and local files
  • Progress bar also shows the buffer load progress
  • Customizable progress bar tint colors
  • Automatically detect whether the stream is a fixed-length or undefined (as in a live stream) and adjusts the UI accordingly
  • AirPlay integration

Installation

CocoaPods (recommended)
Add the following line to your Podfile:
pod 'GUIPlayerView', '~> 0.0.4'
And then add #import <GUIPlayerView.h> to your view controller.

Manual
Copy the folders Classes and Resources to your project, then add #import "GUIPlayerView.h" to your view controller.

Usage

To use it, you must create a GUIPlayerView object and add it as a subview to your desired view. Then set the property videoURL and call prepareAndPlayAutomatically:.

If you decide not to play automatically, you can leave for the user to press Play, or you can do it programmatically by calling play.

Once you're done playing the video, you may want to remove it from your view. To do so, just call the method clean and everything will be released, and the player view will be removed from its superview.

Playback Control

There are a few methods to control the video playback:

- (void)play;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;

UI Customization

You can change the tint color of the progress indicator.
When the tint color is set, the buffer tint color will automatically be set to a desaturated version of the same color. If you desire a different color for it, remember to set the buffer tint color after setting the main tint color.

- (void)setTintColor:(UIColor *)tintColor;
- (void)setBufferTintColor:(UIColor *)tintColor;
- (void)setLiveStreamText:(NSString *)text;
- (void)setAirPlayText:(NSString *)text;

Delegate Methods

There are several optional delegate methods you can use:

- (void)playerDidPause;
- (void)playerDidResume;
- (void)playerDidEndPlaying;
- (void)playerWillEnterFullscreen;
- (void)playerDidEnterFullscreen;
- (void)playerWillLeaveFullscreen;
- (void)playerDidLeaveFullscreen;
- (void)playerFailedToPlayToEnd;
- (void)playerStalled;

Issues

As of this release, there are some issues that need to be worked on:

  • It only behaves nicely on fixed-orientation apps
    It currently does not handle the orientation change events.

  • Playlist or multiple streams not supported
    Only one video can be played and there are no interface buttons to skip/go back. You can still use the playerDidEndPlaying delegate method, reset videoURL and call prepareAndPlayAutomaticallyagain to play another stream.

The MIT License (MIT) Copyright (c) 2014 Guilherme Araújo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

GUIPlayerView 使用 AVPlayer 实现了一个简单的视频播放器,提供 AirPlay 集成 展开 收起
Objective-C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/mirrors/GUIPlayerView.git
git@gitee.com:mirrors/GUIPlayerView.git
mirrors
GUIPlayerView
GUIPlayerView
master

搜索帮助

14c37bed 8189591 565d56ea 8189591