Giter Club home page Giter Club logo

ios-vast-client's Introduction

IOS Vast Client

IOS Vast Client is a Swift Framework which implements the VAST 4.0 spec.

This project is ongoing and in very early stages of development. As this project is being developed we will only target a subset of the VAST spec to meet our immediate needs. We do not recommend to use this library at this time.

Features

  • VAST 4.0 Spec Complient, backwards compatible with Vast 3.0
  • Vast XML Parser and Validator
  • VAST Impression and Ad Tracking
  • VAST Error Tracking

API docs

iOS Vast Client contains 2 interfaces for public use.

VastClient

Fetch and parse VAST file from URL. You can customize behaviour with VastClientOptions during initialization of VastClient. If you would like to cache the VMAPModel to prevent duplicate calls, change the value of shouldCacheVMAPModel to true.

VastClient result is VastModel structure or Error in case the fetch failed. You should pass this model to VastTracker.

VastTracker

Handles tracking of ad quartiles. Performs tracking for ads/ad breaks. Notifies quartile state updates via delegate calls.

Initialization

Init VastTracker with VastModel structure but always make sure to use the actual VastAd and other information provided via delegate function calls - do not keep the VastModel as not all information from the VastModel might be valid for playback etc.

Progress and Ad Tracking

func updateProgress(time: Double) throws After you initialize VastTracker you should call this function with time = playhead parameter to start tracking process. Playhead should match the playhead value used in intialization of VastTracker. (If you simply want to play pre-roll ads before your content, initialize VastTracker with playhead = 0 and call updateProgress(time:) with time = 0)

You have to call this function periodically during ad playback.

Your client must track when ads/ad breaks start and end. You can pass this information to Vast Tracker via the following

  • func trackAdBreakStart(for adBreak: VMAPAdBreak)
  • func trackAdBreakEnd(for adBreak: VMAPAdBreak)
  • func trackAdStart(withId id: String) throws
  • func trackAdComplete() throws

VastTracker will track quartile updates while func updateProgress(time: Double) throws is being called.

These delegate functions will be called during normal ad playback and you do not have to react to them - they are only informative

func adFirstQuartile(vastTracker: VastTracker, ad: VastAd)
func adMidpoint(vastTracker: VastTracker, ad: VastAd)
func adThirdQuartile(vastTracker: VastTracker, ad: VastAd)

Other Tracking

During ad break, other actions might be invoked by the user or the system. VastTracker support tracking of these actions:

public func paused(_ val: Bool)
public func fullscreen(_ val: Bool)
public func rewind()
public func muted(_ val: Bool)
public func acceptedLinearInvitation()
public func closed()
public func clicked() -> URL?
public func clickedWithCustomAction() -> [URL]
public func error(withReason code: VastErrorCodes?)

Supported tags

status:

  • not parsed
  • parsed - but not used currently, can be used by host app
  • partial - partially supported - might be missing edge cases
  • full - fully supported VAST tag
tag status note
VAST full -
Ad partial single and AdPods supported, AdBuffet treated like single ad
InLine full -
AdSystem parsed
AdTitle full
Impression parsed
Category parsed
Description parsed
Advertiser parsed
Pricing parsed
Survey parsed
Error full host app needs to initiate the error tracking
ViewableImpression full host app needs to call tracking function with appropriate type at appropriate time
Creatives full
Creative full
UniversalAdId parsed
CreativeExtensions parsed
CreativeExtension parsed
Linear full
Duration full
AdParameters parsed but only as a string - this might be XML content that will need validation if it is necessary for use
MediaFiles full
MediaFile parsed up to host app to handle playback
Mezzanine not parsed
InteractiveCreativeFile parsed
VideoClicks full host app has to initiate tracking events for clicks
ClickThrough full
ClickTracking full
CustomClick partial host app can track custom clicks via tracker, but the functionality is not specified
Icons partial iFrame and HTML resources not parsed
Icon full host app has to handle icon placement, visibility and icon clicks
IconViewTracking parsed View action tracking not implemented
IconClicks full
IconClickThrough full
IconClickTracking full
NonLinearAds not parsed no sub-elements supported
CompanionAds not parsed no sub-elements supported
Wrapper full
VASTAdTagURI parsed
CompanionAds parsed
Companion parsed all subelements parsed but CompanionClickTracking does not support id attribute

Getting Started

Check out the VastClientWrapper project for example implementation

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see LICENSE file for details

ios-vast-client's People

Contributors

austinchristensen avatar benashby avatar jan-bednar avatar jgainfort avatar johankool avatar kteman avatar realeyes-craig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-vast-client's Issues

Missing LICENSE file

Hello,

I've noticed that the MIT License is mentioned in the README file for this repository. However, the LICENSE file itself seems to be missing, as the link returns a 404 error.

To help avoid any confusion or ambiguity, could you please add the LICENSE file with the standard MIT License text to the repository? This would make it clear to all users what permissions they have regarding the use, modification, and sharing of this code.

Thank you for your time and consideration.

Create `VMAPTracker` class and remove AdBreak tracking from `VastTracker`

Currently VastTracker also does tracking for Vast ad breaks.
We should create a separate class called VMAPTracker that only tracks Vast ad breaks.

Acceptance Criteria:

  • Create VMAPTracker
  • Remove ad break tracking from VastTracker and move to VMAPTracker
  • Create tests for VMAPTracker
  • Update documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.