Skip to content

Commit

Permalink
Generate latest bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Mar 28, 2023
1 parent f19df61 commit 02518aa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
20 changes: 16 additions & 4 deletions dist/mparticle-media.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ var MediaEvent = /** @class */ (function (_super) {
* 'OnDemand' // Stream Type (OnDemand, Live, etc.)
* true, // Log Page Event Toggle (true/false)
* true, // Log Media Event Toggle (true/false)
* { // (optional) Custom Attributes object used for each media event within the Media Session
* mediaSessionAttribute1: 'value1',
* mediaSessionAttribute2: 'value2'
* };
* )
* ```
*
Expand Down Expand Up @@ -480,8 +484,9 @@ var MediaSession = /** @class */ (function () {
* @param streamType A descriptor for the type of stream, i.e. live or on demand
* @param logPageEvent A flag that toggles sending mParticle Events to Core SDK
* @param logMediaEvent A flag that toggles sending Media Events to Core SDK
* @param mediaSessionAttributes (optional) A set of custom attributes to attach to all media Events created by a Session
*/
function MediaSession(mparticleInstance, contentId, title, duration, contentType, streamType, logPageEvent, logMediaEvent) {
function MediaSession(mparticleInstance, contentId, title, duration, contentType, streamType, logPageEvent, logMediaEvent, mediaSessionAttributes) {
if (logPageEvent === void 0) { logPageEvent = false; }
if (logMediaEvent === void 0) { logMediaEvent = true; }
this.mparticleInstance = mparticleInstance;
Expand All @@ -492,6 +497,7 @@ var MediaSession = /** @class */ (function () {
this.streamType = streamType;
this.logPageEvent = logPageEvent;
this.logMediaEvent = logMediaEvent;
this.mediaSessionAttributes = mediaSessionAttributes;
this._sessionId = '';
this.currentQoS = {
startupTime: 0,
Expand Down Expand Up @@ -545,8 +551,13 @@ var MediaSession = /** @class */ (function () {
// Set event option based on options or current state
this.currentPlayheadPosition =
(options === null || options === void 0 ? void 0 : options.currentPlayheadPosition) || this.currentPlayheadPosition;
this.customAttributes = (options === null || options === void 0 ? void 0 : options.customAttributes) || {};
options = __assign({ currentPlayheadPosition: this.currentPlayheadPosition, customAttributes: this.customAttributes }, options);
// Merge Session Attributes with any other optional Event Attributes.
// Event-Level Custom Attributes will override Session Custom Attributes if there is a collison.
this.customAttributes = __assign(__assign({}, this.mediaSessionAttributes), ((options === null || options === void 0 ? void 0 : options.customAttributes) || {}));
options = {
currentPlayheadPosition: this.currentPlayheadPosition,
customAttributes: this.customAttributes,
};
return new MediaEvent(eventType, this.title, this.contentId, this.duration, this.contentType, this.streamType, this.sessionId, options);
};
/**
Expand Down Expand Up @@ -923,7 +934,8 @@ var MediaSession = /** @class */ (function () {
* contentType = ContentType.Video
*
* logPageEvents = false //optional, defaults to false anyway
* logMediaEvents = false
* logMediaEvents = false //optional, defaults to false anyway
* sessionCustomEvents = {} //optional, defaults to empty object
* );
*
* const myCallback = (event: MediaEvent): void => {
Expand Down
20 changes: 16 additions & 4 deletions dist/mparticle-media.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ var MediaSession = (function () {
* 'OnDemand' // Stream Type (OnDemand, Live, etc.)
* true, // Log Page Event Toggle (true/false)
* true, // Log Media Event Toggle (true/false)
* { // (optional) Custom Attributes object used for each media event within the Media Session
* mediaSessionAttribute1: 'value1',
* mediaSessionAttribute2: 'value2'
* };
* )
* ```
*
Expand Down Expand Up @@ -481,8 +485,9 @@ var MediaSession = (function () {
* @param streamType A descriptor for the type of stream, i.e. live or on demand
* @param logPageEvent A flag that toggles sending mParticle Events to Core SDK
* @param logMediaEvent A flag that toggles sending Media Events to Core SDK
* @param mediaSessionAttributes (optional) A set of custom attributes to attach to all media Events created by a Session
*/
function MediaSession(mparticleInstance, contentId, title, duration, contentType, streamType, logPageEvent, logMediaEvent) {
function MediaSession(mparticleInstance, contentId, title, duration, contentType, streamType, logPageEvent, logMediaEvent, mediaSessionAttributes) {
if (logPageEvent === void 0) { logPageEvent = false; }
if (logMediaEvent === void 0) { logMediaEvent = true; }
this.mparticleInstance = mparticleInstance;
Expand All @@ -493,6 +498,7 @@ var MediaSession = (function () {
this.streamType = streamType;
this.logPageEvent = logPageEvent;
this.logMediaEvent = logMediaEvent;
this.mediaSessionAttributes = mediaSessionAttributes;
this._sessionId = '';
this.currentQoS = {
startupTime: 0,
Expand Down Expand Up @@ -546,8 +552,13 @@ var MediaSession = (function () {
// Set event option based on options or current state
this.currentPlayheadPosition =
(options === null || options === void 0 ? void 0 : options.currentPlayheadPosition) || this.currentPlayheadPosition;
this.customAttributes = (options === null || options === void 0 ? void 0 : options.customAttributes) || {};
options = __assign({ currentPlayheadPosition: this.currentPlayheadPosition, customAttributes: this.customAttributes }, options);
// Merge Session Attributes with any other optional Event Attributes.
// Event-Level Custom Attributes will override Session Custom Attributes if there is a collison.
this.customAttributes = __assign(__assign({}, this.mediaSessionAttributes), ((options === null || options === void 0 ? void 0 : options.customAttributes) || {}));
options = {
currentPlayheadPosition: this.currentPlayheadPosition,
customAttributes: this.customAttributes,
};
return new MediaEvent(eventType, this.title, this.contentId, this.duration, this.contentType, this.streamType, this.sessionId, options);
};
/**
Expand Down Expand Up @@ -924,7 +935,8 @@ var MediaSession = (function () {
* contentType = ContentType.Video
*
* logPageEvents = false //optional, defaults to false anyway
* logMediaEvents = false
* logMediaEvents = false //optional, defaults to false anyway
* sessionCustomEvents = {} //optional, defaults to empty object
* );
*
* const myCallback = (event: MediaEvent): void => {
Expand Down

0 comments on commit 02518aa

Please sign in to comment.