@eluvio/elv-player-js 1.0.114 → 1.0.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +3 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -641,6 +641,7 @@ export class EluvioPlayer {
|
|
|
641
641
|
}
|
|
642
642
|
} catch (error) {
|
|
643
643
|
// If playout failed due to a permission issue, check the content to see if there is a message to display
|
|
644
|
+
let permissionErrorMessage;
|
|
644
645
|
if(error && [401, 403].includes(error.status) || [401, 403].includes(error.code)) {
|
|
645
646
|
try {
|
|
646
647
|
const client = await this.Client();
|
|
@@ -651,7 +652,7 @@ export class EluvioPlayer {
|
|
|
651
652
|
this.sourceOptions.playoutParameters.versionHash ||
|
|
652
653
|
await client.LatestVersionHash({objectId: this.sourceOptions.playoutParameters.objectId});
|
|
653
654
|
|
|
654
|
-
|
|
655
|
+
permissionErrorMessage = await client.ContentObjectMetadata({
|
|
655
656
|
versionHash: targetHash,
|
|
656
657
|
metadataSubtree: "public/asset_metadata/permission_message",
|
|
657
658
|
authorizationToken: this.sourceOptions.playoutParameters.authorizationToken
|
|
@@ -674,7 +675,7 @@ export class EluvioPlayer {
|
|
|
674
675
|
} catch(error) {}
|
|
675
676
|
}
|
|
676
677
|
|
|
677
|
-
|
|
678
|
+
error.permission_message = permissionErrorMessage;
|
|
678
679
|
if(this.playerOptions.errorCallback) {
|
|
679
680
|
this.playerOptions.errorCallback(error, this);
|
|
680
681
|
}
|