Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
reddy-vishwanath committed Jun 5, 2024
1 parent f2fc9e7 commit 7a7546b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VideoWebStory.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h5>Parameters:</h5>
<p class="tag-source">
<a href="atoms_video-web-story_video-web-story.tsx.html" class="button">View Source</a>
<span>
<a href="atoms_video-web-story_video-web-story.tsx.html">atoms/video-web-story/video-web-story.tsx</a>, <a href="atoms_video-web-story_video-web-story.tsx.html#line28">line 28</a>
<a href="atoms_video-web-story_video-web-story.tsx.html">atoms/video-web-story/video-web-story.tsx</a>, <a href="atoms_video-web-story_video-web-story.tsx.html#line45">line 45</a>
</span>
</p>

Expand Down
23 changes: 20 additions & 3 deletions atoms_video-web-story_video-web-story.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,27 @@ <h1>atoms/video-web-story/video-web-story.tsx</h1>
import atob from "atob-utf-8";
import { withConfig } from "../../context";

const getVideoData = (videoElement) => {
const videoElementType = videoElement.type;
let videoUrl = "";
let format = "";
if (videoElementType === "jsembed") {
videoUrl = atob(`${videoElement["embed-js"]}`);
format = videoUrl.split(".")[3];
} else if (videoElementType === "video") {
videoUrl = videoElement?.["metadata"]?.["video-clip-url"];
const splittedURL = videoUrl?.split("/");
const videoName = splittedURL?.[splittedURL.length - 1]?.split(".");
format = videoName?.[videoName.length - 1];
}
return { videoUrl, format };
};

export const VideoWebStoryBase = ({ config, videoElement, imageElement, heroImage }) => {
const videoUrl = videoElement &amp;&amp; atob(`${videoElement["embed-js"]}`);
const format = videoUrl.split(".")[3];
const poster = imageElement ? `https://${config.publisherConfig["cdn-image"]}/${imageElement["image-s3-key"]}` : `https://${config.publisherConfig["cdn-image"]}/${heroImage["hero-image-s3-key"]}` ;
const { videoUrl, format } = getVideoData(videoElement);
const poster = imageElement
? `https://${config.publisherConfig["cdn-image"]}/${imageElement["image-s3-key"]}`
: `https://${config.publisherConfig["cdn-image"]}/${heroImage?.["hero-image-s3-key"]}`;
return (
&lt;Fragment>
&lt;Helmet>
Expand Down
6 changes: 3 additions & 3 deletions build/entry.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/entry.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 7a7546b

Please sign in to comment.