GithubHelp home page GithubHelp logo

newrelic / video-agent-ios Goto Github PK

View Code? Open in Web Editor NEW
1.0 19.0 9.0 1.43 MB

Video Agent for iOS and tvOS

License: Apache License 2.0

Objective-C 57.75% Ruby 3.93% Swift 36.92% C 1.40%
nrlabs video newrelic-plugin ios nrlabs-odp

video-agent-ios's Introduction

Experimental Project header

New Relic Video Agent for iOS & tvOS

The New Relic Video Agent for iOS & tvOS contains multiple modules necessary to instrument video players and send data to New Relic.

Modules

There are three modules available:

NewRelicVideoCore

Contains all the base classes necessary to create trackers and send data to New Relic. It depends on the New Relic Agent.

NRAVPlayerTracker

The video tracker for AVPlayer player. It depends on NewRelicVideoCore.

NRIMATracker

The video tracker for Google IMA Ads library. It depends on NewRelicVideoCore.

Installation

Install automatically using Cocoapods

Add the following lines to your Podfile:

  pod 'NewRelicVideoCore', :git => 'https://github.com/newrelic/video-agent-iOS'
  pod 'NRAVPlayerTracker', :git => 'https://github.com/newrelic/video-agent-iOS'
  pod 'NRIMATracker', :git => 'https://github.com/newrelic/video-agent-iOS'

Install manually

First install the New Relic iOS Agent.

  1. Clone this repo.
  2. Open each one of the .xcodeproj files with Xcode.
  3. Select the appropiate scheme.
  4. Build (cmd+B).
  5. Include the generated .framework in your project.

Usage

To start the video agent with AVPlayer tracker only:

Objective-C

NSNumber *trackerId = [[NewRelicVideoAgent sharedInstance] startWithContentTracker:[[NRTrackerAVPlayer alloc] initWithAVPlayer:player]];

Swift

let trackerId = NewRelicVideoAgent.sharedInstance().start(withContentTracker: NRTrackerAVPlayer.init(avPlayer: player))

To start the video agent with AVPlayer and IMA trackers:

Objective-C

NSNumber *trackerId = [[NewRelicVideoAgent sharedInstance] startWithContentTracker:[[NRTrackerAVPlayer alloc] initWithAVPlayer:player] adTracker:[[NRTrackerIMA alloc] init]];

Swift

let trackerId = NewRelicVideoAgent.sharedInstance().start(withContentTracker: NRTrackerAVPlayer.init(avPlayer: player), adTracker: NRTrackerIMA.init())

Documentation

To generate source code documentation, you can use appledoc as follows:

appledoc --project-name NewRelicVideoAgent --project-company "New Relic Inc." --company-id com.newrelic --create-html --no-create-docset --output ./docs NewRelicVideoCore/NewRelicVideoCore/**/*.h

And then open docs/html/index.html with your prefered browser.

The source code annotations are compatible with Doxygen, so you would rather use it if you prefer.

For more detail on the Events and Data Model generated by Video Agent for Android and for advanced concepts such as creating custom trackers, reference the Advanced Topics manual.

Examples

The Examples folder contains all the usage examples.

Testing

The Test folder contains the test apps.

Support

New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.

We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.

Contributing

We encourage your contributions to improve New Relic Video Agent! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through our bug bounty program.

License

New Relic Video Agent is licensed under the Apache 2.0 License.

video-agent-ios's People

Contributors

alarochelle avatar asllop avatar boubalou avatar miransar avatar mlong-nr avatar oliviermartin08 avatar

Stargazers

 avatar

Watchers

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

video-agent-ios's Issues

Ad bufferType

When there is an ad break, the content experiences a buffering cycle, that is labeled as bufferType = connection. We should check if there is an Ad running and set the bufferType as "ad".

SPM package support needed

Please add SPM support - we have it already for newrelic-ios-agent-spm, so why not for video-agent-iOS also?

Thank you.

viewId is cleared upon every AD_BREAK_ events

Upon heavy usage of our video data by building different dashboards with multiple widgets, we noticed that some of our events had no viewIds during ads.

After a bit of research, we stumbled upon this line in the library: https://github.com/newrelic/video-agent-iOS/blob/master/NewRelicVideoCore/NewRelicVideoCore/Tracker/NRVideoTracker.m#L148

The viewId is actually cleared on any AD_BREAK_* event, which kind of skew our data when playing around for widget related to ads.

What is the reasoning behind this approach? We noticed Android also doing it, but not Web.

Please note, I will enter the same issue in both repositories (iOS and Android).

Issue with many video players at once

[NSKeyValueObservance retain]: message sent to deallocated instance 0x165aa2fb0

scroll through a list of videos and have them start playing as they are brought up in the view port. We suspect it might have something to do with the observers not getting deallocated as we keep scrolling through videos. Our best guess is that the iOS agent was built primarily for a page view with only one video instead of a list of videos.

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.