Thanks very much.  A float is what worked.

On Jun 26, 2:05 am, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 26 juin, 04:07, Joseph Arceneaux <joe.arcene...@gmail.com> wrote:
>
> > Hello,
> > I'm trying to manage theYouTubeplayer from GWT and experiencing some
> > problems.  My player class contains JSNI references like:
>
> >         public native final void seekTo (int seconds) /*-{
> >                 this.seekTo(seconds, true);
> >         }-*/;
>
> > which work fine, so I know I'm actually talking to the player.  Getting
> > information like duration, however, fails.  That call looks like:
>
> >         public native final int getDuration () /*-{
> >                 this.getDuration();
> >         }-*/;
>
> You forgot the "return" here, might it be the only reason it's
> failing?
>
> > and when invoked not only fails, but also causes lots of other stuff to stop
> > functioning.  Trying the same declaration with type String instead of int
> > will return a null but allow things to keep working.
>
> > Anyone know how to successfully make this call to the player?
>
> Well, if this.getDuration() returns a 'null' (provided the missing
> "return" is not an error in your code but only in your message), it
> cannot, obviously, be converted to an 'int'. You'd have to choose how
> you'd like your API to look like:
>  - You can return an Integer (but then you have to check for 'null' in
> the JSNI and in case it isn't, explicitly build an Integer instance;
> there's an RFE in the issue tracker about this, I seem to remember it
> has sample code in the comments)
>  - or you can choose to return '0' or '-1'.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to