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 // 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(); singleton.config('https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555').install();
}
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
singleton.context(function () { singleton.context(function () {
@@ -3986,7 +3993,7 @@ document.addEventListener('DOMContentLoaded', function () {
// Google analytics // Google analytics
// For demo site (https://plyr.io) only // For demo site (https://plyr.io) only
/* eslint-disable */ /* eslint-disable */
if (window.location.host === 'plyr.io') { if (isLive) {
(function (i, s, o, g, r, a, m) { (function (i, s, o, g, r, a, m) {
i.GoogleAnalyticsObject = r; i.GoogleAnalyticsObject = r;
i[r] = i[r] || function () { i[r] = i[r] || function () {
@@ -4003,6 +4010,7 @@ if (window.location.host === 'plyr.io') {
window.ga('send', 'pageview'); window.ga('send', 'pageview');
} }
/* eslint-enable */ /* 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> 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> </svg>
<p>If you think Plyr's good, <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> target="_blank" data-shr-network="twitter">tweet it</a>
</p> </p>
</aside> </aside>
@@ -181,7 +181,7 @@
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script> <script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
<!-- Docs script --> <!-- Docs script -->
<script src="dist/demo.js?2" crossorigin="anonymous"></script> <script src="dist/demo.js" crossorigin="anonymous"></script>
</body> </body>
</html> </html>
+15 -13
View File
@@ -6,7 +6,14 @@
import Raven from 'raven-js'; 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(); Raven.config('https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555').install();
}
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
Raven.context(() => { Raven.context(() => {
@@ -95,12 +102,10 @@ document.addEventListener('DOMContentLoaded', () => {
player.source = { player.source = {
type: 'video', type: 'video',
title: 'View From A Blue Moon', title: 'View From A Blue Moon',
sources: [ sources: [{
{
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4', src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4',
type: 'video/mp4', type: 'video/mp4',
}, }],
],
poster: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg', poster: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg',
tracks: [ tracks: [
{ {
@@ -143,12 +148,10 @@ document.addEventListener('DOMContentLoaded', () => {
player.source = { player.source = {
type: 'video', type: 'video',
title: 'View From A Blue Moon', title: 'View From A Blue Moon',
sources: [ sources: [{
{
src: 'https://youtube.com/watch?v=bTqVqk7FSmY', src: 'https://youtube.com/watch?v=bTqVqk7FSmY',
provider: 'youtube', provider: 'youtube',
}, }],
],
}; };
break; break;
@@ -156,12 +159,10 @@ document.addEventListener('DOMContentLoaded', () => {
case types.vimeo: case types.vimeo:
player.source = { player.source = {
type: 'video', type: 'video',
sources: [ sources: [{
{
src: 'https://vimeo.com/76979871', src: 'https://vimeo.com/76979871',
provider: 'vimeo', provider: 'vimeo',
}, }],
],
}; };
break; break;
@@ -237,7 +238,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Google analytics // Google analytics
// For demo site (https://plyr.io) only // For demo site (https://plyr.io) only
/* eslint-disable */ /* eslint-disable */
if (window.location.host === 'plyr.io') { if (isLive) {
(function(i, s, o, g, r, a, m) { (function(i, s, o, g, r, a, m) {
i.GoogleAnalyticsObject = r; i.GoogleAnalyticsObject = r;
i[r] = i[r] =
@@ -256,3 +257,4 @@ if (window.location.host === 'plyr.io') {
window.ga('send', 'pageview'); window.ga('send', 'pageview');
} }
/* eslint-enable */ /* eslint-enable */
})();
+9 -4
View File
@@ -70,10 +70,11 @@ const paths = {
root: path.join(root, 'demo/'), root: path.join(root, 'demo/'),
}, },
upload: [ upload: [
path.join(root, `dist/*${minSuffix}.js`), path.join(root, `dist/*${minSuffix}.*`),
path.join(root, 'dist/*.css'), path.join(root, 'dist/*.css'),
path.join(root, 'dist/*.svg'), 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}...`); console.log(`Uploading '${version}' to ${aws.cdn.domain}...`);
// Upload to CDN // Upload to CDN
return gulp return (
gulp
.src(paths.upload) .src(paths.upload)
.pipe( .pipe(
rename(p => { 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 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( .pipe(
size({ size({
showFiles: true, showFiles: true,
@@ -318,7 +322,8 @@ if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
}), }),
) )
.pipe(replace(localPath, versionPath)) .pipe(replace(localPath, versionPath))
.pipe(s3(aws.cdn, options.cdn)); .pipe(s3(aws.cdn, options.cdn))
);
}); });
// Publish to demo bucket // Publish to demo bucket
+10 -5
View File
@@ -1690,9 +1690,9 @@ eslint-visitor-keys@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
eslint@^4.18.2: eslint@^4.19.0:
version "4.18.2" version "4.19.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.0.tgz#9e900efb5506812ac374557034ef6f5c3642fc4c"
dependencies: dependencies:
ajv "^5.3.0" ajv "^5.3.0"
babel-code-frame "^6.22.0" babel-code-frame "^6.22.0"
@@ -1703,7 +1703,7 @@ eslint@^4.18.2:
doctrine "^2.1.0" doctrine "^2.1.0"
eslint-scope "^3.7.1" eslint-scope "^3.7.1"
eslint-visitor-keys "^1.0.0" eslint-visitor-keys "^1.0.0"
espree "^3.5.2" espree "^3.5.4"
esquery "^1.0.0" esquery "^1.0.0"
esutils "^2.0.2" esutils "^2.0.2"
file-entry-cache "^2.0.0" file-entry-cache "^2.0.0"
@@ -1725,6 +1725,7 @@ eslint@^4.18.2:
path-is-inside "^1.0.2" path-is-inside "^1.0.2"
pluralize "^7.0.0" pluralize "^7.0.0"
progress "^2.0.0" progress "^2.0.0"
regexpp "^1.0.1"
require-uncached "^1.0.3" require-uncached "^1.0.3"
semver "^5.3.0" semver "^5.3.0"
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
@@ -1732,7 +1733,7 @@ eslint@^4.18.2:
table "4.0.2" table "4.0.2"
text-table "~0.2.0" text-table "~0.2.0"
espree@^3.5.2: espree@^3.5.4:
version "3.5.4" version "3.5.4"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
dependencies: dependencies:
@@ -4488,6 +4489,10 @@ regex-not@^1.0.0, regex-not@^1.0.2:
extend-shallow "^3.0.2" extend-shallow "^3.0.2"
safe-regex "^1.1.0" 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: regexpu-core@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"