The New Relic Video Agent for iOS & tvOS contains multiple modules necessary to instrument video players and send data to New Relic.
There are three modules available:
Contains all the base classes necessary to create trackers and send data to New Relic. It depends on the New Relic Agent.
The video tracker for AVPlayer player. It depends on NewRelicVideoCore.
The video tracker for Google IMA Ads library. It depends on NewRelicVideoCore.
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'
First install the New Relic iOS Agent.
- Clone this repo.
- Open each one of the .xcodeproj files with Xcode.
- Select the appropiate scheme.
- Build (cmd+B).
- Include the generated .framework in your project.
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())
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.
The Examples
folder contains all the usage examples.
The Test
folder contains the test apps.
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.
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 opensource@newrelic.com.
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 HackerOne.
New Relic Video Agent is licensed under the Apache 2.0 License.