acceptFileDrop into MoviePlayer

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.

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?

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.

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?

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

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.

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.

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

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

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.