GithubHelp home page GithubHelp logo

newrelic / video-videojs-js Goto Github PK

View Code? Open in Web Editor NEW
2.0 10.0 5.0 270 KB

New relic tracker for VideoJS player

License: Apache License 2.0

JavaScript 99.39% Shell 0.56% Dockerfile 0.05%
agent newrelic nrlabs video-events video-tracking videojs nrlabs-odp

video-videojs-js's Introduction

Community Project header

New Relic VideoJS Tracker

The New Relic VideoJS tracker instruments the VideoJS player and Brightcove player. It also instruments Ads for FreeWheel and IMA. Makes use of newrelic-video-core, extending the VideoTracker class.

Build

Install dependencies:

$ npm install

And build:

$ npm run build:dev

Or if you need a production build:

$ npm run build

Usage

Add scripts inside the dist folder to your page.

If the dist folder is not included, run npm i && npm run build to build it.

Standard way

// var player = videojs('my-player')
nrvideo.Core.addTracker(new nrvideo.VideojsTracker(player))

VideoJS Plugin Ecosystem

You can use the built-in Videojs plugin system.

// var player = videojs('my-player')
player.newrelic()

Custom Attributes

You can add custom attributes in the following ways. You can override OOTB attributes or create your own.

Using the standard way

    const tracker = new nrvideo.VideojsTracker(player,{ customData: { 
      contentTitle: "Override Existing Title",
      customPlayerName: "myGreatPlayer", 
      customPlayerVersion: "9.4.2"
    } })
    
   nrvideo.Core.addTracker(tracker)
   tracker.customData.myGreeting = "hello from vjs"

Using the plugin System

    var player = videojs('my-video')
    const tracker = player.newrelic()
    tracker.customData.myGreeting = "hello from vjs"

Verify instrumentation

On the page you've instrumented...

   Is Browser Agent loaded? → Type newrelic in the console.

   Is Video Script Loaded? → Type nrvideo in the console.

   Turn on debug → add ?nrvideo-debug=true or &nrvideo-debug=true in the URL.

   Is Video Tracker correctly instantiated? → filter console by [nrvideo] and look for logs.

   Search for Tracker or nrvideo.

    Console Search

Examples

Check out the samples folder for complete usage examples.

Open source license

This project is distributed under the Apache 2 license.

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.

Community

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

https://discuss.newrelic.com/t/videojs-tracker/100305

Issues / enhancement requests

Issues and enhancement requests can be submitted in the Issues tab of this repository. Please search for and review the existing open issues before submitting a new issue.

Contributing

Contributions are encouraged! If you submit an enhancement request, we'll invite you to contribute the change yourself. Please review our Contributors Guide.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

video-videojs-js's People

Contributors

adwetzelnr avatar asllop avatar flaviohenriquecbc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-videojs-js's Issues

Error: Unknown option '-p'

Running npm run build throws the following error:

[webpack-cli] Error: Unknown option '-p'
[webpack-cli] Run 'webpack --help' to see available commands and options

Webpack no longer uses -p for production, and instead uses --mode production. See: webpack/webpack-cli#1934

Replace webpack -p for webpack --mode production.

Does Video tracking agent provides Video Quality Metrics or Events?

Hi,

I am using new relic to track videos and ads using New Relic VideoJS tracker instruments.

I have deployed the agent and the dashboard as listed in the following link.

https://newrelic.com/blog/how-to-relic/tracking-your-videos-and-ads-with-new-relic

Everything seems fine data is smoothly flowing to New Relic default dashboard. But, I am unable to find any information about Video Quality Metrics or Events.

It is mentioned in the following link that New Relic Video tracking agent provides Video Quality Metrics or Events including bitrate.

https://newrelic.com/blog/how-to-relic/media-monitoring

I have also explored data in new relic using NRQL and Data Explorer utiltity but I am unable to find any data related to Bitrate.

Could please guide me where i can find the follwoing metrics in new relic if they exist...

Video Quality Upscale
Percentage

Video Quality Downscale
Percentage

Average Bitrate

Live Stream
Latency

Or any other KPIs that new relic provides for Video Quality

Secondly, From where, I can get the List of the all the Metrics or Events that tracked by new relic video tracking agent?

Thank you,

Shehrooz

Not exported from 'newrelic-video-core' error

Importing newrelic-video-videojs like newrelic-video-core can be imported (and is imported in this repo) throws the following error in the Typescript project:

Attempted import error: 'VideojsTracker' is not exported from 'newrelic-video-core' (imported as 'nrvideo').

Making the following changes solved the problem for me:

diff --git a/node_modules/newrelic-video-videojs/src/index.js b/node_modules/newrelic-video-videojs/src/index.js
index 32b64c7..f15b601 100644
--- a/node_modules/newrelic-video-videojs/src/index.js
+++ b/node_modules/newrelic-video-videojs/src/index.js
@@ -2,5 +2,4 @@ import * as nrvideo from 'newrelic-video-core'
 import Tracker from './tracker'
 import './register-plugin'
 
-nrvideo.VideojsTracker = Tracker
-module.exports = nrvideo
+export default { ...nrvideo, VideojsTracker: Tracker }

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.