How do I play a video based on a slider

Get help using Construct 2

Post » Tue Jul 28, 2015 2:26 pm

Hi,

I would like to create an effect similar to what is displayed here : http://codepen.io/ollieRogers/pen/lfeLc
i.e. viewing a video based on a slider.

To do so, I created a sliderBar, a video and the following code :
On sliderBar value change -- > set video playtime to sliderBar.value/30

The code works nicely, but in Construct's preview (Chrome) the result can't be used because I have around 1 or 2 frames per second.
My video's weight is about 3M in WebM, and 10 Mb in H.264 Mpeg4. (1280x1080 - 300 frames)
Any idea of what could be wrong and if I can achieve a better result?
Thanks!
B
23
S
5
G
1
Posts: 335
Reputation: 2,406

Post » Tue Jul 28, 2015 4:10 pm

As far as I can tell, all that is doing is set each image as it's own page frame then making the scroll bar unit of movement = 1 page. You might have to break up your movie into a bunch of images and put them on frames in a Sprite in Construct, then do a "On mouse wheel down: Sprite.setFrame(Sprite.currentFrame +1)" and "On mouse wheel up: Sprite.setFrame(Sprite.currentFrame -1)".

I imagine there are plugins or external software that would help you break your movie into a sprite sheet.

Your artwork on Healer Quest is charming too. Almost makes me wish I had a smart phone... but not quite.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Sat Aug 08, 2015 5:53 pm

@gumshoe2029
Thanks a lot for your ideas and sorry for the very late reply.
Actually it is an image sequence from which I made an image sequence. The problem with the image sequence in a sprite is that if I'm correct, these images will be used uncompressed in the code, and thus very very heavy! And there are a lot of them... Around 300 actually, which would make using them as an image sequence in an object impossible. :(

Thanks a lot for your kind words on Healer Quest! The good news is that a PC, Mac and Linux version of Healer Quest is under construction. ;)
B
23
S
5
G
1
Posts: 335
Reputation: 2,406

Post » Mon Aug 10, 2015 6:52 pm

Rable wrote:@gumshoe2029
Thanks a lot for your ideas and sorry for the very late reply.
Actually it is an image sequence from which I made an image sequence. The problem with the image sequence in a sprite is that if I'm correct, these images will be used uncompressed in the code, and thus very very heavy! And there are a lot of them... Around 300 actually, which would make using them as an image sequence in an object impossible. :(


Well, in subsequent research here, I found out that Sprites with frames are stored & used in compressed png sprite sheets with around 6-9 sprite frames per sheet. So, I think your fears may already be mitigated inherently in Construct.

We are displaying around 30,000 to 90,000 sprites simultaneously on one layout with fully dynamic zoom and pan functionality and Construct has performed well so far under these loads. However, phones do not.

Rable wrote:Thanks a lot for your kind words on Healer Quest! The good news is that a PC, Mac and Linux version of Healer Quest is under construction. ;)


You are welcome, and best of skill in your effort.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 7 guests