added custom video overlay player to avoid to load all the iframe systematicly
This commit is contained in:
@@ -289,15 +289,14 @@ function clameurs_field_default_field_instances() {
|
|||||||
'display' => array(
|
'display' => array(
|
||||||
'accueil' => array(
|
'accueil' => array(
|
||||||
'label' => 'hidden',
|
'label' => 'hidden',
|
||||||
'module' => 'video_embed_field_overlay',
|
'module' => 'video_embed_field',
|
||||||
'settings' => array(
|
'settings' => array(
|
||||||
'description' => 1,
|
'description' => 1,
|
||||||
|
'description_position' => 'bottom',
|
||||||
|
'image_link' => 'source',
|
||||||
'image_style' => 'video_thumb_docu',
|
'image_style' => 'video_thumb_docu',
|
||||||
'overlay' => 'dom-window',
|
|
||||||
'show_thumbnail' => 1,
|
|
||||||
'video_style' => 'normal',
|
|
||||||
),
|
),
|
||||||
'type' => 'video_embed_field_overlay',
|
'type' => 'video_embed_field_thumbnail',
|
||||||
'weight' => 5,
|
'weight' => 5,
|
||||||
),
|
),
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@@ -457,15 +456,14 @@ function clameurs_field_default_field_instances() {
|
|||||||
'display' => array(
|
'display' => array(
|
||||||
'accueil' => array(
|
'accueil' => array(
|
||||||
'label' => 'hidden',
|
'label' => 'hidden',
|
||||||
'module' => 'video_embed_field_overlay',
|
'module' => 'video_embed_field',
|
||||||
'settings' => array(
|
'settings' => array(
|
||||||
'description' => 1,
|
'description' => 1,
|
||||||
|
'description_position' => 'bottom',
|
||||||
|
'image_link' => 'source',
|
||||||
'image_style' => 'video_thumb_episode',
|
'image_style' => 'video_thumb_episode',
|
||||||
'overlay' => 'dom-window',
|
|
||||||
'show_thumbnail' => 1,
|
|
||||||
'video_style' => 'normal',
|
|
||||||
),
|
),
|
||||||
'type' => 'video_embed_field_overlay',
|
'type' => 'video_embed_field_thumbnail',
|
||||||
'weight' => 9,
|
'weight' => 9,
|
||||||
),
|
),
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@@ -893,15 +891,14 @@ function clameurs_field_default_field_instances() {
|
|||||||
'display' => array(
|
'display' => array(
|
||||||
'accueil' => array(
|
'accueil' => array(
|
||||||
'label' => 'hidden',
|
'label' => 'hidden',
|
||||||
'module' => 'video_embed_field_overlay',
|
'module' => 'video_embed_field',
|
||||||
'settings' => array(
|
'settings' => array(
|
||||||
'description' => 1,
|
'description' => 1,
|
||||||
|
'description_position' => 'bottom',
|
||||||
|
'image_link' => 'source',
|
||||||
'image_style' => 'video_thumb_themat',
|
'image_style' => 'video_thumb_themat',
|
||||||
'overlay' => 'dom-window',
|
|
||||||
'show_thumbnail' => 1,
|
|
||||||
'video_style' => 'normal',
|
|
||||||
),
|
),
|
||||||
'type' => 'video_embed_field_overlay',
|
'type' => 'video_embed_field_thumbnail',
|
||||||
'weight' => 8,
|
'weight' => 8,
|
||||||
),
|
),
|
||||||
'default' => array(
|
'default' => array(
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ name = Clameurs Mod
|
|||||||
description = module for clameurs website
|
description = module for clameurs website
|
||||||
core = 7.x
|
core = 7.x
|
||||||
package = "Clameurs"
|
package = "Clameurs"
|
||||||
dependencies[] = panels
|
dependencies[] = video_embed_field
|
||||||
|
dependencies[] = domwindow
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
(function($) {
|
||||||
|
|
||||||
|
Clameurs = function(){
|
||||||
|
|
||||||
|
function init(){
|
||||||
|
console.log("Clameurs");
|
||||||
|
initVideoEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
function initVideoEvents(){
|
||||||
|
|
||||||
|
$('.field-type-video-embed-field a').on('click', clickVideo);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
function clickVideo(event){
|
||||||
|
event.preventDefault();
|
||||||
|
console.log('Click video', this);
|
||||||
|
var vid_src = $(this).attr('href');
|
||||||
|
console.log("vid_src", vid_src);
|
||||||
|
getEmVidField(vid_src);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
function getEmVidField(src){
|
||||||
|
$.getJSON('clameursmod/getemvidfield',
|
||||||
|
{'src':src},
|
||||||
|
function(json){
|
||||||
|
console.log("json loaded", json);
|
||||||
|
displayVid(json)
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function displayVid(json){
|
||||||
|
$('#videoframe').remove();
|
||||||
|
|
||||||
|
$vid = $('<div>')
|
||||||
|
.attr('id', 'videoframe')
|
||||||
|
.append(json.embed)
|
||||||
|
.hide()
|
||||||
|
.appendTo('body');
|
||||||
|
|
||||||
|
var iframe = $('iframe', $vid)[0];
|
||||||
|
|
||||||
|
var winwidth = $(window).width();
|
||||||
|
var winheight = $(window).height();
|
||||||
|
console.log('win :'+winwidth+' | '+winheight);
|
||||||
|
|
||||||
|
if (winwidth > winheight) {
|
||||||
|
var w = winwidth*0.9;
|
||||||
|
var h = w*(360/640);
|
||||||
|
}else{
|
||||||
|
var h = winheight*0.9;
|
||||||
|
var w = h*(640/360);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('win :'+w+' | '+h);
|
||||||
|
|
||||||
|
$.openDOMWindow({
|
||||||
|
loader:0,
|
||||||
|
windowPadding:10,
|
||||||
|
overlay:1,
|
||||||
|
overlayColor:'#fff',
|
||||||
|
overlayOpacity:'90',
|
||||||
|
borderColor:'transparent',
|
||||||
|
borderSize:'0',
|
||||||
|
width:w,
|
||||||
|
height:h,
|
||||||
|
windowSourceID:"#videoframe"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
var clameurs = new Clameurs();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
@@ -1,21 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_init().
|
||||||
|
*/
|
||||||
|
function clameursmod_init() {
|
||||||
|
if ($path = libraries_get_path('jquery.domwindow')) {
|
||||||
|
// Do something with the library, knowing the path, for instance:
|
||||||
|
drupal_add_js($path . '/jquery.DOMWindow.js');
|
||||||
|
}
|
||||||
|
drupal_add_js(drupal_get_path('module', 'clameursmod').'/clameursmod.js');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_menu().
|
* Implements hook_menu().
|
||||||
*/
|
*/
|
||||||
// function clameursmod_menu() {
|
function clameursmod_menu() {
|
||||||
// $items['accueil'] = array(
|
|
||||||
// 'title' => '',
|
$items['clameursmod/getemvidfield'] = array(
|
||||||
// 'page callback' => '',
|
'page callback' => '_clameursmod_getemvidfield',
|
||||||
// 'page arguments' => array(),
|
'page arguments' => array(),
|
||||||
// 'access arguments' => array(''),
|
'access callback' => TRUE,
|
||||||
// 'type' => ,
|
'type' => MENU_CALLBACK,
|
||||||
// 'file' => ,
|
// 'file' => ,
|
||||||
// );
|
);
|
||||||
//
|
|
||||||
// return $items;
|
return $items;
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
function _clameursmod_getemvidfield(){
|
||||||
|
$data = array();
|
||||||
|
$data['test'] = "OK";
|
||||||
|
$data['src'] = $_GET['src'];
|
||||||
|
|
||||||
|
$data['embed'] = theme('video_embed_field_embed_code', array('url'=>$data['src']));
|
||||||
|
|
||||||
|
drupal_json_output($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_entity_info_alter().
|
* Implements hook_entity_info_alter().
|
||||||
|
|||||||
@@ -289,8 +289,9 @@ input {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
background-color: rgba(255, 255, 255, 0.9); }
|
background-color: rgba(255, 255, 255, 0.9); }
|
||||||
|
|
||||||
#DOMWindowOverlay {
|
#DOMWindow .embedded-video, #DOMWindow .player, #DOMWindow iframe {
|
||||||
background-color: #fff !important; }
|
width: 100%;
|
||||||
|
height: 100%; }
|
||||||
|
|
||||||
#footer-bottom {
|
#footer-bottom {
|
||||||
text-align: center; }
|
text-align: center; }
|
||||||
|
|||||||
@@ -360,11 +360,14 @@ body{
|
|||||||
}
|
}
|
||||||
|
|
||||||
#DOMWindowOverlay{
|
#DOMWindowOverlay{
|
||||||
background-color: #fff!important;
|
// background-color: #fff!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#DOMWindow{
|
#DOMWindow{
|
||||||
|
.embedded-video, .player ,iframe{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer{
|
#footer{
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Drupal.behaviors.init_theme=function(context){$('#messages-and-help > div.messages:not(.processed)').addClass('processed').each(function(){if($('a',this).size()||$(this).is('.error')||$(this).is('.warning')||$(this).text().length>100){$(this).prepend("<span class='close'>X</span>");$('span.close',this).click(function(){$(this).parent().slideUp('fast');});}
|
(function($){Drupal.behaviors.init_theme=function(context){$('#messages-and-help > div.messages:not(.processed)').addClass('processed').each(function(){if($('a',this).size()||$(this).is('.error')||$(this).is('.warning')||$(this).text().length>100){$(this).prepend("<span class='close'>X</span>");$('span.close',this).click(function(){$(this).parent().slideUp('fast');});}
|
||||||
else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};
|
else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};})(jQuery);
|
||||||
@@ -1,27 +1,29 @@
|
|||||||
|
(function($) {
|
||||||
// @codekit-prepend "gui.js"
|
|
||||||
|
|
||||||
|
|
||||||
Drupal.behaviors.init_theme = function (context) {
|
Drupal.behaviors.init_theme = function (context) {
|
||||||
// Growl-style system messages
|
// Growl-style system messages
|
||||||
$('#messages-and-help > div.messages:not(.processed)')
|
$('#messages-and-help > div.messages:not(.processed)')
|
||||||
.addClass('processed')
|
.addClass('processed')
|
||||||
.each(function() {
|
.each(function() {
|
||||||
// If a message meets these criteria, we don't autoclose
|
// If a message meets these criteria, we don't autoclose
|
||||||
// - contains a link
|
// - contains a link
|
||||||
// - is an error or warning
|
// - is an error or warning
|
||||||
// - contains a lenghthy amount of text
|
// - contains a lenghthy amount of text
|
||||||
if ($('a', this).size() || $(this).is('.error') || $(this).is('.warning') || $(this).text().length > 100) {
|
if ($('a', this).size() || $(this).is('.error') || $(this).is('.warning') || $(this).text().length > 100) {
|
||||||
$(this).prepend("<span class='close'>X</span>");
|
$(this).prepend("<span class='close'>X</span>");
|
||||||
$('span.close', this).click(function() {
|
$('span.close', this).click(function() {
|
||||||
$(this).parent().slideUp('fast');
|
$(this).parent().slideUp('fast');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// This essentially adds a 3 second pause before hiding the message.
|
// This essentially adds a 3 second pause before hiding the message.
|
||||||
$(this).animate({opacity:1}, 5000, 'linear', function() {
|
$(this).animate({opacity:1}, 5000, 'linear', function() {
|
||||||
$(this).slideUp('fast');
|
$(this).slideUp('fast');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
column css
|
||||||
|
nothing need
|
||||||
|
*/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
// Plugin definition.
|
// Plugin definition.
|
||||||
$plugin = array(
|
$plugin = array(
|
||||||
'title' => t('Column'),
|
'title' => t('1 Column clameur'),
|
||||||
'category' => t('Columns: 1'),
|
'category' => t('Columns: 1'),
|
||||||
'icon' => 'column.png',
|
'icon' => 'column.png',
|
||||||
'theme' => 'panels_column',
|
'theme' => 'panels_column',
|
||||||
|
|||||||
Reference in New Issue
Block a user