@eluvio/elv-client-js 4.0.51 → 4.0.52
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/client/ContentAccess.js +22 -0
package/package.json
CHANGED
|
@@ -2131,6 +2131,17 @@ exports.ContentObjectImageUrl = async function({libraryId, objectId, versionHash
|
|
|
2131
2131
|
return this.objectImageUrls[versionHash];
|
|
2132
2132
|
};
|
|
2133
2133
|
|
|
2134
|
+
const EmbedMediaTypes = {
|
|
2135
|
+
"video": "v",
|
|
2136
|
+
"live_video": "lv",
|
|
2137
|
+
"audio": "a",
|
|
2138
|
+
"image": "i",
|
|
2139
|
+
"html": "h",
|
|
2140
|
+
"ebook": "b",
|
|
2141
|
+
"gallery": "g",
|
|
2142
|
+
"link": "l"
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2134
2145
|
/**
|
|
2135
2146
|
* Get an embed URL for the specified object
|
|
2136
2147
|
*
|
|
@@ -2139,6 +2150,14 @@ exports.ContentObjectImageUrl = async function({libraryId, objectId, versionHash
|
|
|
2139
2150
|
* @param {string} objectId - ID of the object
|
|
2140
2151
|
* @param {string} versionHash - Version hash of the object
|
|
2141
2152
|
* @param {number} duration - Time until the token expires, in milliseconds (1 day = 24 * 60 * 60 * 1000 = 86400000)
|
|
2153
|
+
* @param {string=} mediaType=video - The type of the media. Available options:
|
|
2154
|
+
- `video`
|
|
2155
|
+
- `live_video`
|
|
2156
|
+
- `audio`
|
|
2157
|
+
- `image`
|
|
2158
|
+
- `gallery`
|
|
2159
|
+
- `ebook`
|
|
2160
|
+
- `html`
|
|
2142
2161
|
* @param {Object} options - Additional video/player options
|
|
2143
2162
|
- `autoplay` - If enabled, video will autoplay. Note that videos block autoplay of videos with audio by default
|
|
2144
2163
|
- `capLevelToPlayerSize` - Caps video quality to player size
|
|
@@ -2164,6 +2183,7 @@ exports.EmbedUrl = async function({
|
|
|
2164
2183
|
objectId,
|
|
2165
2184
|
versionHash,
|
|
2166
2185
|
duration=86400000,
|
|
2186
|
+
mediaType="video",
|
|
2167
2187
|
options={}
|
|
2168
2188
|
}) {
|
|
2169
2189
|
if(versionHash) {
|
|
@@ -2198,6 +2218,8 @@ exports.EmbedUrl = async function({
|
|
|
2198
2218
|
embedUrl.searchParams.set("oid", objectId);
|
|
2199
2219
|
}
|
|
2200
2220
|
|
|
2221
|
+
embedUrl.searchParams.set("mt", EmbedMediaTypes[mediaType.toLowerCase()] || "v");
|
|
2222
|
+
|
|
2201
2223
|
const data = {};
|
|
2202
2224
|
for(const option of Object.keys(options)) {
|
|
2203
2225
|
switch(option) {
|