native.newVideo( ) Loop

Hi,

I’m trying to get a video to loop using the new native.newVideo( ).

I’ve tried creating a function to seek to 0 again which works once…

Is there a proper way to loop a movie continuously using native.newVideo( )?

[lua]local v = native.newVideo(130, 130, 150, 150 );
v:load(“jump.m4v”);
v:play();

local function loopVideo( event )
if event.phase == “ended” then
v:seek( 0 )
v:play()
end

if event.phase == “ready” then
v:seek( 0 )
v:play()
end
end

v:addEventListener(“video”, loopVideo)[/lua]

Thanks

[import]uid: 33866 topic_id: 24513 reply_id: 324513[/import]

I am not certain on this but I’ll look into it and get back to you.
[import]uid: 52491 topic_id: 24513 reply_id: 99314[/import]

Ok thanks, also while your there could you confirm setting the x & y of a video is as simple as using video.x = 50 etc. I tried adding a touch listener to my video to move it around but it wouldn’t budge :frowning:

[import]uid: 33866 topic_id: 24513 reply_id: 99346[/import]

Hi,

I’am trying to set the audio volume on a native.newVideo but it won’t react on setting the master volume.

So the user can never turn of, set volume up or down when running the video

Regards,
Freshworks. [import]uid: 2734 topic_id: 24513 reply_id: 99740[/import]

Just wondering if there was any news on the reported problems? It was a bit of a show stopper for me that video objects wouldn’t loop as I had a pretty cool idea of how I could use them.

Just a quick - it won’t happen for a while - would be nice so I can move on with something else :slight_smile:

[import]uid: 33866 topic_id: 24513 reply_id: 100092[/import]

Probably an idea,

  1. Just init a new video
  2. video:play()
  3. Then use the video listener and watch for ended
  4. when ended, remove video, and start at 1)

That should work for endless playing :wink: [import]uid: 2734 topic_id: 24513 reply_id: 100099[/import]

@freshworks if you have a look at the code I added in my first post I did try to catch the “ended” phase and seek to position 0 but this seems to just loop once and then stops… If you can spot a mistake then please post a change as I may have made an error. [import]uid: 33866 topic_id: 24513 reply_id: 100187[/import]

Hey - my apologies, I thought I replied to this yesterday but was having some internet issues and I guess it failed.

@Cl-apps, are you able to file a bug report, please? It only catching it once doesn’t seem right to me. (If you could include a sample project we can just run that would be a huge help.)

Thanks,
Peach :slight_smile: [import]uid: 52491 topic_id: 24513 reply_id: 100259[/import]

Ok, I’ll file a bug report with my project when I get in :slight_smile: [import]uid: 33866 topic_id: 24513 reply_id: 100317[/import]