Hi to all,
after a lot of search and test, here are how you can put a youtube video that plays when page loads using java-module and colorbox
so you can use it with mojo version 2.4.0.3 or greater
- create javascript-module
- set true on flag 'add script element Around Raw script
- the raw script position should be: 'in the page, at the position....
- put below code in 'raw script content
==============================================
$(document).ready(function(){
// this is to hide horrible standard video borders
$("#cboxTopLeft").hide();
$("#cboxTopRight").hide();
$("#cboxBottomLeft").hide();
$("#cboxBottomRight").hide();
$("#cboxMiddleLeft").hide();
$("#cboxMiddleRight").hide();
$("#cboxBottomCenter").hide();
// here we link to custom css (described below) overriding standard boxcolor.css
$("#cboxContent").addClass("youtube_border");
// css in custom css:
//.youtube_border {border: thin solid Gray;}
//#cboxTitle{color: Blue; line-height: 10px;}
// parameters and then logic to display video automaticaly
$.colorbox({
iframe : true,
innerWidth : 425,
innerHeight : 344,
opacity : 0.3,
title: "...your title comes here...",
href : "http://www.youtube.com/embed/F2Gzc10cRKE?autoplay=1&rel=0&wmode=transparent"
});
});