diff --git a/force-app/main/default/classes/VideoViewerController.cls b/force-app/main/default/classes/VideoViewerController.cls old mode 100755 new mode 100644 index 9659dc7..ef5d78d --- a/force-app/main/default/classes/VideoViewerController.cls +++ b/force-app/main/default/classes/VideoViewerController.cls @@ -33,6 +33,12 @@ public with sharing class VideoViewerController { @AuraEnabled(cacheable=true) public static String getBaseUrl() { - return System.URL.getOrgDomainUrl().toExternalForm(); + if(Network.getNetworkId() == null){ + String baseURL = System.URL.getSalesforceBaseUrl().toExternalForm(); + baseURL = baseURL.split('\\.')[0]; + return baseURL+'--c'+'.documentforce.com'; + }else{ + return System.URL.getSalesforceBaseUrl().toExternalForm(); + } } -} +} \ No newline at end of file diff --git a/force-app/main/default/lwc/videoViewer/utils.js b/force-app/main/default/lwc/videoViewer/utils.js index 1459e7f..e8294b2 100644 --- a/force-app/main/default/lwc/videoViewer/utils.js +++ b/force-app/main/default/lwc/videoViewer/utils.js @@ -8,15 +8,13 @@ /** * Util methods */ -const CUSTOM_PART = "--c"; const DOWNLOAD_PART = - ".documentforce.com/sfc/servlet.shepherd/document/download/"; + "/sfc/servlet.shepherd/document/download/"; // Returns either an empty string or the org's base video download url export function getBaseVideoUrl(baseUrl) { if (baseUrl) { - const domain = baseUrl.split(".")[0]; - return `${domain}${CUSTOM_PART}${DOWNLOAD_PART}`; + return `${baseUrl}${DOWNLOAD_PART}`; } return ""; } diff --git a/force-app/main/default/lwc/videoViewer/videoViewer.html b/force-app/main/default/lwc/videoViewer/videoViewer.html old mode 100755 new mode 100644 index 2d207ef..ecccfbd --- a/force-app/main/default/lwc/videoViewer/videoViewer.html +++ b/force-app/main/default/lwc/videoViewer/videoViewer.html @@ -1,88 +1,94 @@