caricamento fix video preload
This commit is contained in:
@@ -13,9 +13,10 @@ class MediaLocalVideo extends MediaRenderer{
|
||||
$size = self::$SIZES[$opt["size"]];
|
||||
}
|
||||
|
||||
return '<video width="'.$size["width"].'" height="'.$size["height"].'" preload="auto" controls >'.
|
||||
'<source src="'.$this->getVideoLink($size).'" type="video/'.$this->getExtension().'" >'.
|
||||
'</video>';
|
||||
return '<div style="display:inline-block;" class="videoContainerForImageAppend"><video width="'.$size["width"].'" height="'.$size["height"].'" poster="data:image/gif,AAAA" preload="auto" controls >'.
|
||||
'<source src="'.$this->getVideoLink($size).'" type=\'video/'.$this->getExtension().'; codecs="avc1.4D401E, mp4a.40.2"\'>'.
|
||||
'</video></div>';
|
||||
|
||||
}
|
||||
|
||||
public function render(array $opt = array()){
|
||||
|
||||
@@ -409,7 +409,18 @@ if(sizeof($medias)>0){
|
||||
?>
|
||||
|
||||
$(document).ready(function(event){
|
||||
// $("video").on('loadstart',function (event){
|
||||
// var wid = $(this).innerWidth();
|
||||
// $(".videoContainerForImageAppend").append('<img src="images/loading.gif" class="poster" style="width:'+ wid +'px;background-color:black;"/>')
|
||||
// $(this).hide();
|
||||
// });
|
||||
|
||||
// $("video").on('canplay',function (event){
|
||||
// $(".poster").hide();
|
||||
// $(this).show();
|
||||
// $(this).get(0).play();
|
||||
// });
|
||||
|
||||
$("#submit").click(function (){
|
||||
// $("form#commentoForm").submit(function (){
|
||||
$.ajax({
|
||||
|
||||
@@ -446,3 +446,15 @@ catch (Exception $ex){
|
||||
GUIHandler::generateGoogleAnalyticsScripts();
|
||||
?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("video").on('loadstart',function (event){
|
||||
$(this).addClass("loading");
|
||||
});
|
||||
|
||||
$("video").on('canplay',function (event){
|
||||
$(this).removeClass("loading");
|
||||
$(this).attr('poster','');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -2,4 +2,18 @@ Highcharts.setOptions({
|
||||
global : {
|
||||
useUTC : false
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(event){
|
||||
$("video").on('loadstart',function (event){
|
||||
var wid = $(this).innerWidth();
|
||||
$(".videoContainerForImageAppend").append('<img src="images/loading.gif" class="poster" style="width:'+ wid +'px;background-color:black;"/>')
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
$("video").on('canplay',function (event){
|
||||
$(".poster").hide();
|
||||
$(this).show();
|
||||
// $(this).get(0).play();
|
||||
});
|
||||
});
|
||||
@@ -283,4 +283,18 @@ CATEGORY SUMMARY
|
||||
.middleBanner img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
DISABILITAZIONE TASTO DOWNLOAD DAL PLAYER VIDEO
|
||||
*/
|
||||
|
||||
video::-internal-media-controls-download-button {
|
||||
display:none;
|
||||
}
|
||||
|
||||
video::-webkit-media-controls-enclosure {
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
video.loading{background:black url(../images/loading.gif) center center no-repeat;}
|
||||
@@ -621,4 +621,6 @@ video::-internal-media-controls-download-button {
|
||||
|
||||
video::-webkit-media-controls-enclosure {
|
||||
overflow:hidden;
|
||||
}
|
||||
}
|
||||
|
||||
video.loading{background:yellow url(../images/loading.gif) center center no-repeat;}
|
||||
Reference in New Issue
Block a user