Skip to content

Commit b3e8b08

Browse files
Ensure exported clips have inline src
1 parent 66de500 commit b3e8b08

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/_shared/frametrail-core/storage/StorageAdapterDownload.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ class StorageAdapterDownload extends StorageAdapter {
8888
hvData.config.theme = fullConfig.defaultTheme;
8989
}
9090

91+
// Ensure clips have inline src so the standalone HTML doesn't depend on a resources index
92+
var HypervideoModel = this._frameTrailInstance.module('HypervideoModel');
93+
if (hvData.clips && HypervideoModel) {
94+
for (var c = 0; c < hvData.clips.length; c++) {
95+
if (!hvData.clips[c].src && hvData.clips[c].resourceId != null) {
96+
var res = Database.resources[hvData.clips[c].resourceId];
97+
if (res) {
98+
hvData.clips[c].src = res.src;
99+
} else if (HypervideoModel.sourcePath) {
100+
hvData.clips[c].src = HypervideoModel.sourcePath;
101+
}
102+
}
103+
}
104+
}
105+
91106
var annotations = Database.getAnnotationsW3C();
92107
var contentItem = { hypervideo: hvData };
93108
if (annotations.length > 0) {

0 commit comments

Comments
 (0)