Sentry in live only

This commit is contained in:
Sam Potts
2018-03-18 01:08:05 +11:00
parent 0f8c6e147b
commit c7ea13c0c7
9 changed files with 785 additions and 765 deletions
+9 -1
View File
@@ -3769,7 +3769,14 @@ var singleton = Raven;
// Please see readme.md in the root or github.com/sampotts/plyr
// ==========================================================================
(function () {
var isLive = window.location.host === 'plyr.io';
// Raven / Sentry
// For demo site (https://plyr.io) only
if (isLive) {
singleton.config('https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555').install();
}
document.addEventListener('DOMContentLoaded', function () {
singleton.context(function () {
@@ -3986,7 +3993,7 @@ document.addEventListener('DOMContentLoaded', function () {
// Google analytics
// For demo site (https://plyr.io) only
/* eslint-disable */
if (window.location.host === 'plyr.io') {
if (isLive) {
(function (i, s, o, g, r, a, m) {
i.GoogleAnalyticsObject = r;
i[r] = i[r] || function () {
@@ -4003,6 +4010,7 @@ if (window.location.host === 'plyr.io') {
window.ga('send', 'pageview');
}
/* eslint-enable */
})();
}());
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -163,7 +163,7 @@
c-1.1,0.9-2.5,1.4-4.1,1.4c-0.3,0-0.5,0-0.8,0c1.5,0.9,3.2,1.5,5,1.5c6,0,9.3-5,9.3-9.3c0-0.1,0-0.3,0-0.4C15,4.3,15.6,3.7,16,3z"></path>
</svg>
<p>If you think Plyr's good,
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts"
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&amp;url=http%3A%2F%2Fplyr.io&amp;via=Sam_Potts"
target="_blank" data-shr-network="twitter">tweet it</a>
</p>
</aside>
@@ -181,7 +181,7 @@
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
<!-- Docs script -->
<script src="dist/demo.js?2" crossorigin="anonymous"></script>
<script src="dist/demo.js" crossorigin="anonymous"></script>
</body>
</html>
+15 -13
View File
@@ -6,7 +6,14 @@
import Raven from 'raven-js';
(() => {
const isLive = window.location.host === 'plyr.io';
// Raven / Sentry
// For demo site (https://plyr.io) only
if (isLive) {
Raven.config('https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555').install();
}
document.addEventListener('DOMContentLoaded', () => {
Raven.context(() => {
@@ -95,12 +102,10 @@ document.addEventListener('DOMContentLoaded', () => {
player.source = {
type: 'video',
title: 'View From A Blue Moon',
sources: [
{
sources: [{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4',
type: 'video/mp4',
},
],
}],
poster: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg',
tracks: [
{
@@ -143,12 +148,10 @@ document.addEventListener('DOMContentLoaded', () => {
player.source = {
type: 'video',
title: 'View From A Blue Moon',
sources: [
{
sources: [{
src: 'https://youtube.com/watch?v=bTqVqk7FSmY',
provider: 'youtube',
},
],
}],
};
break;
@@ -156,12 +159,10 @@ document.addEventListener('DOMContentLoaded', () => {
case types.vimeo:
player.source = {
type: 'video',
sources: [
{
sources: [{
src: 'https://vimeo.com/76979871',
provider: 'vimeo',
},
],
}],
};
break;
@@ -237,7 +238,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Google analytics
// For demo site (https://plyr.io) only
/* eslint-disable */
if (window.location.host === 'plyr.io') {
if (isLive) {
(function(i, s, o, g, r, a, m) {
i.GoogleAnalyticsObject = r;
i[r] =
@@ -256,3 +257,4 @@ if (window.location.host === 'plyr.io') {
window.ga('send', 'pageview');
}
/* eslint-enable */
})();
+9 -4
View File
@@ -70,10 +70,11 @@ const paths = {
root: path.join(root, 'demo/'),
},
upload: [
path.join(root, `dist/*${minSuffix}.js`),
path.join(root, `dist/*${minSuffix}.*`),
path.join(root, 'dist/*.css'),
path.join(root, 'dist/*.svg'),
path.join(root, 'demo/dist/**'),
path.join(root, `demo/dist/*${minSuffix}.*`),
path.join(root, 'demo/dist/*.css'),
],
};
@@ -303,7 +304,8 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
console.log(`Uploading '${version}' to ${aws.cdn.domain}...`);
// Upload to CDN
return gulp
return (
gulp
.src(paths.upload)
.pipe(
rename(p => {
@@ -311,6 +313,8 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
p.dirname = p.dirname.replace('.', version); // eslint-disable-line
}),
)
// Remove min suffix from source map URL
.pipe(replace(/sourceMappingURL=([\w-?.]+)/, (match, p1) => `sourceMappingURL=${p1.replace(minSuffix, '')}`))
.pipe(
size({
showFiles: true,
@@ -318,7 +322,8 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
}),
)
.pipe(replace(localPath, versionPath))
.pipe(s3(aws.cdn, options.cdn));
.pipe(s3(aws.cdn, options.cdn))
);
});
// Publish to demo bucket
+10 -5
View File
@@ -1690,9 +1690,9 @@ eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
eslint@^4.18.2:
version "4.18.2"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45"
eslint@^4.19.0:
version "4.19.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.0.tgz#9e900efb5506812ac374557034ef6f5c3642fc4c"
dependencies:
ajv "^5.3.0"
babel-code-frame "^6.22.0"
@@ -1703,7 +1703,7 @@ eslint@^4.18.2:
doctrine "^2.1.0"
eslint-scope "^3.7.1"
eslint-visitor-keys "^1.0.0"
espree "^3.5.2"
espree "^3.5.4"
esquery "^1.0.0"
esutils "^2.0.2"
file-entry-cache "^2.0.0"
@@ -1725,6 +1725,7 @@ eslint@^4.18.2:
path-is-inside "^1.0.2"
pluralize "^7.0.0"
progress "^2.0.0"
regexpp "^1.0.1"
require-uncached "^1.0.3"
semver "^5.3.0"
strip-ansi "^4.0.0"
@@ -1732,7 +1733,7 @@ eslint@^4.18.2:
table "4.0.2"
text-table "~0.2.0"
espree@^3.5.2:
espree@^3.5.4:
version "3.5.4"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
dependencies:
@@ -4488,6 +4489,10 @@ regex-not@^1.0.0, regex-not@^1.0.2:
extend-shallow "^3.0.2"
safe-regex "^1.1.0"
regexpp@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43"
regexpu-core@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"