1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +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/VideoThumbnails/
/plugin/MP4ThumbsAndGif/ /plugin/MP4ThumbsAndGif/
/plugin/VideoLogoOverlay/ /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()) { <iframe class="embed-responsive-item" src="<?php echo parseVideos($video['videoLink']); if ($config->getAutoplay()) {
echo "?autoplay=1"; echo "?autoplay=1";
} ?>"></iframe> } ?>"></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> </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 isPlayingAd = false;
var mainVideoHeight = 0; var mainVideoHeight = 0;
var doNotFloatVideo = false;
String.prototype.stripAccents = function () { String.prototype.stripAccents = function () {
var translate_re = /[àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ]/g; var translate_re = /[àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ]/g;
@ -68,7 +69,7 @@ $(document).ready(function () {
mainVideoHeight = $('#videoContainer').innerHeight(); mainVideoHeight = $('#videoContainer').innerHeight();
}); });
$(window).scroll(function () { $(window).scroll(function () {
if (changingVideoFloat) { if (changingVideoFloat || doNotFloatVideo) {
return false; return false;
} }
changingVideoFloat = 1; changingVideoFloat = 1;

View file

@ -382,15 +382,8 @@ if (!empty($video)) {
<?php <?php
$url = urlencode($global['webSiteRootURL'] . "{$catLink}video/" . $video['clean_title']); $url = urlencode($global['webSiteRootURL'] . "{$catLink}video/" . $video['clean_title']);
$title = urlencode($video['title']); $title = urlencode($video['title']);
$facebookURL = "https://www.facebook.com/sharer.php?u={$url}&title={$title}"; include './include/social.php';
$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>
</div> </div>
<div class="tab-pane" id="tabEmbeded"> <div class="tab-pane" id="tabEmbeded">
<h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?>:</h4> <h4><span class="glyphicon glyphicon-share"></span> <?php echo __("Share Video"); ?>:</h4>

View file

@ -1,4 +1,6 @@
<?php <?php
global $isEmbed;
$isEmbed = 1;
require_once '../videos/configuration.php'; require_once '../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/video.php';
$video = Video::getVideo(); $video = Video::getVideo();
@ -6,6 +8,7 @@ if (empty($video)) {
die(__("Video not found")); die(__("Video not found"));
} }
require_once $global['systemRootPath'] . 'plugin/YouPHPTubePlugin.php';
/* /*
* Swap aspect ratio for rotated (vvs) videos * 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']; ?>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/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/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/video.js/video.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-rotatezoom/videojs.zoomrotate.js" type="text/javascript"></script> <script src="<?php echo $global['webSiteRootURL']; ?>js/videojs-rotatezoom/videojs.zoomrotate.js" type="text/javascript"></script>
@ -77,6 +82,23 @@ if ($video['type'] !== "audio") {
?> ?>
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p> <p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
</video> </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> <script>
$(document).ready(function () { $(document).ready(function () {
//Prevent HTML5 video from being downloaded (right-click saved)? //Prevent HTML5 video from being downloaded (right-click saved)?