Getting Vimeo CurrentTime from within Storyline

Jul 29, 2022

Hi,

I have the code below working to provide me the Vimeo video playing status.

However, I haven't been able to correctly address the player, in order to obtain the current time (in seconds).

The code below shows my current attempt (with the player.on('timeupdate') code. Anyone able to correct that code, so that I can capture the current time as it plays?

Thanks in advance.

Robert

<iframe id="ckpt1" src="https://player.vimeo.com/video/723853740?h=f2ae10a56b&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;" title="AriFirstLoop_Feb.mp4"></iframe>

</div><script src="https://player.vimeo.com/api/player.js">
</script>
<script>

var SLplayer = parent.GetPlayer();
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);

player.on('play', function() {
SLplayer.SetVar("videoStatus","Yes Playing");
SLplayer.SetVar("htmlvartest","RESET");
});

player.on('timeupdate', function(data){
SLplayer.SetVar("Videotime2", seconds);
});


player.on('ended', function() {
SLplayer.SetVar("videoStatus","Ended");
});

 

</script>

11 Replies
Robert Edgar

Thanks, Russell.
However, while the WebObject itself is loading the player and the video,
When I go to a screen to play it, the video is not loading.

I'll take a look at this when I am back at work on Monday morning, and see what's up.

I appreciate your taking the time to offer your suggestion!

Best
Robert

Robert Edgar

Program Manager, Learning Systems Design and Development

Director, Stanford Redwood City Digital Production Studio

Stanford | University Human Resources | Learning Solutions Group

Robert Edgar

Hi Russell,

Yes, the link provides exactly what I need.
However, I didn't receive the attached document, only the link.
Sorry, but could you reattach and resend?
Thanks.

Best
Robert

Robert Edgar

Program Manager, Learning Systems Design and Development

Director, Stanford Redwood City Digital Production Studio

Stanford | University Human Resources | Learning Solutions Group

485 Broadway, University Hall, 3rd Floor, Room U309

Redwood City, CA 94063

Cell: 650-387-5914

rbedgar@stanford.edu

Visit Us Online: Learning Solutions Group

Stay Connected: Cardinal at Work Connect

See Our Studio: https://redwoodcity.stanford.edu/campus-resources/srwc-digital-media-production-studio

Robert Edgar

Perhaps the E-Learning Heroes site is dropping the attachment?
If so, just send it to my email address.

Thanks again,
Robert

Robert Edgar

Program Manager, Learning Systems Design and Development

Director, Stanford Redwood City Digital Production Studio

Stanford | University Human Resources | Learning Solutions Group

rbedgar@stanford.edu

Robert Edgar

Hm. The video isn't playing in the web object screen.

I'll try it from work tomorrow.

My problem may be in my Javascript on my screen, and not in your web object code itself. Obviously you got it working on your site.

I did have the video playing previously, though.

Perhaps attach your .story file?

Robert Edgar

And so it was.
I shouldn't work at home...
Thanks again!

Robert Edgar

Program Manager, Learning Systems Design and Development

Director, Stanford Redwood City Digital Production Studio

Stanford | University Human Resources | Learning Solutions Group

485 Broadway, University Hall, 3rd Floor, Room U309

Redwood City, CA 94063

Cell: 650-387-5914

rbedgar@stanford.edu

Visit Us Online: Learning Solutions Group

Stay Connected: Cardinal at Work Connect

See Our Studio: https://redwoodcity.stanford.edu/campus-resources/srwc-digital-media-production-studio

Robert Edgar

OK. I'm working on a Mac (running Parallels), and suspected that my problem was coming from corrupting the files when I moved them from the Mac OS side to the Parallels side. But that was not the case.

It looks like I had introduced the problem with additional (and unnecessary) JavaScript code I had in other triggers. That and the "data.seconds" correction you gave me.

This opens up--for me--addressing other data through the Vimeo API, too.

This will be a good Monday. 

Best

Robert