Skip to content

Commit

Permalink
feat: align environment parmas names (#38)
Browse files Browse the repository at this point in the history
align with kaltura BE naming convention
beUrl => serviceUrl
baseUrl => cdn url
  • Loading branch information
OrenMe authored Dec 10, 2017
1 parent cab5932 commit 78f5a64
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/k-provider/ovp/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@flow

const defaultConfig: Object = {
beUrl: "//www.kaltura.com/api_v3",
baseUrl: "//cdnapisec.kaltura.com",
serviceUrl: "//www.kaltura.com/api_v3",
cdnUrl: "//cdnapisec.kaltura.com",
serviceParams: {
apiVersion: '3.3.0',
format: 1
Expand Down
6 changes: 3 additions & 3 deletions src/k-provider/ovp/loaders/media-entry-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export default class MediaEntryLoader implements ILoader {
*/
buildRequests(params: Object): Array<RequestBuilder> {
let requests: Array<RequestBuilder> = [];
requests.push(BaseEntryService.list(config.beUrl, params.ks, params.entryId));
requests.push(BaseEntryService.getPlaybackContext(config.beUrl, params.ks, params.entryId));
requests.push(MetaDataService.list(config.beUrl, params.ks, params.entryId));
requests.push(BaseEntryService.list(config.serviceUrl, params.ks, params.entryId));
requests.push(BaseEntryService.getPlaybackContext(config.serviceUrl, params.ks, params.entryId));
requests.push(MetaDataService.list(config.serviceUrl, params.ks, params.entryId));
return requests;
}

Expand Down
2 changes: 1 addition & 1 deletion src/k-provider/ovp/loaders/session-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class SessionLoader implements ILoader {
*/
buildRequests(params: Object): Array<RequestBuilder> {
let requests: Array<RequestBuilder> = [];
requests.push(SessionService.anonymousSession(config.beUrl, params.partnerId));
requests.push(SessionService.anonymousSession(config.serviceUrl, params.partnerId));
return requests;
}

Expand Down
2 changes: 1 addition & 1 deletion src/k-provider/ovp/loaders/ui-config-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class UiConfigLoader implements ILoader {
*/
buildRequests(params: Object): Array<RequestBuilder> {
let requests: Array<RequestBuilder> = [];
requests.push(UiConfService.get(config.beUrl, params.ks, params.uiConfId));
requests.push(UiConfService.get(config.serviceUrl, params.ks, params.uiConfId));
return requests;
}

Expand Down
8 changes: 4 additions & 4 deletions src/k-provider/ovp/play-source-url-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class PlaySourceUrlBuilder {
* @static
*/
static build(urlParams: Object): string {
let baseUrl: string = config.baseUrl;
let cdnUrl: string = config.cdnUrl;
let partnerId: string = urlParams.partnerId;
let entryId: string = urlParams.entryId;
let ks: string = urlParams.ks;
Expand All @@ -27,12 +27,12 @@ export default class PlaySourceUrlBuilder {
let extension: string = urlParams.extension;
let flavorIds: string = urlParams.flavorIds;

if (baseUrl == "" && partnerId == "" && entryId == "" && extension == "" && format == "") {
if (cdnUrl == "" && partnerId == "" && entryId == "" && extension == "" && format == "") {
return "";
}

let playUrl = baseUrl;
if (!baseUrl.endsWith("/")) {
let playUrl = cdnUrl;
if (!cdnUrl.endsWith("/")) {
playUrl += "/";
}
playUrl += "p/" + partnerId + "/sp/" + partnerId + "00" + "/playManifest/entryId/" + entryId + "/protocol/" + protocol + "/format/" + format;
Expand Down
2 changes: 1 addition & 1 deletion src/k-provider/ovp/provider-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default class ProviderParser {
*/
static _getBaseProtocol(): string {
const protocolRegex = /^https?:/;
const result = protocolRegex.exec(config.baseUrl);
const result = protocolRegex.exec(config.cdnUrl);
const protocol = result ? result[0] : document.location.protocol;
if (typeof protocol === "string") {
return protocol.slice(0, -1) // remove ':' from the end
Expand Down
2 changes: 1 addition & 1 deletion src/k-provider/ovp/services/ovp-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class OvpService {
let multiReq = new MultiRequestBuilder(headers);
multiReq.method = "POST";
multiReq.service = SERVICE_NAME;
multiReq.url = multiReq.getUrl(config.beUrl);
multiReq.url = multiReq.getUrl(config.serviceUrl);
multiReq.params = ovpParams;
return multiReq;
}
Expand Down

0 comments on commit 78f5a64

Please sign in to comment.