PDA

View Full Version : Video in Carousel



ludm
22 Jun 2010, 7:52 AM
I've tried to put a video in the Carousel but it doesn't work, is it normal?

Here is my code :


items: [{
title: 'Tab 1',
html: <div><video width="640" height="360" src="http://www.youtube.com/demo/google_main.mp4" controls autobuffer>

</video></div>
}, {
...

aw1zard2
22 Jun 2010, 8:22 AM
I've tried to put a video in the Carousel but it doesn't work, is it normal?

Here is my code :


items: [{
title: 'Tab 1',
html: '<div><video width="640" height="360" src="http://www.youtube.com/demo/google_main.mp4" controls autobuffer></video></div>'
}, {
...


If you copied and pasted this your missing the ' ' on the html: line. I marked the ' in red for what is missing. :)

ludm
23 Jun 2010, 12:47 AM
:-| It's just a copy and paste mistake, I had the '', so it doesn't come from here

Foggy
23 Jun 2010, 6:52 AM
you cant have newlines in a js string...

ludm
23 Jun 2010, 7:05 AM
:s Oups, it's ok now, you were right I had a new line.

Thank you for your help, now I have to see how to stop the video when i go to the next slide in the carousel. ;)

TommyMaintz
24 Jun 2010, 10:42 AM
You can call the stop() method on the video tag inside the deactivate event fired on the card that contains the video.

caseybecking
29 Jul 2010, 10:27 AM
Can you give a code example because mine does not seem to be working.


listeners: {
cardswitch: function(){
video.stop();
}
},

ludm
30 Mar 2011, 1:11 PM
var myTab= new Ext.TabPanel({
cardSwitchAnimation : 'fade',
items:[carrousel_4,videoPanel],
listeners : {
cardswitch : function() {
// you have to put id="myVideo" in the <video><video/> element
var mavideo = document.getElementById("myVideo");
mavideo.pause();
}
}