fix video embed url
This commit is contained in:
parent
458441600d
commit
bbd437d1ad
3 changed files with 19 additions and 4 deletions
|
@ -16,7 +16,8 @@ class AssetInfo extends React.Component {
|
|||
const { asset } = this.props;
|
||||
const { claimViews, claimData: { channelName, channelShortId, description, name, fileExt, contentType, thumbnail, host } } = asset;
|
||||
|
||||
const assetCanonicalUrl = `${host}${createCanonicalLink({ asset: { ...asset.claimData, shortId: asset.shortId }})}`;
|
||||
const canonicalUrl = createCanonicalLink({ asset: { ...asset.claimData, shortId: asset.shortId }});
|
||||
const assetCanonicalUrl = `${host}${canonicalUrl}`;
|
||||
|
||||
let channelCanonicalUrl;
|
||||
if (channelName) {
|
||||
|
@ -96,7 +97,7 @@ class AssetInfo extends React.Component {
|
|||
{(contentType === 'video/mp4') ? (
|
||||
<ClickToCopy
|
||||
id={'embed-text-video'}
|
||||
value={`<iframe src="${host}/video-embed${assetCanonicalUrl}" allowfullscreen="true" style="border:0" /></iframe>`}
|
||||
value={`<iframe src="${host}/video-embed${canonicalUrl}" allowfullscreen="true" style="border:0" /></iframe>`}
|
||||
/>
|
||||
) : (
|
||||
<ClickToCopy
|
||||
|
|
|
@ -69,12 +69,19 @@ const parseLogoConfigParam = async (rawConfig) => {
|
|||
}
|
||||
|
||||
const sendVideoEmbedPage = async ({ params }, res) => {
|
||||
const {
|
||||
let {
|
||||
claimId,
|
||||
config,
|
||||
name,
|
||||
} = params;
|
||||
|
||||
// if channel then swap name and claimId for order
|
||||
if (name[0] === '@' && name.includes(':')) {
|
||||
const temp = name;
|
||||
name = claimId;
|
||||
claimId = temp;
|
||||
}
|
||||
|
||||
const logoConfig = await parseLogoConfigParam(config);
|
||||
|
||||
// test setting response headers
|
||||
|
|
|
@ -34,6 +34,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var createCanonicalLink = require('../../../utils/createCanonicalLink');
|
||||
|
||||
var getCanonicalUrlFromShow = function getCanonicalUrlFromShow(show) {
|
||||
|
@ -42,8 +46,11 @@ var getCanonicalUrlFromShow = function getCanonicalUrlFromShow(show) {
|
|||
|
||||
switch (requestType) {
|
||||
case 'ASSET_DETAILS':
|
||||
var asset = show.assetList[requestId.key];
|
||||
return createCanonicalLink({
|
||||
asset: show.assetList[requestId.key]
|
||||
asset: _objectSpread({}, asset.claimData, {
|
||||
shortId: asset.shortId
|
||||
})
|
||||
});
|
||||
|
||||
case 'CHANNEL':
|
||||
|
|
Loading…
Reference in a new issue