Skip to content

mirego/video-agent-iOS

 
 

Repository files navigation

Community 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

Download the latest pre-built XCFrameworks from the Releases page. Look for XCFrameworks.zip, extract it, and drag the .xcframework files into your Xcode project under Frameworks, Libraries, and Embedded Content, set to "Embed & Sign".

For other installation methods including CocoaPods and manual builds, see INSTALLATION.md.

Getting Started

For comprehensive setup instructions, usage examples, and best practices, see the Developer Onboarding Guide.

The onboarding guide covers:

  • Complete installation and setup
  • AppDelegate configuration with automatic optimization
  • Video player integration (with and without ads)
  • Advanced configuration options
  • Performance tuning and battery optimization
  • Troubleshooting and best practices

Quick Usage Example

To start the video agent with AVPlayer tracker only:

Objective-C

// In AppDelegate - Initialize the video agent
NRVAVideoConfiguration *config = [[[NRVAVideoConfiguration builder]
    withApplicationToken:@"YOUR_NEW_RELIC_TOKEN"]
    withDebugLogging:YES]
    build];
[[[NRVAVideo newBuilder] withConfiguration:config] build];

// In your ViewController - Add player tracking
NRVAVideoPlayerConfiguration *playerConfig = [[NRVAVideoPlayerConfiguration alloc]
    initWithPlayerName:@"MainVideoPlayer"
    player:yourAVPlayer
    adEnabled:NO
    customAttributes:@{@"videoTitle": @"Sample Video"}];
NSInteger trackerId = [NRVAVideo addPlayer:playerConfig];

Swift

// In AppDelegate - Initialize the video agent
let config = NRVAVideoConfiguration.builder()
    .withApplicationToken("YOUR_NEW_RELIC_TOKEN")
    .withDebugLogging(true)
    .build()
NRVAVideo.newBuilder().with(configuration: config).build()

// In your ViewController - Add player tracking
let playerConfig = NRVAVideoPlayerConfiguration(
    playerName: "MainVideoPlayer",
    player: yourAVPlayer,
    adEnabled: false,
    customAttributes: ["videoTitle": "Sample Video"]
)
let trackerId = NRVAVideo.addPlayer(playerConfig)

For complete integration examples including ad support, see the ONBOARDING.md guide.

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 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 our bug bounty program.

Pricing

Important: Ingesting video telemetry data via this video agent requires a subscription to an Advanced Compute. Contact your New Relic account representative for more details on pricing and entitlement.

License

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

About

Video Agent for iOS and tvOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 81.3%
  • Swift 14.4%
  • Shell 2.1%
  • Ruby 1.6%
  • C 0.6%