Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
frontend
Commits
e90a9b34
Verified
Commit
e90a9b34
authored
1 year ago
by
Dorian Koch
Browse files
Options
Downloads
Patches
Plain Diff
add meta tags to player page
parent
969163ca
No related branches found
No related tags found
1 merge request
!15
Add meta tag and add commit tag to gitlab pipeline
Pipeline
#6152
passed
1 year ago
Stage: test
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/Player.tsx
+12
-0
12 additions, 0 deletions
src/components/Player.tsx
src/pages/_app.tsx
+1
-0
1 addition, 0 deletions
src/pages/_app.tsx
src/pages/dynamic_player.tsx
+2
-1
2 additions, 1 deletion
src/pages/dynamic_player.tsx
with
15 additions
and
1 deletion
src/components/Player.tsx
+
12
−
0
View file @
e90a9b34
...
@@ -30,6 +30,7 @@ import { PlayerData } from "@/pages/dynamic_player";
...
@@ -30,6 +30,7 @@ import { PlayerData } from "@/pages/dynamic_player";
import
{
useLanguage
}
from
"
./LanguageProvider
"
;
import
{
useLanguage
}
from
"
./LanguageProvider
"
;
import
{
StylizedText
}
from
"
./StylizedText
"
;
import
{
StylizedText
}
from
"
./StylizedText
"
;
import
{
ApiError
}
from
"
@/api/ApiError
"
;
import
{
ApiError
}
from
"
@/api/ApiError
"
;
import
Head
from
"
next/head
"
;
function
VideoPlayer
({
lecture
,
className
}:
{
lecture
:
lecture
;
className
?:
string
})
{
function
VideoPlayer
({
lecture
,
className
}:
{
lecture
:
lecture
;
className
?:
string
})
{
const
videoRef
=
useRef
<
HTMLVideoElement
>
(
null
);
const
videoRef
=
useRef
<
HTMLVideoElement
>
(
null
);
...
@@ -610,6 +611,7 @@ export function EmbeddedPlayer({ playerData }: { playerData: ResourceType<Player
...
@@ -610,6 +611,7 @@ export function EmbeddedPlayer({ playerData }: { playerData: ResourceType<Player
export
default
function
Player
({
playerData
}:
{
playerData
:
ResourceType
<
PlayerData
>
})
{
export
default
function
Player
({
playerData
}:
{
playerData
:
ResourceType
<
PlayerData
>
})
{
const
{
course
,
lectureId
,
perms
,
loaderHadUserInfo
}
=
playerData
.
read
()
!
;
const
{
course
,
lectureId
,
perms
,
loaderHadUserInfo
}
=
playerData
.
read
()
!
;
const
api
=
useBackendContext
();
const
userContext
=
useUserContext
();
const
userContext
=
useUserContext
();
const
hasUserInfo
=
userContext
.
hasUserInfo
();
const
hasUserInfo
=
userContext
.
hasUserInfo
();
const
{
language
}
=
useLanguage
();
const
{
language
}
=
useLanguage
();
...
@@ -773,6 +775,16 @@ export default function Player({ playerData }: { playerData: ResourceType<Player
...
@@ -773,6 +775,16 @@ export default function Player({ playerData }: { playerData: ResourceType<Player
return
(
return
(
<>
<>
<
Head
>
<
meta
property
=
"og:title"
content
=
{
`
${
course
.
short_name
}
-
${
lecture
.
title
}
`
}
/>
<
meta
property
=
"og:description"
content
=
{
course
.
description
}
/>
<
meta
property
=
"og:image"
content
=
{
lecture
.
thumbnail_url
??
`
${
api
.
assetUrl
()}
/thumbnail/l_
${
lecture
.
id
}
.jpg`
}
/>
</
Head
>
<
Title
title
=
{
`
${
course
.
short_name
}
-
${
lecture
.
title
}
`
}
/>
<
Title
title
=
{
`
${
course
.
short_name
}
-
${
lecture
.
title
}
`
}
/>
<
div
className
=
"card"
>
<
div
className
=
"card"
>
<
div
className
=
"card-header d-flex"
>
<
div
className
=
"card-header d-flex"
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/_app.tsx
+
1
−
0
View file @
e90a9b34
...
@@ -22,6 +22,7 @@ export default function App({ Component, pageProps }: AppProps) {
...
@@ -22,6 +22,7 @@ export default function App({ Component, pageProps }: AppProps) {
name
=
"commit"
name
=
"commit"
content
=
{
process
.
env
.
NEXT_PUBLIC_GIT_COMMIT_HASH
??
"
unknown
"
}
content
=
{
process
.
env
.
NEXT_PUBLIC_GIT_COMMIT_HASH
??
"
unknown
"
}
/>
/>
<
meta
name
=
"og:site_name"
content
=
"VideoAG"
/>
</
Head
>
</
Head
>
<
Title
title
=
"Video AG"
/>
<
Title
title
=
"Video AG"
/>
<
ReloadBoundary
<
ReloadBoundary
...
...
This diff is collapsed.
Click to expand it.
src/pages/dynamic_player.tsx
+
2
−
1
View file @
e90a9b34
...
@@ -99,7 +99,8 @@ export function ActualRedirector() {
...
@@ -99,7 +99,8 @@ export function ActualRedirector() {
}
}
export
default
function
DynamicPlayer
()
{
export
default
function
DynamicPlayer
()
{
// The following is a hack to force nextjs to not pre-render this page at build time (which obv wouldnt make sense)
// The following is a hack to force nextjs to not pre-render this page at build time
// this needs to be done because it is not known which lecture is going to be watched (this is dynamic!)
const
[
clientsideForcer
,
setClientsideForcer
]
=
useState
(
false
);
const
[
clientsideForcer
,
setClientsideForcer
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setClientsideForcer
(
true
);
setClientsideForcer
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Dorian Koch
@doriank
mentioned in issue
#36 (closed)
·
1 year ago
mentioned in issue
#36 (closed)
mentioned in issue #36
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment