youtube video play automatically with java module

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
5/20/2014 7:17:41 AM
Gravatar
Total Posts 122

youtube video play automatically with java module

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"
  });
});

 

5/21/2014 5:14:41 AM
Gravatar
Total Posts 122

Re: youtube video play automatically with java module

please note (wrote by Joe)  that the main colorbox script is only loaded if there is a known feature on the page that needs it, the feature will enable it by server side code. Mojo uses colorbox for the admin file manager link so it is loaded when you are logged in as admin.

If you want to always load colorbox script then in layout.master put IncludeColorBox="true" on the <portal:ScriptLoader

You must sign in to post in the forums. This thread is closed to new posts.