api.video is the video infrastructure for product builders

Overview

api.video-ios-player-analytics

badge   badge   badge

api.video iOS player analytics module

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Table of contents

Project description

iOS library to manually call the api.video analytics collector.

This is useful if you are using a video player for which we do not yet provide a ready-to-use monitoring module.

Getting started

Installation

Swift Package Manager

In the Project Navigator select your own project. Then select the project in the Project section and click on the Package Dependencies tab. Click on the "+" button at the bottom. Paste the below url on the search bar on the top right. Finaly click on "Add package" button.

 https://github.com/apivideo/api.video-ios-player-analytics.swift

Or add this in your Package.swift

  dependencies: [
        .package(url: "https://github.com/apivideo/api.video-ios-player-analytics.git", from: "1.0.0"),
    ],

Cocoapods

Add pod 'ApiVideoPlayerAnalytics', '1.0.0' in your Podfile

Run pod install

Sample application

A demo application demonstrates how to use player analytics library. See /Example folder.

Documentation

Options

The analytics module constructor takes a Options parameter that contains the following options:

Option name Mandatory Type Description
mediaUrl yes String url of the media (eg. https://cdn.api.video/vod/vi5oDagRVJBSKHxSiPux5rYD/hls/manifest.m3u8)
videoInfo yes VideoInfo information containing analytics collector url, video type (vod or live) and video id
metadata no [[String:String]] object containing metadata
onSessionIdReceived no ((String) -> ())? callback called once the session id has been received
onPing no ((PlaybackPingMessage) -> ())? callback called before sending the ping message

Options instantiation is made with either mediaUrl or videoInfo.

Once the module is instantiated, the following methods have to be called to monitor the playback events.

PlayerAnalytics API

play(completion: @escaping (Result ) -> Void)

method to call when the video starts playing for the first time (in the case of a resume after paused, use resume())

resume(completion: @escaping (Result ) -> Void)

method to call when the video playback is resumed after a pause

ready(completion: @escaping (Result ) -> Void)

method to call once the player is ready to play the media

end(completion: @escaping (Result ) -> Void)

method to call when the video is ended

seek(from:Float, to: Float, completion : @escaping (Result ) -> Void)

method to call when a seek event occurs, the from and to parameters are mandatory and should contains the seek start & end times in seconds

pause(completion: @escaping (Result ) -> Void)

method to call when the video is paused

destroy(completion: @escaping (Result ) -> Void)

method to call when the video player is disposed (eg. when the use closes the navigation tab)

currentTime

field to call each time the playback time changes (it should be called often, the accuracy of the collected data depends on it)

You might also like...
๐Ÿ“น Framework to Play a Video in the Background of any UIView
๐Ÿ“น Framework to Play a Video in the Background of any UIView

SwiftVideoBackground is an easy to use Swift framework that provides the ability to play a video on any UIView. This provides a beautiful UI for login

Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.
Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

 VGPlayer - ๐Ÿ“บ  A simple iOS video player by Vein.
VGPlayer - ๐Ÿ“บ A simple iOS video player by Vein.

Swift developed based on AVPlayer iOS player,support horizontal gestures Fast forward, pause, vertical gestures Support brightness and volume adjustment, support full screen, adaptive screen rotation direction.

Repository with base samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Includes steps for encoding and packaging your own test content.

Video Everything Repository with minimal samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Content and License All t

Open Source iOS 360 Degree Panorama Video Player.
Open Source iOS 360 Degree Panorama Video Player.

๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ The Metal with Swift 5.0 version is comming ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ ๐ŸŽบ 360 VR Player A Open Source, Ad-free, Na

๐Ÿ“ฑiOS app to extract full-resolution video frames as images.
๐Ÿ“ฑiOS app to extract full-resolution video frames as images.

Frame Grabber is a focused, easy-to-use iOS app to extract full-resolution video frames as images. Perfect to capture and share your favorite video mo

๐Ÿ“ฝ A video player for SwiftUI, support for caching, preload and custom control view.
๐Ÿ“ฝ A video player for SwiftUI, support for caching, preload and custom control view.

Features QuickStart Advances Installation Requirements License Demo Clone or download the project. In the terminal, run swift package resolve. Open Vi

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

FWVideoPlayer is video Player for iOS in Swift.

FWVideoPlayer Desc FWVideoPlayer is video Player for iOS in Swift. It can play video and audio. You can use it easy. Example To run the example projec

Releases(v1.0.4)
Owner
api.video
Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
api.video
A fully functional short video app project.Record a six secends video while playing prank sounds.

prankPro A fully functional short video app project How to Install 1. use coconapod to init your xcode environment. 2. change the app-keys in `applica

huijimuhe 258 Jun 19, 2022
JDVideoKit - You can easily transfer your video into Three common video type.

JDVideoKit Introduction You can easily transfer your video into Three common video type. You can use set up camera easily. Installation pod 'JDVideoK

้ƒญไป‹้จต 24 Sep 9, 2021
Video mp4 record save display - How to Take , Save and Display a .mp4 Video

Technicalisto How to Take , Save and Display a .mp4 Video Add your design with v

Aya Baghdadi 2 Aug 7, 2022
YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI for easily create a Youtube app

YoutubeKit YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI to easily create Youtube applications. Important Ref

Ryo Ishikawa 555 Dec 28, 2022
WatchTube: a standalone WatchOS youtube player utilizing Download API for search data and video streaming

WatchTube is a standalone WatchOS youtube player utilizing Download API for sear

WatchTubeTeam 11 May 30, 2022
BMPlayer - A video player for iOS, based on AVPlayer, support the horizontal, vertical screen

A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.

Eliyar Eziz 1.8k Jan 4, 2023
A video composition framework build on top of AVFoundation. It's simple to use and easy to extend.

A high-level video composition framework build on top of AVFoundation. It's simple to use and easy to extend. Use it and make life easier if you are implementing video composition feature.

VideoFlint 1.4k Dec 25, 2022
Overlay alpha channel video animation player view using Metal.

Overlay alpha channel video animation player view using Metal. Example To run the example project, clone the repo, and run pod install from the Exampl

noppefoxwolf 244 Jan 1, 2023
โ–ถ๏ธ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Jan 2, 2023
A set of tools to trim, crop and select frames inside a video

PryntTrimmerView A set of tools written in swift to crop and trim videos. Example To run the example project, clone the repo, and run pod install from

Henry Huck 742 Jan 5, 2023