1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Making the social options appear on embed video

This commit is contained in:
daniel 2017-11-16 14:57:41 -03:00
parent e0415afa2a
commit fd3a5d06d9
6 changed files with 72 additions and 25 deletions

2
.gitignore vendored
View file

@ -13,3 +13,5 @@
/plugin/VideoThumbnails/
/plugin/MP4ThumbsAndGif/
/plugin/VideoLogoOverlay/
/plugin/FloatVideo/
/plugin/ShareSocialButtonsOnEmbed/

View file

@ -14,6 +14,24 @@
<iframe class="embed-responsive-item" src="<?php echo parseVideos($video['videoLink']); if ($config->getAutoplay()) {
echo "?autoplay=1";
} ?>"></iframe>
<?php
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
// the live users plugin
if (YouPHPTubePlugin::isEnabled("0e225f8e-15e2-43d4-8ff7-0cb07c2a2b3b")) {
require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
$style = VideoLogoOverlay::getStyle();
$url = VideoLogoOverlay::getLink();
?>
<div style="<?php echo $style; ?>">
<a href="<?php echo $url; ?>">
<img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png">
</a>
</div>
<?php
}
?>
</div>
</div>
</div>

11
view/include/social.php Normal file
View file

@ -0,0 +1,11 @@
<?php
//set the $url and the $title before include this
$facebookURL = "https://www.facebook.com/sharer.php?u={$url}&title={$title}";
$twitterURL = "http://twitter.com/home?status={$title}+{$url}";
$googleURL = "https://plus.google.com/share?url={$url}";
?>
<ul class="social-network social-circle">
<li><a href="<?php echo $facebookURL; ?>" target="_blank" class="icoFacebook" title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a href="<?php echo $twitterURL; ?>" target="_blank" class="icoTwitter" title="Twitter"><i class="fa fa-twitter"></i></a></li>
<li><a href="<?php echo $googleURL; ?>" target="_blank" class="icoGoogle" title="Google +"><i class="fa fa-google-plus"></i></a></li>
</ul>

View file

@ -12,6 +12,7 @@ var fullDuration = 0;
var isPlayingAd = false;
var mainVideoHeight = 0;
var doNotFloatVideo = false;
String.prototype.stripAccents = function () {
var translate_re = /[àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ]/g;
@ -68,7 +69,7 @@ $(document).ready(function () {
mainVideoHeight = $('#videoContainer').innerHeight();
});
$(window).scroll(function () {
if (changingVideoFloat) {
if (changingVideoFloat || doNotFloatVideo) {
return false;
}
changingVideoFloat = 1;

View file

@ -382,15 +382,8 @@ if (!empty($video)) {
<?php
$url = urlencode($global['webSiteRootURL'] . "{$catLink}video/" . $video['clean_title']);
$title = urlencode($video['title']);
$facebookURL = "https://www.facebook.com/sharer.php?u={$url}&title={$title}";
$twitterURL = "http://twitter.com/home?status={$title}+{$url}";
$googleURL = "https://plus.google.com/share?url={$url}";
include './include/social.php';
?>
<ul class="social-network social-circle">
<li><a href="<?php echo $facebookURL; ?>" target="_blank" class="icoFacebook" title="Facebook"><i class="fa fa-facebook"></i></a></li>
<li><a href="<?php echo $twitterURL; ?>" target="_blank" class="icoTwitter" title="Twitter"><i class="fa fa-twitter"></i></a></li>
<li><a href="<?php echo $googleURL; ?>" target="_blank" class="icoGoogle" title="Google +"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div>
<div class="tab-pane" id="tabEmbeded">
<h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?>:</h4>

View file

@ -1,4 +1,6 @@
<?php
global $isEmbed;
$isEmbed = 1;
require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php';
$video = Video::getVideo();
@ -6,6 +8,7 @@ if (empty($video)) {
die(__("Video not found"));
}
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
/*
* Swap aspect ratio for rotated (vvs) videos
*/
@ -40,6 +43,8 @@ if ($video['type'] !== "audio") {
<link href="<?php echo $global['webSiteRootURL']; ?>js/video.js/video-js.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>css/player.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>css/social.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo $global['webSiteRootURL']; ?>js/jquery-3.2.0.min.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/video.js/video.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-rotatezoom/videojs.zoomrotate.js" type="text/javascript"></script>
@ -58,25 +63,42 @@ if ($video['type'] !== "audio") {
echo "?autoplay=1";
}
?>"></iframe>
<?php
} else if ($video['type'] == "audio" && !file_exists("{$global['systemRootPath']}videos/{$video['filename']}.mp4")) {
?>
<?php
} else if ($video['type'] == "audio" && !file_exists("{$global['systemRootPath']}videos/{$video['filename']}.mp4")) {
?>
<audio controls class="center-block video-js vjs-default-skin vjs-big-play-centered" id="mainAudio" data-setup='{ "fluid": true }'
poster="<?php echo $global['webSiteRootURL']; ?>img/recorder.gif">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.ogg" type="audio/ogg" />
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3" type="audio/mpeg" />
<a href="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $video['filename']; ?>.mp3">horse</a>
</audio>
<?php
} else {
?>
<?php
} else {
?>
<video poster="<?php echo $poster; ?>" controls crossorigin width="auto" height="auto"
class="video-js vjs-default-skin vjs-big-play-centered <?php echo $vjsClass; ?> " id="mainVideo" data-setup='{"fluid": true }'>
<?php
echo getSources($video['filename']);
?>
<?php
echo getSources($video['filename']);
?>
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
</video>
<?php
// the live users plugin
if (YouPHPTubePlugin::isEnabled("0e225f8e-15e2-43d4-8ff7-0cb07c2a2b3b")) {
require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
$style = VideoLogoOverlay::getStyle();
$url = VideoLogoOverlay::getLink();
?>
<div style="<?php echo $style; ?>">
<a href="<?php echo $url; ?>">
<img src="<?php echo $global['webSiteRootURL']; ?>videos/logoOverlay.png">
</a>
</div>
<?php
}
?>
<script>
$(document).ready(function () {
//Prevent HTML5 video from being downloaded (right-click saved)?
@ -85,12 +107,12 @@ if ($video['type'] !== "audio") {
});
});
</script>
<?php
}
?>
<?php
}
?>
</div>
<?php
echo YouPHPTubePlugin::getFooterCode();
?>
<?php
echo YouPHPTubePlugin::getFooterCode();
?>
</body>
</html>