Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP-3223: #521

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:class="baseUrl == 'unit' ? 'units' : 'collection'"
>
<loader :show="showLoader" />
<div class="row">
<div class="row" v-if="!showLoader">
<!-- <Sidebar /> -->
<div class="col-12 bg-light-gray-1">
<main :class="!unitEntity.currentUnit ? 'mb-3' : 'mb-5'">
Expand Down Expand Up @@ -38,12 +38,12 @@
</h1>
<div class="primary-file">
<div
v-if="baseUrl === 'file'"
class="media-player"
v-if="
baseUrl === 'file'
"
>
<!-- showLoader is {{ showLoader }}, mediaSource is {{ entity.mediaSource }} -->
<div v-if="entity.mediaSource">
<!-- MediaElement -->
<mediaelement
ref="vPlay"
:type="entity.mediaType"
Expand Down Expand Up @@ -1362,21 +1362,23 @@ export default {
}
} else if (self.baseUrl === "file") {
self.showLoader = true;
// console.log("EntityList.getEntityData: before get media, showLoader = " + self.showLoader);
self.entity = self.selectedFile;
if (self.accessControl._primaryfile_media._read) {
let mediaSourceUrl = await self.workflowResultService.getMediaSymlink(
self.selectedFile.id
);
self.entity["mediaSource"] = mediaSourceUrl;
console.log("mediaSource = " + self.entity.mediaSource);
console.log("EntityList.getEntityData: mediaSource = " + self.entity.mediaSource);
}
let mediaSourceType = await self.primaryFileService.getPrimaryFile(
self.selectedFile.id
);
self.entity["mediaInfo"] = mediaSourceType.mediaInfo;
self.entity["mediaType"] = mediaSourceType.mimeType.substring(0, 5);
// console.log("mediaType = " + self.entity.mediaType);
console.log("EntityList.getEntityData: mediaType = " + self.entity.mediaType);
self.showLoader = false;
// console.log("EntityList.getEntityData: after get media, showLoader = " + self.showLoader);
}
},
async getUnitCollections() {
Expand Down
3 changes: 3 additions & 0 deletions src/components/entity/Mediaelement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default {
mounted() {
const { MediaElementPlayer } = global;
const componentObject = this;
// console.log("MediaElement: loading MediaElementPlayer");
this.player = new MediaElementPlayer(this.$el, {
pluginPath: "https://cdn.jsdelivr.net/npm/[email protected]/build/",
shimScriptAccess: "always",
Expand All @@ -82,9 +83,11 @@ export default {
});
}
this.success(mediaElement, originalNode, instance);
// console.log("MediaElement: MediaElementPlayer loaded.");
},
error: (e) => {
this.error(e);
// console.log("MediaElement: error: " + e);
},
});
},
Expand Down
Loading