Jump to content

webviewer in a popover, weird timing issue


human

This topic is 727 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a database of audio tracks. The audio files themselves are stored on AWS S3 using cloudfront. The database is a list view, with a popover button on each row. When the popover button is clicked, it shows some additional info and options, and plays it in a little webviewer, which references a cloudfront URL. I have found this to be faster than downloading the file into a container and then playing it with FM's built-in audio controls. And also I prefer the way the controls are shown in the web viewer - I get duration, forward and back, and a slider, for "free". The web viewer references the cloudfront URL, which is set with an "on object enter" trigger, and set to null with an "on object exit" trigger. If the user clicks out of the popover it stops playing the track. If the user clicks the popover on a different row, it stops the previous track and plays the current one. This all works as expected.

Now I'd like to assign keys to have a script to go to the next or previous row, and open the associated popover (by using a "go to object" script step). To my surprise, the audio from the previous track does not stop playing, even though I explicitly set the URL to null in the script. I finally discovered that inserting a 1 second pause (minumum), before opening the next popover, got it to stop playing the previous audio. 

So is this just a quirk of webviewers? is there another explanation?

Edited by human
Link to comment
Share on other sites

  • 8 months later...

In case anyone is interested, I found that a good solution for this is to make an empty layout and switch to it and then back to the original layout. This immediately kills the audio from playing, and happens so fast the user does not notice it.

Link to comment
Share on other sites

This topic is 727 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.