Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions core/components/com_resources/site/assets/css/video.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
overflow: hidden;
}
#video-player {
position: relative;
z-index: 886;
display: block;
margin: 0 auto;
Expand Down Expand Up @@ -429,12 +430,20 @@
filter: alpha(opacity = 95);
background:rgba(0,0,0,0.95);
text-align:left;
display: flex;
flex-direction: column;
justify-content: center;
padding: 10px;
}

#replay > * {
margin: 0 auto;
max-width: 760px;
}


#replay #replay-details {
position:absolute;
top:25%;
left:15%;
width:70%;
width: 100%;
}
#replay-details #title {
font-size:24px;
Expand All @@ -448,7 +457,7 @@
#replay-details #replay-link {
width:100%;
font-size:16px;
padding:3px;
padding:3px 70px 3px 3px;
outline:none;
border:1px solid #000;
background:#FFF;
Expand Down Expand Up @@ -496,9 +505,6 @@
color:#444444;
}
#replay-now {
position:absolute;
top:250px;
right:15%;
background-image: -webkit-gradient(linear, left top, left bottom, from(#41697e), );
background-image: -webkit-linear-gradient(#688b9d, #41697e);
background-image: -moz-linear-gradient(#688b9d, #41697e);
Expand All @@ -507,10 +513,7 @@
background-image:linear-gradient(#688b9d, #41697e);
border:2px solid #3b6479;
color:#ffffff;
}
#replay-now:before {
content: url("../img/hubpresenter/replay.png");
padding:0 10px 0 0;
margin-top: 5px;
}
#replay-back,
#replay-now {
Expand Down
97 changes: 44 additions & 53 deletions core/components/com_resources/site/assets/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ HUB.Video = {

//-----

playPause: function( click )
playPause: function(click)
{
var paused = HUB.Video.isPaused(),
player = HUB.Video.getPlayer();
Expand All @@ -229,13 +229,15 @@ HUB.Video = {
$jQ("#play-pause").removeClass('paused').addClass('playing');
$jQ('#video-container').removeClass('paused');

if( click )
if(click) {
player.play();
}
} else {
$jQ("#play-pause").removeClass('playing').addClass('paused');
$jQ('#video-container').addClass('paused');
if( click )
if(click) {
player.pause();
}
}
},

Expand Down Expand Up @@ -428,21 +430,25 @@ HUB.Video = {
{
var icon = $jQ('#volume');

if(volume == 0)
if(volume == 0) {
icon.removeClass('low medium high')
.addClass('none');
}

if( volume > 0 && volume < 33)
if(volume > 0 && volume < 33) {
icon.removeClass('zero medium high')
.addClass('low');
}

if( volume > 33 && volume < 66)
if(volume > 33 && volume < 66) {
icon.removeClass('zero low high')
.addClass('medium');
}

if( volume > 66)
if(volume > 66) {
icon.removeClass('zero low medium')
.addClass('high');
}
},

//-----
Expand Down Expand Up @@ -610,50 +616,10 @@ HUB.Video = {
// use timeout to allow media to load
setTimeout(function()
{
HUB.Video.playPause(true);
HUB.Video.getPlayer().play();
}, 250);
return;
}

if (!$jQ("#video-container #resume").length)
{
//video container must be position relatively
//$jQ("#video-container").css('position', 'relative');

//build replay content
var resume = "<div id=\"resume\"> \
<div id=\"resume-details\"> \
<h2>Resume Playback?</h2> \
<p>Would you like to resume video playback where you left off last time?</p> \
<div id=\"time\">" + time + "</div> \
</div> \
<a class=\"btn icon-restart\" id=\"restart-video\" href=\"#\">Play from the Beginning</a> \
<a class=\"btn btn-info icon-play\" id=\"resume-video\" href=\"#\">Resume Video</a> \
</div>";

//add replay to video container
$jQ( resume ).hide().appendTo("#video-container").fadeIn("slow");

//restart video button
$jQ("#restart-video").on('click',function(event){
event.preventDefault();
HUB.Video.doReplay("#resume");
});

//resume video button
$jQ("#resume-video").on('click',function(event){
event.preventDefault();
HUB.Video.doResume();
});

//stop clicks on resume
$jQ("#resume").on('click',function(event){
if(event.srcElement.id != 'restart-video' && event.srcElement.id != 'resume-video')
{
event.preventDefault();
}
});
}
},

doResume: function()
Expand Down Expand Up @@ -950,8 +916,9 @@ HUB.Video = {
submit: 1,
onChange: function(hsb,hex,rgb,fromSetColor)
{
if(!fromSetColor)
if(!fromSetColor) {
$jQ('.subtitle-settings-preview .test').css('color', '#' + hex);
}
},
onSubmit: function(hsb,hex,rgb,fromSetColor)
{
Expand All @@ -969,8 +936,9 @@ HUB.Video = {
submit: 1,
onChange: function(hsb,hex,rgb,fromSetColor)
{
if(!fromSetColor)
if(!fromSetColor) {
$jQ('.subtitle-settings-preview .test').css('background-color', '#' + hex);
}
},
onSubmit: function(hsb,hex,rgb,fromSetColor)
{
Expand Down Expand Up @@ -1138,7 +1106,7 @@ HUB.Video = {

//get the sub text
if(parts.length > 3) {
for(i=2,text="";i<parts.length;i++) {
for(i=2, text=""; i<parts.length; i++) {
text += parts[i] + "\n";
}
} else {
Expand Down Expand Up @@ -1454,10 +1422,10 @@ HUB.Video = {
var parts = [],
seconds = 0.0;

if( time ) {
if(time) {
parts = time.split(':');

for( i=0; i < parts.length; i++ ) {
for(i=0; i < parts.length; i++) {
seconds = seconds * 60 + parseFloat(parts[i].replace(',', '.'))
}
}
Expand All @@ -1476,6 +1444,19 @@ HUB.Video = {

//------------------------------------------------------

function iOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
// iPad on iOS 13 detection
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document)
};

var $jQ = jQuery.noConflict();

$jQ(document).ready(function() {
Expand All @@ -1494,6 +1475,16 @@ $jQ(document).ready(function() {
};
}, 2000);
}

if(iOS()) {
var video = document.getElementById('video-player');

// iOS needs it
video.addEventListener("loadedmetadata", function () {
HUB.Video.doneLoading();
HUB.Video.locationHash();
})
}
});


Expand Down
6 changes: 3 additions & 3 deletions core/components/com_resources/site/views/view/tmpl/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
');
?>

<div id="video-container">
<div id="video-container" class="paused">
<?php if (count($presentation->media) > 0) : ?>
<video controls="controls" id="video-player" data-mediaid="<?php echo $this->resource->id; ?>">
<video webkit-playsinline playsinline controls="controls" id="video-player" data-mediaid="<?php echo $this->resource->id; ?>">
<?php foreach ($presentation->media as $video) : ?>
<?php
switch ($video->type)
Expand Down Expand Up @@ -112,7 +112,7 @@
<div id="progress-bar"></div>
<div id="control-buttons">
<div id="control-buttons-left" class="cf">
<a id="play-pause" class="tooltips control" href="javascript:void(0);" title="Play Presentation">Pause</a>
<a id="play-pause" class="tooltips control paused" href="javascript:void(0);" title="Play Presentation">Pause</a>
<div id="media-progress"></div>
</div>
<div id="control-buttons-right" class="cf">
Expand Down