Skip to content

Latest commit

 

History

History
131 lines (98 loc) · 5.05 KB

README.md

File metadata and controls

131 lines (98 loc) · 5.05 KB

InStatPlayer

Isometric

Twitter CI Status Version iOS 10.0+ Swift 5 License Platform

Use

InStatPlayer is a flexible media player, the playback queue consists of an nested array AVPlayerItem, which makes it easy to get IndexPath, it is very convenient to interact with UITableView.

Open example project to see how easy it is to manipulate the UITableView. To run the example project, clone the repo, and run pod install from the Example directory first.

InStatPlayerDelegate

You should conforms to protocol InStatPlayerDelegate to get more information from InStatPlayer

        @objc optional func player(_ player: InStatPlayerView,
				     ready item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
			             didPlay item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     didPause item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     didStop item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     didFail error: Error,
				     item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func playerDidFullscreen(_ player: InStatPlayerView)

	@objc optional func player(_ player: InStatPlayerView,
				     didChangeTo time: Float64,
				     for item: AVPlayerItem,
				     at indexPath: IndexPath,
				     total: Float64)

	@objc optional func player(_ player: InStatPlayerView,
				     willStartFromBeginning item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     didEnd item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     willLoop item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     bufferingUnknown item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     bufferingReady item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     bufferingDelayed item: AVPlayerItem,
				     at indexPath: IndexPath)

	@objc optional func player(_ player: InStatPlayerView,
				     bufferingTimeDidChangeTo time: Float64,
				     item: AVPlayerItem,
				     at indexPath: IndexPath,
				     total: Float64)

	@objc optional func player(_ player: InStatPlayerView,
				     seekTo time: Double,
				     for item: AVPlayerItem,
				     at indexPath: IndexPath)

Customization

Using the customizeControlView() method from InStatControlView you can customize the controls according to your desire. The project example provides an example of how this can be achieved.

Installation

InStatPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:

   pod 'InStatPlayer'

Author

Beslan Tularov | @JiromTomson

License

MIT License

Copyright (c) 2018 Beslan Tularov

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.