Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
ab4001aa
Verified
Commit
ab4001aa
authored
Oct 22, 2021
by
Chocobozzz
Browse files
Provide origin URL to client and fix remote share
parent
de7f1114
Changes
7
Hide whitespace changes
Inline
Side-by-side
client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
View file @
ab4001aa
...
...
@@ -12,7 +12,7 @@
<a
i18n-title
title=
"Open the video on the origin instance"
class=
"glyphicon glyphicon-new-window"
target=
"_blank"
rel=
"noopener noreferrer"
[href]=
"
getVideoUrl()
"
target=
"_blank"
rel=
"noopener noreferrer"
[href]=
"
video.url
"
></a>
</div>
...
...
client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
View file @
ab4001aa
...
...
@@ -9,14 +9,6 @@ import { VideoDetails } from '@app/shared/shared-main'
export
class
VideoAttributesComponent
{
@
Input
()
video
:
VideoDetails
getVideoUrl
()
{
if
(
!
this
.
video
.
url
)
{
return
this
.
video
.
originInstanceUrl
+
VideoDetails
.
buildWatchUrl
(
this
.
video
)
}
return
this
.
video
.
url
}
getVideoHost
()
{
return
this
.
video
.
channel
.
host
}
...
...
client/src/app/shared/shared-main/video/video.model.ts
View file @
ab4001aa
...
...
@@ -52,7 +52,7 @@ export class Video implements VideoServerModel {
embedPath
:
string
embedUrl
:
string
url
?
:
string
url
:
string
views
:
number
likes
:
number
...
...
client/src/app/shared/shared-share-modal/video-share.component.ts
View file @
ab4001aa
...
...
@@ -96,12 +96,12 @@ export class VideoShareComponent {
}
getVideoUrl
()
{
const
baseU
rl
=
this
.
customizations
.
originUrl
?
this
.
video
.
originInstanceU
rl
:
window
.
location
.
origin
const
u
rl
=
this
.
customizations
.
originUrl
?
this
.
video
.
u
rl
:
buildVideoLink
(
this
.
video
,
window
.
location
.
origin
)
return
decorateVideoLink
({
url
:
buildVideoLink
(
this
.
video
,
baseUrl
)
,
url
,
...
this
.
getVideoOptions
()
})
...
...
server/models/video/formatter/video-format-utils.ts
View file @
ab4001aa
...
...
@@ -50,6 +50,8 @@ function videoModelToFormattedJSON (video: MVideoFormattable, options?: VideoFor
uuid
:
video
.
uuid
,
shortUUID
:
uuidToShort
(
video
.
uuid
),
url
:
video
.
url
,
name
:
video
.
name
,
category
:
{
id
:
video
.
category
,
...
...
shared/extra-utils/videos/videos.ts
View file @
ab4001aa
...
...
@@ -113,7 +113,7 @@ async function completeVideoCheck (
channel
:
{
displayName
:
string
name
:
string
description
description
:
string
isLocal
:
boolean
}
fixture
:
string
...
...
@@ -151,6 +151,7 @@ async function completeVideoCheck (
expect
(
video
.
dislikes
).
to
.
equal
(
attributes
.
dislikes
)
expect
(
video
.
isLocal
).
to
.
equal
(
attributes
.
isLocal
)
expect
(
video
.
duration
).
to
.
equal
(
attributes
.
duration
)
expect
(
video
.
url
).
to
.
contain
(
originHost
)
expect
(
dateIsValid
(
video
.
createdAt
)).
to
.
be
.
true
expect
(
dateIsValid
(
video
.
publishedAt
)).
to
.
be
.
true
expect
(
dateIsValid
(
video
.
updatedAt
)).
to
.
be
.
true
...
...
shared/models/videos/video.model.ts
View file @
ab4001aa
...
...
@@ -36,8 +36,7 @@ export interface Video {
embedPath
:
string
embedUrl
?:
string
// When using the search index
url
?:
string
url
:
string
views
:
number
likes
:
number
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment