Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_vimeo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_vimeo
Commits
3f45181e
Commit
3f45181e
authored
3 years ago
by
David Breitling
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] fix certain vimeo videos not loading in glightbox
parent
ad21f8bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
[BUGFIX] fix certain vimeo videos not loading in glightbox
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Controller/VimeoController.php
+13
-0
13 additions, 0 deletions
Classes/Controller/VimeoController.php
with
13 additions
and
0 deletions
Classes/Controller/VimeoController.php
+
13
−
0
View file @
3f45181e
...
...
@@ -54,6 +54,19 @@ class VimeoController extends ActionController {
return
;
}
foreach
(
$response
[
'items'
]
as
&
$item
)
{
/*
* Check if link is of the form "https://vimeo.com/123456789", not "https://vimeo.com/username/videoname".
* Just checks if the end of `link` is the same as `videoId`, and if not, it replaces `link`.
* This is needed as a workaround so that glightbox can detect the video as a vimeo video correctly in the frontend.
*/
$endOfLink
=
substr
(
$item
[
'link'
],
-
strlen
(
$item
[
'videoId'
]));
if
(
!
((
int
)
$endOfLink
===
$item
[
'videoId'
]))
{
$item
[
'link'
]
=
strstr
(
$item
[
'link'
],
'.com/'
,
true
)
.
'.com/'
.
$item
[
'videoId'
];
}
}
$showApiResult
=
(
int
)
(
$this
->
settings
[
'showApiResult'
]
??
1
);
$context
=
GeneralUtility
::
getApplicationContext
();
// disable API debug output in production context
...
...
This diff is collapsed.
Click to expand it.
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