Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nr 343614 Standarising the Attributes across all players #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ coverage/
.nyc_output
*.zip


# logs
*.log
*.log

# ignore agent.js
samples/agent.js
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semiColon": true
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"main": "src/index.js",
"scripts": {
"test": "jest --coverage",
"build": "webpack -p",
"build": "webpack --mode production",
"build:dev": "webpack --mode development",
"watch": "webpack -p --progress --color --watch",
"watch:dev": "webpack --progress --color --watch",
"watch": "webpack --progress --color --watch --mode production",
"watch:dev": "webpack --progress --color --watch --mode development",
"prezip": "npm run build",
"zip": "zip -P newrelic -x '*.DS_Store' -r shaka.zip dist samples README.md CHANGELOG.md EULA.md",
"clean": "rm -rf dist *.zip",
Expand Down
8 changes: 0 additions & 8 deletions samples/agent.js

This file was deleted.

87 changes: 49 additions & 38 deletions samples/autoplay.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shaka Player MSS Example</title>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>
<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>
<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.js"></script>
<!-- MSS support only with codem-isoboxer javaScript MP4 (MPEG-4, ISOBMFF) parser -->
<script defer src="../node_modules/codem-isoboxer/dist/iso_boxer.min.js"></script>
</head>
<body>
<video id="myPlayer" width="640" height="480" crossorigin="anonymous" controls autoplay></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll()
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shaka Player MSS Example</title>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>
<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>
<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
<!-- MSS support only with codem-isoboxer javaScript MP4 (MPEG-4, ISOBMFF) parser -->
<script
defer
src="../node_modules/codem-isoboxer/dist/iso_boxer.min.js"
></script>
</head>
<body>
<video
id="myPlayer"
width="640"
height="480"
crossorigin="anonymous"
controls
autoplay
></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll();

// Find the video element.
var video = document.getElementById('myPlayer')
// Find the video element.
var video = document.getElementById('myPlayer');

// Construct a Player to wrap around it.
var player = new shaka.Player(video);
// Construct a Player to wrap around it.
var player = new shaka.Player(video);

// source
var source = 'https://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest';
// source
var source =
'https://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest';

// Load the source into the Player.
try {
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (error) {
nrvideo.Core.sendError(error)
}
}
document.addEventListener('DOMContentLoaded', initPlayer)
</script>
</body>
</html>
// Load the source into the Player.
try {
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (error) {
nrvideo.Core.sendError(error);
}
}

document.addEventListener('DOMContentLoaded', initPlayer);
</script>
</body>
</html>
91 changes: 49 additions & 42 deletions samples/dash.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>

<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>

<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.debug.min.js"></script>
</head>
<body>
<video id="myPlayer" width="640" height="480" crossorigin="anonymous" controls></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll()

// Find the video element.
var video = document.getElementById('myPlayer')

// Construct a Player to wrap around it.
var player = new shaka.Player(video)

// Attach the player to the window so that it can be easily debugged.
window.player = player

// source
var source = 'https://turtle-tube.appspot.com/t/t2/dash.mpd'

try {
window.player = player;
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (error) {
nrvideo.Core.sendError(error)
}
}

document.addEventListener('DOMContentLoaded', initPlayer)
</script>
</body>
<head>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>

<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>

<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.debug.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
</head>
<body>
<video
id="myPlayer"
width="640"
height="480"
crossorigin="anonymous"
controls
></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll();

// Find the video element.
var video = document.getElementById('myPlayer');

// Construct a Player to wrap around it.

var player = new shaka.Player(video);

// Attach the player to the window so that it can be easily debugged.
window.player = player;

// source
var source = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';

try {
window.player = player;
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (error) {
nrvideo.Core.sendError(error);
}
}

document.addEventListener('DOMContentLoaded', initPlayer);
</script>
</body>
</html>
95 changes: 50 additions & 45 deletions samples/hls.html
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shaka HLS Player</title>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>

<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>

<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.debug.min.js"></script>

</head>
<body>
<video id="myPlayer" width="640" height="480" crossorigin="anonymous" controls></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll()

// Find the video element.
var video = document.getElementById('myPlayer')

// Construct a Player to wrap around it.
var player = new shaka.Player(video)

// Attach the player to the window so that it can be easily debugged.
// window.player = player

// // source
var source = 'http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8'

// Load the source into the Player.
try {
window.player = player;
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (e) {
nrvideo.Core.sendError(error);
}
}

document.addEventListener('DOMContentLoaded', initPlayer)
</script>
</body>
<!-- newrelic browser agent. REMEMBER TO REPLACE THIS SCRIPT WITH YOUR OWN BROWSER AGENT -->
<script type="text/javascript" src="agent.js"></script>

<!-- newrelic tracker -->
<script src="../dist/newrelic-video-shaka.min.js"></script>

<!-- shaka -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.11.2/shaka-player.compiled.debug.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
</head>
<body>
<video
id="myPlayer"
width="640"
height="480"
crossorigin="anonymous"
controls
></video>
<script>
async function initPlayer() {
// Install polyfills.
shaka.polyfill.installAll();

// Find the video element.
var video = document.getElementById('myPlayer');

// Construct a Player to wrap around it.
var player = new shaka.Player(video);

// Attach the player to the window so that it can be easily debugged.
// window.player = player

// // source
var source = 'http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8';

// Load the source into the Player.
try {
window.player = player;
await player.load(source);
// newrelic
nrvideo.Core.addTracker(new nrvideo.ShakaTracker(player));
} catch (e) {
nrvideo.Core.sendError(error);
}
}

document.addEventListener('DOMContentLoaded', initPlayer);
</script>
</body>
</html>
Loading
Loading