acceptFileDrop into MoviePlayer

  1. 2 weeks ago

    I took the code from my old RealStudio project and applied it to my project in the latest XOJO version, but when I go to drag a movie into the MoviePlayer, it rejects the movie. In my moviePlayer Open event I have:

    me.acceptFileDrop "video/quicktime;audio/wav;audio/x-wav;video/mpeg;audio/mp3;audio/x-m4a"

    all formats are in my FileTypes set and can be loaded into the MoviePlayer by using a Load Movie button.

    For my DropObject event for the MoviePlayer I have (abbreviated):

    f=obj.folderItem
    
    if f <> Nil then
      
         
        m = f.OpenAsMovie
        
        if m <> nil then
                  
          moviePlayer1.movie = m
          
     

    So when I drag any file onto the MoviePlayer, its file icon goes right back to the Desktop where it was before instead of getting loaded into the MoviePlayer.

  2. last week

    Greg O

    Nov 29 Xojo Inc

    That sounds like either the AcceptDrag code didn’t run or that the DropObject code isn’t running.

    Oh... are you returning True in DropObject to say that you accepted the file?

  3. when I put return true in the DropObject event, i get an error saying "You cannot return a value because this method has not defined a return type." I also tried putting the acceptFileDrop code in the DropObject event but still no luck. The LR doesn't say much about this and no examples of dropping a movie into the movieplayer. My code used to work in RealStudio, so I don't know what's different in XOJO.

  4. Greg O

    Nov 30 Xojo Inc

    Ok. There shouldn’t be a return value if the event doesn’t take one. Sorry, it’s the middle of the night here.

    The AcceptFileDrop should only be called once, in an Open event on the window or control.

    Have you tried putting breakpoints in to see if the SropObject code is running?

  5. Greg O

    Nov 30 Xojo Inc

    Also, have you implemented any of the other DropXXX events?

  6. There are no other drop events for the movieplayer than DropObject. wondering if this capability was lost when XOJO moved away from QuickTime? Anyone have sample code of loading a movie via dragging to the movieplayer? I tried making a very simple app with nothing but the movieplayer and couldn't get it to work either.

  7. i've reported this as a bug as it used to work under RealStudio and now no longer seems to. Thanks for the help, Greg.

  8. Greg O

    Nov 30 Xojo Inc

    @Patrick B wondering if this capability was lost when XOJO moved away from QuickTime?

    To be clear, it was Apple that moved away from QuickTime. We had to follow suit to keep moving forward.

  9. yes, i quite understand that. not blaming you guys at all. it always seems to be a moving target with Apple.

  10. Sam R

    Dec 1 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    In the meantime, you can do it over the window. I seem to recall you can even get the location as to where a drop occured, so you can see if it was over the movieplayer as per say.

or Sign Up to reply!