Giter VIP home page Giter VIP logo

Comments (9)

OJayRobinson avatar OJayRobinson commented on June 23, 2024

Hi, thanks for the feedback. We're not seeing this behavior in our testing. Can you please provide more information.
Specifically, can you include your code and the OS and browser version (for example win 7 IE 9). Thanks.

from soundjs.

 avatar commented on June 23, 2024
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">

    <script src="assets/js/soundjs.min.js"></script>
    <script src="assets/js/swfobject.min.js"></script>
    <script src="assets/js/soundjs.flashplugin.min.js"></script>    
    <script src="assets/js/preloadjs.min.js"></script>

    <script>

      var application = application || {};

      (function(global) {

        application.init = function() {
          console.log('init');

          createjs.FlashPlugin.BASE_PATH = "assets/js/";
          createjs.Sound.registerPlugins([createjs.FlashPlugin]);

          createjs.Sound.activePlugin.showOutput = true;

          var manifest = [
            {id:'test', src:'assets/snd/test.mp3'},
            {id:'test2', src:'assets/snd/test2.mp3'},
          ];

          application.preloader = new createjs.LoadQueue();
          application.preloader.installPlugin(createjs.Sound);
          application.preloader.addEventListener("complete", application.preloadOnComplete);
          application.preloader.addEventListener("error", application.preloadOnError);
          application.preloader.loadManifest(manifest);
        }

        application.preloadOnComplete = function(event) {
          console.log('complete');

          createjs.Sound.play('test');
          createjs.Sound.play('test2');
        }

        application.preloadOnError = function(event) {
          console.log('error');
        }

      }(this));    

    </script>
  </head>

  <body onload="application.init();"></body>
</html>

from soundjs.

 avatar commented on June 23, 2024

Tested on two machines with same result:

  • Windows XP, Firefox 16, latest Chrome
  • Windows 7, Firefox 19, latest Chrome, IE 10

from soundjs.

OJayRobinson avatar OJayRobinson commented on June 23, 2024

Ok, I have a solution for you. You have to make sure that the FlashAudioPlugin.swf file in the directory you set for createjs.FlashPlugin.BASE_PATH. When I had this incorrect, I saw the same behavior you described.

Some other notes:
I have no idea which versions you are using given your imports. My testing was with the NEXT versions of SoundJS and PreloadJS.

The swfobject is compiled into our flashplugin-NEXT.min.js file, so you do not need to include it separately.

The last object in your manifest should not have a comma on the end.

Hope that helps.

from soundjs.

lannymcnie avatar lannymcnie commented on June 23, 2024

One other note - we committed the latest FlashPlugin with the wrong name - so the one you were including was out of date. I have fixed the naming issue, so the soundjs.flashplugin-NEXT.min.js is up to date now.

from soundjs.

 avatar commented on June 23, 2024

Ok, i have fixed small mistakes and update libs. But this is not solution for me, not in this case. Look at reworked code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">

    <script src="soundjs-NEXT.min.js"></script>
    <script src="soundjs.flashplugin-NEXT.min.js"></script>    
    <script src="preloadjs-NEXT.min.js"></script>

    <script>

      var application = application || {};

      (function(global) {

        application.init = function() {
          console.log('init');

          createjs.FlashPlugin.BASE_PATH = '';
          createjs.Sound.registerPlugins([createjs.FlashPlugin]);

          createjs.Sound.activePlugin.showOutput = true;

          var manifest = [
            {id:'test', src:'test.mp3'},
            {id:'test2', src:'test2.mp3'}
          ];

          application.preloader = new createjs.LoadQueue();
          application.preloader.installPlugin(createjs.Sound);
          application.preloader.addEventListener("complete", application.preloadOnComplete);
          application.preloader.addEventListener("error", application.preloadOnError);
          application.preloader.loadManifest(manifest);
        }

        application.preloadOnComplete = function(event) {
          console.log('complete');

          createjs.Sound.play('test');
          createjs.Sound.play('test2');
        }

        application.preloadOnError = function(event) {
          console.log('error');
        }

      }(this));    

    </script>
  </head>

  <body onload="application.init();"></body>
</html>

and at log:

[00:53:01.597] GET http://localhost/test/ [HTTP/1.1 200 OK 2мс]
[00:53:01.598] GET http://localhost/test/soundjs-NEXT.min.js [HTTP/1.1 200 OK 2мс]
[00:53:01.599] GET http://localhost/test/soundjs.flashplugin-NEXT.min.js [HTTP/1.1 200 OK 3мс]
[00:53:01.599] GET http://localhost/test/preloadjs-NEXT.min.js [HTTP/1.1 200 OK 6мс]
[00:53:01.657] init
[00:53:01.785] GET http://localhost/test/FlashAudioPlugin.swf [HTTP/1.1 200 OK 2мс]
[00:53:01.821] Register test.mp3
[00:53:01.834] Register test2.mp3
--
[00:53:09.659] error
[00:53:09.764] GET http://localhost/test/test2.mp3 [HTTP/1.1 200 OK 1мс]
[00:53:09.723] Preload Complete p0
--
[00:53:17.679] error
[00:53:17.680] complete
[00:53:17.685] Play Sound s1 test.mp3 o: 0 l: 0 v: 1 p: 0 mv: 1
[00:53:17.689] Play Sound s2 test2.mp3 o: 0 l: 0 v: 1 p: 0 mv: 1
[00:53:17.785] GET http://localhost/test/test.mp3 [HTTP/1.1 200 OK 0мс]
[00:53:17.785] GET http://localhost/test/test2.mp3 [HTTP/1.1 200 OK 1мс]
[00:53:18.104] Complete s2 Remaining: 1
[00:53:18.363] Complete s1 Remaining: 0

All files loaded correctly, but delays and errors still exists.

from soundjs.

OJayRobinson avatar OJayRobinson commented on June 23, 2024

Thanks for your bug report, we are seeing the same errors and tracking them down is proving to be difficult. We'll continue working on it but wanted to let you know. One note, oddly changing the order of our sound files fixed the problem for html audio, but not for Flash audio.

from soundjs.

OJayRobinson avatar OJayRobinson commented on June 23, 2024

Awesome news, the issue has been tracked down and resolved and the fix has been pushed to the NEXT version on github!

Thanks for finding and reporting this issue. It turned out to be an issue with how tags we use for loading were handled between SoundJS and PreloadJS. And solving this found a couple of other related issues that were resolved. So thanks and I hope the fix helps you.

from soundjs.

 avatar commented on June 23, 2024

Everything works fine now. Thanks a lot.

from soundjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.