Skip to content

Commit

Permalink
fixed the vimeo embed privacy loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
smntb committed Aug 15, 2024
1 parent 55f6581 commit b5316b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0
3.10.1
8 changes: 4 additions & 4 deletions tmpl/player_vimeo.tmpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
if ($interview->kembed == "" && $interview->media_url != "") {
$height = ($interview->clip_format == 'audio' ? 95 : 350);
$video_id = str_replace('https://vimeo.com/', '', str_replace('http://vimeo.com/', '', $interview->media_url));
$embedcode = '<iframe id="vimeo_widget" src="https://player.vimeo.com/video/' . $video_id . '?color=ffffff&badge=0&portrait=false&title=false&byline=false" width="100%" maxwidth="100%" height="' . $height . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
$embedcode = '<iframe referrerpolicy="strict-origin" id="vimeo_widget" src="https://player.vimeo.com/video/' . $video_id . '?color=ffffff&badge=0&portrait=false&title=false&byline=false" width="100%" maxwidth="100%" height="' . $height . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
} elseif ($interview->kembed != "") {
$embedcode = preg_replace('/\<[\/]{0,1}div[^\>]*\>/i', '', $interview->kembed);
$embedcode = preg_replace('/(width|height)=["\']\d*["\']\s?/', "", $embedcode);
$embedcode = str_replace('<iframe ', '<iframe title="Video Player" id="vimeo_widget"', $embedcode);
$embedcode = str_replace('<iframe ', '<iframe referrerpolicy="strict-origin" title="Video Player" id="vimeo_widget"', $embedcode);
}

if (isset($_GET['time']) && is_numeric($_GET['time'])) {
Expand All @@ -21,10 +21,10 @@
$height = ($interview->clip_format == 'audio' ? 95 : 350);

echo <<<VIMEO
<div class="video embed-responsive embed-responsive-16by9" style="position:relative;width: auto; height: {$height}px;margin-left: auto; margin-right: auto;">
<script src="https://player.vimeo.com/api/player.js"></script>
<div class="video embed-responsive embed-responsive-16by9" style="position:relative;width: auto; height: {$height}px;margin-left: auto; margin-right: auto;">
<p>&nbsp;</p>
{$embedcode}
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
var widget = null;
jQuery(document).ready(function () {
Expand Down

0 comments on commit b5316b1

Please sign in to comment.