-
{
// if(trimZoneRef.current){
// trimZoneRef.current.style.cursor = 'grabbing';
@@ -220,14 +231,14 @@ export default memo(function VideoQuickTrim({
>
-
-
{/* END of Playbar */}
-
+
@@ -235,12 +246,14 @@ export default memo(function VideoQuickTrim({
className="button-mute"
icon={isMuted ? faVolumeSlash : faVolume}
variant="secondary"
- onClick={()=>setIsMuted((curr)=>(!curr))}
+ onClick={() => setIsMuted(curr => !curr)}
/>
-
+
- {`${formatSecondsToHHMMSSCS(videoRef.current?.currentTime || 0)}`}
+ {`${formatSecondsToHHMMSSCS(
+ videoRef.current?.currentTime || 0
+ )}`}
/
@@ -254,6 +267,7 @@ export default memo(function VideoQuickTrim({
diff --git a/packages/fakeyou.com/src/components/common/VideoQuickTrim/styles.scss b/packages/fakeyou.com/src/components/common/VideoQuickTrim/styles.scss
index 9c30de85ca..00a437cc6f 100644
--- a/packages/fakeyou.com/src/components/common/VideoQuickTrim/styles.scss
+++ b/packages/fakeyou.com/src/components/common/VideoQuickTrim/styles.scss
@@ -3,7 +3,7 @@
$playbar-height: 2rem;
.fy-video-quicktrim {
- .video-wrapper{
+ .video-wrapper {
position: relative;
background-color: $bg;
border-radius: 0.5rem 0.5rem 0 0;
@@ -11,71 +11,76 @@ $playbar-height: 2rem;
border-left: $panel-inner-border 1px solid;
border-right: $panel-inner-border 1px solid;
}
- .fy-video{
- height: 500px;
+ .fy-video {
+ max-height: 500px;
+ margin-bottom: -7px;
+
+ video {
+ border-radius: 0.5rem 0.5rem 0 0;
+ }
}
- .playpause-overlay{
+ .playpause-overlay {
position: absolute;
cursor: pointer;
height: 100%;
width: 100%;
- top:0;
- left:0;
+ top: 0;
+ left: 0;
display: flex;
justify-content: center;
align-items: center;
- svg{
+ svg {
opacity: 0;
- transition: opacity 0.5s;
+ transition: opacity 0.5s;
}
- &:hover svg{
+ &:hover svg {
opacity: 1;
}
}
- .warning-too-short{
+ .warning-too-short {
position: absolute;
height: 100%;
width: 100%;
- top:0;
- left:0;
+ top: 0;
+ left: 0;
display: flex;
justify-content: center;
align-items: center;
- div{
+ div {
position: absolute;
height: 100%;
width: 100%;
- top:0;
- left:0;
+ top: 0;
+ left: 0;
background-color: #e66462;
opacity: 70%;
}
- p{
+ p {
position: absolute;
margin-top: 230px;
width: 100%;
- top:0;
+ top: 0;
}
}
- .playbar{
- position:relative;
+ .playbar {
+ position: relative;
height: $playbar-height;
width: 100%;
}
- .playbar-bg{
+ .playbar-bg {
position: absolute;
height: 100%;
width: 100%;
- top:0;
+ top: 0;
left: 0;
background-color: $panel-inner-border;
border-radius: 0 0 0.5rem 0.5rem;
}
- .trimzone{
+ .trimzone {
position: absolute;
- top:-1rem;
+ top: -1rem;
height: 3rem;
background-color: #e66462;
opacity: 0.8;
@@ -92,29 +97,29 @@ $playbar-height: 2rem;
color: $panel-inner-border;
}
}
- .playcursor{
+ .playcursor {
position: absolute;
- top:0;
+ top: 0;
width: 0.5rem;
height: $playbar-height;
background-color: $white;
}
- .playpause-external{
- .button-playpause{
+ .playpause-external {
+ .button-playpause {
width: 55px;
height: 40px;
margin-right: 0.5rem;
}
- .button-mute{
+ .button-mute {
width: 40px;
height: 40px;
}
- .playtime{
- span{
+ .playtime {
+ span {
width: 60px;
}
- div{
+ div {
width: 10px;
margin-left: 3px;
margin-right: 5px;
@@ -122,4 +127,4 @@ $playbar-height: 2rem;
}
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/fakeyou.com/src/v2/view/PageContainer.tsx b/packages/fakeyou.com/src/v2/view/PageContainer.tsx
index a5c0fa78c8..73c2c0820e 100644
--- a/packages/fakeyou.com/src/v2/view/PageContainer.tsx
+++ b/packages/fakeyou.com/src/v2/view/PageContainer.tsx
@@ -125,6 +125,7 @@ import DevUpload from "./pages/dev_upload/DevUpload";
import DevMediaInput from "./pages/dev_upload/DevMediaInput";
import { StudioIntroPage } from "./pages/storyteller_studio_intro/StudioIntroPage";
import StudioVSTPage from "./pages/storyteller_studio_intro/StudioVST/StudioVSTPage";
+import { StudioIntroResultPage } from "./pages/storyteller_studio_intro/StudioIntroResultPage";
interface Props {
sessionWrapper: SessionWrapper;
@@ -757,6 +758,15 @@ class PageContainer extends React.Component<
/>
+
+
+
+
diff --git a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntro.scss b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntro.scss
index 22a48fca59..d5314fae00 100644
--- a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntro.scss
+++ b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntro.scss
@@ -3,3 +3,7 @@
flex-direction: column;
height: calc(100vh - 66px);
}
+
+.result-video-wrapper {
+ max-width: 1100px;
+}
diff --git a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroPage.tsx b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroPage.tsx
index ec60816227..98b020d084 100644
--- a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroPage.tsx
+++ b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroPage.tsx
@@ -42,6 +42,7 @@ function StudioIntroPage(props: Props) {
}
const onClick = () => {
+ // This opens the job modal. Needs to be disabled.
EnqueueEngineCompositing("", {
uuid_idempotency_token: uuidv4(),
media_file_token: mediaToken || "",
diff --git a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroResultPage.tsx b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroResultPage.tsx
new file mode 100644
index 0000000000..e1cd967d77
--- /dev/null
+++ b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioIntroResultPage.tsx
@@ -0,0 +1,79 @@
+import React, { useState } from "react";
+import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper";
+import { SessionSubscriptionsWrapper } from "@storyteller/components/src/session/SessionSubscriptionsWrapper";
+import { Button, Container, Panel } from "components/common";
+import { usePrefixedDocumentTitle } from "common/UsePrefixedDocumentTitle";
+import { useHistory, useParams } from "react-router-dom";
+import "./StudioIntro.scss";
+import LoadingSpinner from "components/common/LoadingSpinner";
+import { useMedia } from "hooks";
+import { BucketConfig } from "@storyteller/components/src/api/BucketConfig";
+import { MediaFileType } from "@storyteller/components/src/api/media_files";
+
+interface Props {
+ sessionWrapper: SessionWrapper;
+ sessionSubscriptionsWrapper: SessionSubscriptionsWrapper;
+}
+
+// This page just needs to poll the job and show the video when it's done.
+
+function StudioIntroResultPage(props: Props) {
+ const { jobToken } = useParams<{ jobToken: string }>();
+ const history = useHistory();
+ const [mediaToken, setMediaToken] = useState(
+ "m_f5kp3hm74qeq16eq7536jb73jkbvkh"
+ ); // Set the media token after polling success
+
+ // const [jobExists, setJobExists] = useState
(null);
+
+ const [mediaFile, setMediaFile] = useState();
+
+ useMedia({
+ mediaToken: mediaToken,
+ onSuccess: (res: any) => {
+ setMediaFile(res);
+ },
+ });
+
+ const mediaLink =
+ mediaFile && new BucketConfig().getGcsUrl(mediaFile.public_bucket_path);
+
+ usePrefixedDocumentTitle("Storyteller Studio");
+
+ if (!jobToken) {
+ history.push("/");
+ }
+
+ // Should also check if job actually exists or not
+ //
+ // if (!jobExists) {
+ // history.push("/");
+ // }
+
+ return (
+
+
+ Generation Result
+
+
+
+ {mediaToken ? (
+
+ ) : (
+
+ )}
+
+
+ {mediaToken ? (
+
+
+
+ ) : null}
+
+ );
+}
+
+export { StudioIntroResultPage };
diff --git a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/StudioVSTPage.tsx b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/StudioVSTPage.tsx
index e96a6e9057..4a8f5a0bef 100644
--- a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/StudioVSTPage.tsx
+++ b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/StudioVSTPage.tsx
@@ -13,15 +13,17 @@ import VideoQuickTrim, {
import EnqueueVideoStyleTransfer from "@storyteller/components/src/api/video_styleTransfer";
import { initialValues } from "./defaultValues";
import { mapRequest, VSTType } from "./helpers";
+import LoadingSpinner from "components/common/LoadingSpinner";
// import SectionAdvanceOptions from "./sectionAdvanceOptions";
export default function PageVSTApp() {
- const { jobToken } = useParams();
+ const { jobToken } = useParams<{ jobToken: string }>();
const videoRef = useRef(null);
const history = useHistory();
- const [isLoading, setIsLoading] = useState(false);
- const [mediaToken, setMediaToken] = useState("");
-
+ const [mediaToken, setMediaToken] = useState(
+ "m_wnnz9jey96dwhss9qk1891v9gmvnj8" // Currently hardcoded video media token value. Let a job polling function set the value when job returns media on success.
+ );
+ // const [jobExists, setJobExists] = useState(null);
const [vstValues, setVstValues] = useState({
...initialValues,
fileToken: mediaToken,
@@ -38,7 +40,7 @@ export default function PageVSTApp() {
EnqueueVideoStyleTransfer(request).then(res => {
if (res.success && res.inference_job_token) {
console.log("Job enqueued successfully", res.inference_job_token);
- history.push(`/jobs`); // Adjusted to use a fixed path
+ history.push(`/studio-intro/result/${res.inference_job_token}`);
} else {
console.log("Failed to enqueue job", res);
}
@@ -64,7 +66,7 @@ export default function PageVSTApp() {
}
const styleMap: { [key: string]: string } = {
- Anime: "weight_yqexh77ntqyawzgh9fzash798",
+ Anime: "weight_yqexh77ntqyawzgh9fzash798", // set SD Model Weight Tokens, currently hardcoded all to Anime style
Pixel: "weight_yqexh77ntqyawzgh9fzash798",
Painting: "weight_yqexh77ntqyawzgh9fzash798",
};
@@ -76,37 +78,58 @@ export default function PageVSTApp() {
const styleOptions = Object.keys(styleMap);
+ if (!jobToken) {
+ history.push("/");
+ }
+
+ // Should also check if job actually exists or not
+ //
+ // if (!jobExists) {
+ // history.push("/");
+ // }
+
return (
+
+ Style Your Scene
+
-
+
-
- handleOnChange({
- trimStart: val.trimStartSeconds,
- trimEnd: val.trimEndSeconds,
- })
- }
- />
+ {vstValues.fileToken ? (
+
+ handleOnChange({
+ trimStart: val.trimStartSeconds,
+ trimEnd: val.trimEndSeconds,
+ })
+ }
+ />
+ ) : (
+
+
+
+ )}
-
-
diff --git a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/defaultValues.tsx b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/defaultValues.tsx
index 5296989cda..97fdeaaa14 100644
--- a/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/defaultValues.tsx
+++ b/packages/fakeyou.com/src/v2/view/pages/storyteller_studio_intro/StudioVST/defaultValues.tsx
@@ -21,7 +21,7 @@ const initialValues = {
//basics
inputFps: 24,
- posPrompt: "perfect anime illustration,(best-quality:0.8),",
+ posPrompt: "",
negPrompt: "",
visibility: "private",