Skip to content

Commit

Permalink
Merge pull request #47 from EkoLabs/feature/platform-embed-urls
Browse files Browse the repository at this point in the history
Change embed platform urls to new form
  • Loading branch information
louaig authored Jul 5, 2022
2 parents bd9c296 + 526153e commit eb7cc6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/lib/ekoEmbed/EkoEmbedDeliveryBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { stringifyQueryParams } from '../queryParamsUtils';
import deepmerge from 'deepmerge';

class EkoEmbedDeliveryBase {
constructor(embedapi, embedpath, iframe) {
constructor(serivepath, embedapi, embedpath, iframe) {
this.serivepath = serivepath;
this.embedapi = embedapi || '2.0';
this.embedpath = embedpath || '/';
this.iframe = iframe;
Expand All @@ -23,7 +24,7 @@ class EkoEmbedDeliveryBase {
}

getDeliveryUrl(embedParams, options) {
const host = options.host ? `${options.host}` : `${options.env || ''}embed.eko.com`;
const host = options.host ? `${options.host}` : `${options.env || ''}${this.serivepath}`;
return `https://${host}${this.embedpath}?${stringifyQueryParams(embedParams)}`;
}

Expand Down
3 changes: 2 additions & 1 deletion src/lib/ekoEmbed/v2.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import EkoEmbedDeliveryBase from './EkoEmbedDeliveryBase';

const INSTANCE_EMBED_API = '2.0';
const DELIVERY_SERVICE_BASE_URL = 'embed.eko.com';

class EkoEmbedV2 extends EkoEmbedDeliveryBase {
constructor(iframe) {
super(INSTANCE_EMBED_API, '/', iframe);
super(DELIVERY_SERVICE_BASE_URL, INSTANCE_EMBED_API, '/', iframe);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/lib/ekoEmbed/v3.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import EkoEmbedDeliveryBase from './EkoEmbedDeliveryBase';

const INSTANCE_EMBED_API = '3.0';
const DELIVERY_SRV_INSTANCE_PATH = '/instance';
const DELIVERY_SERVICE_BASE_URL = 'play.eko.com';
const DELIVERY_SRV_INSTANCE_PATH = '/embed';

class EkoEmbedV3 extends EkoEmbedDeliveryBase {
constructor(iframe) {
super(INSTANCE_EMBED_API, DELIVERY_SRV_INSTANCE_PATH, iframe);
super(DELIVERY_SERVICE_BASE_URL, INSTANCE_EMBED_API, DELIVERY_SRV_INSTANCE_PATH, iframe);
}
}

Expand Down

0 comments on commit eb7cc6a

Please sign in to comment.