To try out the new Version, I run this line:

To try out the new Version, I run this line:

LL.bindClass(android.media.MediaPlayer);

I keep getting an “android”-is-not-defined-Error

Pierre Hébert what is wrong with it?

]]>

13 Commentsto To try out the new Version, I run this line:

  1. Anonymous says:

    < ![CDATA[

    you forgot the quotes !!!!

    ]]>

  2. Anonymous says:

    < ![CDATA[

    You’re right, with quotes the bindClass works.


    However the resulting class seems to do absolutely nothing…

    ]]>

  3. Anonymous says:

    < ![CDATA[

    what script did you tried ?

    ]]>

  4. Anonymous says:

    < ![CDATA[

    LL.bindClass(“android.media.MediaPlayer”);


    MediaPlayer.start();

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Maybe try if(ok = LL.bindClass(“blabla”)) {


    alert(ok);


    MediaPlayer.start();


    }

    ]]>

  6. Anonymous says:

    < ![CDATA[

    If with a defining statement doesn’t make sense, because it’s always true.


    However an alert is a good idea

    ]]>

  7. Anonymous says:

    < ![CDATA[

    The statement in the if works in some language… I didn’t remember if it works in js…

    ]]>

  8. Anonymous says:

    < ![CDATA[

    alert(LL.bindClass(“android.media.MediaPlayer”));


    MediaPlayer.start();



    Returns true for the alert, but start stop throws an error

    ]]>

  9. Anonymous says:

    < ![CDATA[

    You need to create a MediaPlayer instance first… See http://www.tutorialspoint.com/android/android_mediaplayer.htm

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Thanks a lot. Works:



    LL.bindClass(“android.media.MediaPlayer”);


    mediaPlayer=MediaPlayer.create(LL.getContext(),Uri.parse(“file://path“));


    mediaPlayer.start();

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Wow cool!!

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Fun!


    Indeed MediaPlayer.start is not enough, it need to follow the full cycle, with a prepare before or some convenience method such as create.


    bindClass will return true the first time it is run, then false on next tries (as long as the app is not restarted) because the class will be registered.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Josh Gray see this post to (maybe) make a built-in player!

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *