Skip to content

Commit

Permalink
Merge pull request #273 from serlo/272-i-want-to-see-real-video
Browse files Browse the repository at this point in the history
replace first video with real content
  • Loading branch information
Entkenntnis authored Jan 21, 2025
2 parents a0b9b7f + 9e40e11 commit 8844073
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/exercise-view/state/exercise-view-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type IExerciseViewStore = {
examplePrescreen: boolean
hasExamplePrescreen: boolean
videoRedirectUrl?: string
videoUrl?: string
}

export const ExerciseViewStore = new Store<IExerciseViewStore>({
Expand Down
1 change: 1 addition & 0 deletions src/components/learning-path/LearningPathMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export function LearningPathMap() {
toHome: true,
}),
)
s.videoUrl = el.source.videoUrl
})
}
history.push('/video')
Expand Down
6 changes: 5 additions & 1 deletion src/components/pages/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ import { ExerciseViewStore } from '../exercise-view/state/exercise-view-store'

export function Video() {
const videoRedirectUrl = ExerciseViewStore.useState(s => s.videoRedirectUrl)
const videoUrl = ExerciseViewStore.useState(s => s.videoUrl)
const history = useHistory()
return (
<IonPage className="sm:max-w-[375px] mx-auto">
<IonContent className="ion-padding">
<div className="flex items-center relative h-full">
<video controls className="w-full" autoPlay>
<source
src="https://resource.flexclip.com/templates/video/720p/cake-food-recipe-social-reels.mp4"
src={
videoUrl ??
'https://resource.flexclip.com/templates/video/720p/cake-food-recipe-social-reels.mp4'
}
type="video/mp4"
/>
</video>
Expand Down
3 changes: 2 additions & 1 deletion src/content/navigations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,8 @@ export const navigationData: { [key: number]: Navigation } = {
{
type: 'video',
title: 'Video 1',
videoUrl: '123',
videoUrl:
'https://testtige.uber.space/testtiger/Zahlen_vergleichen.mp4',
position: { x: 80, y: 170 },
steps: [],
},
Expand Down

0 comments on commit 8844073

Please sign in to comment.