Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Making progress bar #51

Open
sancel22 opened this issue Apr 3, 2015 · 5 comments
Open

[Help] Making progress bar #51

sancel22 opened this issue Apr 3, 2015 · 5 comments

Comments

@sancel22
Copy link

sancel22 commented Apr 3, 2015

Hi can someone help show some snippets for displaying progress bar while uploading the recording. My recording takes up to 10mins long and it also takes time to upload in on the server. So it might help if I can have working progress bar to display while uploading is on progress. Thank you

@michalstocki
Copy link
Owner

What method of uploading do you use? Click on 'upload' button of embedded .swf object or upload via Javascritpt XHR?

@sancel22
Copy link
Author

sancel22 commented Apr 3, 2015

Hi @michalstocki thanks for your reply, I'm just using the embedded .swf object.

@michalstocki
Copy link
Owner

try something like that:

<style>
    .progress-bar {
        width: 150px;
        height: 20px;
        postion: relative;
    }

    .progress-bar .progress {
        height: 100%;
        width: 0;
        background-color: green;
        position: absolute;
        left: 0;
        top: 0;
    }
</style>

<div class="progress-bar">
    <div class="progress"></div>
</div>

and in javascript:

  window.fwr_event_handler = function fwr_event_handler() {
    var name;
    switch (arguments[0]) {
      // ...
      case "save_progress":
        name = arguments[1];
        var bytesLoaded = arguments[2];
        var bytesTotal = arguments[3];
        var percentageProgress = bytesLoaded / bytesTotal * 100;
        $('.progress').css({width: percentageProgress + '%'});
        break;
    }
  };

@sancel22
Copy link
Author

sancel22 commented Apr 3, 2015

Hi @michalstocki

Here's status on my case

When I pressed upload button, my last event was saving and it will stay there while upload is ongoing, and once it's done uploading the file that's the only time save_progress was triggered and will display my test log saving progress filename.wav 26 / 26. That's the reason why my progress bar won't work, coz seems like in my case save_progress was triggered when everything was done.

Thanks

@michalstocki
Copy link
Owner

Ok. It seems that something is broken. I need more time to investigate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants