Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Video/gif playing

Hi She,

What you mean by "play in background" ?

If you want just to hide the video you can use following JS code instead of yours:

precode

var video = jQuery('<video autoplay loop poster="https:&#47;&#47;s3-us-west-2&#46;amazonaws&#46;com/s&#46;cdpn&#46;io/4273/polina&#46;jpg">id="bgvid" loop<source src="&#47;&#47;demosthenes&#46;info/assets/videos/polina&#46;webm" type="video/webm" /> <source src="&#47;&#47;demosthenes&#46;info/assets/videos/polina&#46;mp4" type="video/mp4" /></video>');

$('div[dsid="mobilecontainer"]')&#46;append(video );
jQuery("video")&#46;css({width: "1px", height: "1px"});

/code/pre

Regards.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Video/gif playing

Hi Yuri,
Thank you for replying, but i just want that video is set as a background of 1 page,
do you think it is posible?

Thank you,
She

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Video/gif playing

You should add z-index for video component. There is an example: http://demosthenes.info/blog/777/Crea...

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Video/gif playing

Hi Sergiy,

as you can see i have a z-index, any other suggestions? hehe

code$('div[dsid="mobilecontainer"')&#46;css(
"video" , "position:fixed",
"top: 50%",
"left: 50%",
"min-width: 100%",
"min-height: 100%",
"width: auto",
"height: auto",
"z-index: -100",
"transform: translateX(-50%) translateY(-50%)",
"background-size: cover",
"transition: 1s opacity"
);/code

Thank you :)

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Video/gif playing

Hi She,

If you want to stop playing you need to use following JS code on event you need(when you navigate to other page):

pre

var videos = jQuery('video');
for(var i = 0; i < videos&#46;length; i++){

Code: Select all

videos[i]&#46;pause(); 

};

/pre

Regards.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Video/gif playing

Hi Yuri,

Thank you for replying, i forget to inform you guys i already figure this out.

Now i have a new problem which is in this topic:
https://getsatisfaction.com/apperyio/...

Thank you very much,
She

Return to “Issues”