From 4dc88a0897a4a2fa9d8484feb2a3094d5fbd8cab Mon Sep 17 00:00:00 2001 From: Adam Winiarczyk Date: Wed, 5 Apr 2017 11:03:44 +0200 Subject: [PATCH 1/7] Add compiled files --- lib/Base.js | 1 + lib/audio/AudioManager.js | 16 +++++++++++----- lib/audio/Factory.js | 1 + lib/audio/HTMLPlayer.js | 16 +++++++++++----- lib/audio/IAudioPlayer.js | 1 + lib/channel/Player.js | 16 +++++++++++----- lib/channel/Playlist.js | 1 + lib/channel/PlaylistFetcher.js | 1 + lib/channel/PlaylistResolver.js | 1 + lib/channel/Track.js | 16 +++++++++++----- lib/channel/TrackInfo.js | 1 + lib/clock/SyncClock.js | 16 +++++++++++----- lib/index.js | 1 + 13 files changed, 63 insertions(+), 25 deletions(-) diff --git a/lib/Base.js b/lib/Base.js index 1719b8c..a993e77 100644 --- a/lib/Base.js +++ b/lib/Base.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var Base = (function () { function Base() { this.__events = {}; diff --git a/lib/audio/AudioManager.js b/lib/audio/AudioManager.js index 77fbd76..3e4a946 100644 --- a/lib/audio/AudioManager.js +++ b/lib/audio/AudioManager.js @@ -1,9 +1,15 @@ "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); var Factory_1 = require("./Factory"); var Base_1 = require("../Base"); var AudioManager = (function (_super) { diff --git a/lib/audio/Factory.js b/lib/audio/Factory.js index 5394760..9e02f95 100644 --- a/lib/audio/Factory.js +++ b/lib/audio/Factory.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var HTMLPlayer_1 = require("./HTMLPlayer"); var Factory = (function () { function Factory() { diff --git a/lib/audio/HTMLPlayer.js b/lib/audio/HTMLPlayer.js index 9ca782d..44e3149 100644 --- a/lib/audio/HTMLPlayer.js +++ b/lib/audio/HTMLPlayer.js @@ -1,9 +1,15 @@ "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); var Base_1 = require("../Base"); var FADE_OUT_INTERVAL = 25; var HTMLPlayer = (function (_super) { diff --git a/lib/audio/IAudioPlayer.js b/lib/audio/IAudioPlayer.js index 3918c74..c8ad2e5 100644 --- a/lib/audio/IAudioPlayer.js +++ b/lib/audio/IAudioPlayer.js @@ -1 +1,2 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/channel/Player.js b/lib/channel/Player.js index e834f23..2bec732 100644 --- a/lib/channel/Player.js +++ b/lib/channel/Player.js @@ -1,9 +1,14 @@ "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; @@ -12,6 +17,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { } return t; }; +Object.defineProperty(exports, "__esModule", { value: true }); var Base_1 = require("../Base"); var SyncClock_1 = require("../clock/SyncClock"); var PlaylistFetcher_1 = require("../channel/PlaylistFetcher"); diff --git a/lib/channel/Playlist.js b/lib/channel/Playlist.js index e5673da..4275cde 100644 --- a/lib/channel/Playlist.js +++ b/lib/channel/Playlist.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var Track_1 = require("./Track"); var Playlist = (function () { function Playlist(tracks) { diff --git a/lib/channel/PlaylistFetcher.js b/lib/channel/PlaylistFetcher.js index d7e78ef..4ffea46 100644 --- a/lib/channel/PlaylistFetcher.js +++ b/lib/channel/PlaylistFetcher.js @@ -7,6 +7,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { } return t; }; +Object.defineProperty(exports, "__esModule", { value: true }); var PlaylistResolver_1 = require("./PlaylistResolver"); var PlaylistFetcher = (function () { function PlaylistFetcher(accessToken, channelId, clock, options) { diff --git a/lib/channel/PlaylistResolver.js b/lib/channel/PlaylistResolver.js index 48a5a0f..b23d19a 100644 --- a/lib/channel/PlaylistResolver.js +++ b/lib/channel/PlaylistResolver.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var Playlist_1 = require("./Playlist"); var PlaylistResolver = (function () { function PlaylistResolver(accessToken, playlistRaw) { diff --git a/lib/channel/Track.js b/lib/channel/Track.js index 622848c..6177165 100644 --- a/lib/channel/Track.js +++ b/lib/channel/Track.js @@ -1,9 +1,15 @@ "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); var Base_1 = require("../Base"); var TrackInfo_1 = require("./TrackInfo"); var Track = (function (_super) { diff --git a/lib/channel/TrackInfo.js b/lib/channel/TrackInfo.js index 34b7d9d..785b6da 100644 --- a/lib/channel/TrackInfo.js +++ b/lib/channel/TrackInfo.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var TrackInfo = (function () { function TrackInfo(name, metadata) { this.__name = name; diff --git a/lib/clock/SyncClock.js b/lib/clock/SyncClock.js index ce3f415..64eb286 100644 --- a/lib/clock/SyncClock.js +++ b/lib/clock/SyncClock.js @@ -1,9 +1,15 @@ "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); var Base_1 = require("../Base"); var SyncClock = (function (_super) { __extends(SyncClock, _super); diff --git a/lib/index.js b/lib/index.js index 605dece..61fb28c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,5 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); var Player_1 = require("./channel/Player"); exports.Channel = { Player: Player_1.Player, From 6f43d14e8ea57fd647e2a60d7df0a7f4de244766 Mon Sep 17 00:00:00 2001 From: Adam Winiarczyk Date: Thu, 6 Apr 2017 13:21:33 +0200 Subject: [PATCH 2/7] Add logic for sending stats to circumstances backend --- demo/index.html | 3 +- dist/browser/radiokit-toolkit-playback.js | 244 ++++++++++++++++-- dist/browser/radiokit-toolkit-playback.js.map | 2 +- lib/channel/Player.js | 80 +++++- lib/channel/Player.ts | 97 ++++++- lib/channel/StatsSender.js | 64 +++++ lib/channel/StatsSender.ts | 74 ++++++ package.json | 3 + 8 files changed, 535 insertions(+), 32 deletions(-) create mode 100644 lib/channel/StatsSender.js create mode 100644 lib/channel/StatsSender.ts diff --git a/demo/index.html b/demo/index.html index 18419aa..2de086e 100644 --- a/demo/index.html +++ b/demo/index.html @@ -7,9 +7,10 @@