Skip to content

NullIsOne/ios-kinescope-player

 
 

Repository files navigation

Kinescope iOS SDK

Pub Version

This framework created to help you include Kinescope player into your mobile iOS application.

About

This framework can help you include customizable video player into your mobile application, organize offline playing of your videos.

Currently supported features

  • online and offline playing
  • fullscreen, minimal or picture in picture
  • customizable UI of player

Usage

First of all, init SDK with apiKey somewhere at startup of your app

Kinescope.shared.setConfig(.init(apiKey: "your api key"))

From now you can use most of API through SDK

For example, to get list of videos just call

Kinescope.shared.inspector.list(request: .init(page: 1),
                                onSuccess: { result in

                                  let videos = result.0
                                  // save video models somewhere

                                  let metaData = result.1
                                  // check metadata
                                })

Than init player instance

let player = KinescopePlayer(videoId: "some video id")

Add player view somewhere in your layout

let playerView = KinescopePlayerView()
view.addSubview(playerView)

Connect player and playerView together

player.attach(view: playerView)

Enjoy.

All controls already included into KinescopePlayerView and can be hidden optionally. You can read full documentation or find more examples in our Example-project.

Logger

For logging network request, player events or something else use KinescopeDefaultLogger.

First step is set KinescopeLoggerLevel into configuration at application startup:

Kinescope.shared.set(logger: KinescopeDefaultLogger(), levels: [KinescopeLoggerLevel.network, KinescopeLoggerLevel.player])

Use logger like this:

Kinescope.shared.logger.log(message: "Bad Request", level: KinescopeLoggerLevel.network)

or

Kinescope.shared.logger.log(error: NSError(), level: KinescopeLoggerLevel.network)

Also SDK has opportunity to use custom logger. Just use protocols KinescopeLoggingLevel, KinescopeLogging.

Installation

Just add KinescopeSDK to your Podfile like this

pod 'KinescopeSDK' ~> 0.1

Changelog

All notable changes to this project will be documented in this file.

Issues

For issues, file directly in the main repo.

Contribute

If you would like to contribute to the package (e.g. by improving the documentation, solving a bug or adding a cool new feature), please review our contribution guide first and send us your pull request.

You PRs are always welcome.

How to reach us

License

MIT License

About

Kinescope iOS SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 98.5%
  • Other 1.5%