Skip to content

Commit

Permalink
fix(plugin-video): remove isTempFile check from static renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
elbotho committed Dec 19, 2024
1 parent cca4903 commit eca9004
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isTempFile } from '@editor/plugin'
import { parseVideoUrl, VideoType } from '@editor/plugins/video/renderer'
import { VideoStaticRenderer } from '@editor/plugins/video/static'
import { EditorVideoDocument } from '@editor/types/editor-plugins'
Expand All @@ -16,7 +15,7 @@ const PrivacyWrapper = dynamic<PrivacyWrapperProps>(() =>

export function VideoSerloStaticRenderer(props: EditorVideoDocument) {
const { src } = props.state
if (!src || isTempFile(src)) return null
if (!src) return null
const [iframeSrc, type] = parseVideoUrl(src)

if (type === VideoType.SerloAsset) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isTempFile } from '@editor/plugin/upload'
import { EditorInteractiveVideoDocument } from '@editor/types/editor-plugins'
import { isVideoDocument } from '@editor/types/plugin-type-guards'
import { useState } from 'react'
Expand Down Expand Up @@ -27,10 +26,7 @@ export function InteractiveVideoStaticRenderer({
setShowOverlayContentIndex(index)
}

const videoSrc =
isVideoDocument(video) && !isTempFile(video.state.src)
? video.state.src
: ''
const videoSrc = isVideoDocument(video) ? video.state.src : ''

return (
<InteractiveVideoRenderer
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/types/editor-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export interface EditorTextDocument {
}
export interface EditorVideoDocument {
plugin: EditorPluginType.Video
state: PrettyStaticState<VideoPluginState>
state: PrettyStaticState<VideoPluginState> & { src: string }
id?: string
}
export interface EditorAudioDocument {
Expand Down

0 comments on commit eca9004

Please sign in to comment.