Search code examples
jqueryjplayer

jQuery - Access object property


For unit testing purpose, I need to check the src object property of a jQuery & jPlayer object. Unfortunately, I can't get though accessing the property via DOM.

Here is the init code for reference :

$("#jquery_jplayer_1").jPlayer({
    ready: function (event) {
        $(this).jPlayer("setMedia", {
        mp3: "mysound.mp3"
        }).jPlayer("play"));
    }
(...)

Firebug tells my property is available at :

jPlayer.status.src

But the following code returns an undefined.

$("#jquery_jplayer_1").jPlayer().status.src

This also returns an undefined.

$("#jquery_jplayer_1").jPlayer.status.src

What would be the correct path command to call and grab the src value ?

Thanks,


Solution

  • If memory serves me correctly, I think its something like...

    $("#jquery_jplayer_1").data("jPlayer").status.src