Giter VIP home page Giter VIP logo

gwt-soundmanager2's People

Contributors

rcaloras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gwt-soundmanager2's Issues

Exception thrown on getBytesLoaded() and getBytesTotal()

Calling getBytesLoaded() on an mp3-file shortly after I having created it throws and exception with the following stack trace. The result is also similar if i call getBytesTotal().

java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722) Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.chj.gwt.client.soundmanager2.SMSound::bytesLoaded()': JS value of type null, expected int at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266) at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75) at com.chj.gwt.client.soundmanager2.SMSound.bytesLoaded(SMSound.java) at com.chj.gwt.client.soundmanager2.SMSound.getBytesLoaded(SMSound.java:55)

Code for reproducing:

String id = "music";

m_soundManager.createSound( id, "music.mp3" );
int loaded = m_soundManager.getSoundById(id).getBytesLoaded();

onLoad() and onError() callbacks never called.

Neither onLoad() nor onError() is called when SoundManager has been initialized using the following code. As far as I understand things, one of them should be called.

public class SoundSys {

    //_________________________________________________________________________
    private class OnReady implements Callback {

        private SoundSys        m_parent;

        public OnReady( SoundSys parent ) {
            m_parent = parent;
        }

        public void execute() {
            m_parent.m_bReady = true;
        }
    }

    //_________________________________________________________________________
    private class OnError implements Callback {

        private SoundSys        m_parent;

        public OnError( SoundSys parent ) {
            m_parent = parent;
        }

        public void execute() {
            m_parent.m_bError = true;
        }
    }

    //_________________________________________________________________________

    private SoundManager     m_soundManager = null;
    private boolean          m_bReady = false;
    private boolean          m_bError = false;


    //____ Constructor ________________________________________________________

    public SoundSys() {       

        m_soundManager = SoundManager.getInstance();
        m_soundManager.setUseHtml5Audio(true);

        m_soundManager.onLoad( new OnReady(this) );
        m_soundManager.onError( new OnError(this) );

        m_soundManager.beginDelayedInit();                   
    }
}

Problem with whileLoading(Callback callback) in com.chj.gwt.client.soundmanager2.SoundManager

When i call to this method:
public void whileLoading(Callback callback) {
executeWhileLoading(callback);
}
Throws a JSNI exception because the return value of the next function are undefined and GWT expected a boolean.
private native boolean executeWhileLoading(Callback callback)/-{
$wnd.soundManager.defaultOptions.whileloading = function() {
[email protected]::execute()();
}
}-
/;

I run GWT 2.5.1 and javaJDK-1.7.0_01
I replace boolean for void and the app works.

Greetings.

Error when we set isMovieStar

In the SoundManager.java file there this line that seems to be quite no right (the parameter auto should be used not the isMp4) :

private native void isMovieStar(boolean auto)/-{
$wnd.soundManager.defaultOptions.isMovieStar = isMp4;
}-
/;

I'm actually using the 0.1.3 version.

Can't change the volume

Hi,

When I take a look at your code in the SoundManager.java file we can see there is a missing dot between soundManager and defaultOptions in the setVolume method :

public void volume(int volume) {
setVolume(volume);
}

private native void setVolume(int volume) /-{
$wnd.soundManagerdefaultOptions.volume(volume);
}-
/;

I'm actually using the 0.1.3 version.

Unable to play wav files

Hi
I am unable to play a wav file using SoundManager2 lib.
Here is my code

final String SOUND_ID = "soundId_wav"; final SoundManager sm = SoundManager.getInstance(); sm.beginDelayedInit(); //Play our sound once SoundManager2 has loaded sm.onReady(new com.chj.gwt.client.soundmanager2.Callback(){
        public void execute() {
            sm.play("FR60171", "ftp://uname:pwd@Ip/Path.wav);
        }
    });

I get the following output when i run this piece of code

FR60171: Failed to load? - ftp://uname:pwd@Ip/Path.wav

FR60171: play(): Starting to play

(Flash): auto-play allowed

FR60171: load (ftp://uname:pwd@Ip/Path.wav)

FR60171: play(): Attempting to load

FR60171: Merged options:

soundManager.createSound(): FR60171 ftp://uname:pwd@Ip/Path.wav

soundManager.play(): attempting to create "FR60171"

"FR60171" is an invalid sound ID.

SoundManager 2 loaded (OK)

SoundManager 2 HTML5 support: mp3 = true (preferring flash), mp4 = true (preferring flash), ogg = false (and no flash support), opus = false (and no flash support), wav = false (and no flash support)

SoundManager V2.97a.20130324 (AS2/Flash 8) + HTML5 audio + preferFlash

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.