Posted by steveo on Wed, 25 May 2011 20:09:49
I'm pretty new to all of this, but I have some good starter add-ons running (with buttons, slash-commands, etc.).
I'm trying to add (either free-standing or within an existing addon) a MovieFrame... I've checked out the documentation page and followed every citation on the webs I can find (not many). It's possible that I'm missing something braindead simple about creating frames in general. Does anyone see what's wrong with this code snippet?
function MovieTest:OnEnable() CreateFrame("MovieFrame", "myMovie", UIParent) StartMovie("Interface\\AddOns\\MovieTest\\WOW_Intro_LK_800.avi") end
Posted by jnwhiteh on Wed, 25 May 2011 20:14:48
The first thing you should do is enable Lua errors, since your code will be causing one and you should catch it and be aware of it. Second, add some print statements to make sure your OnEnable is even being called (it won't be unless you're calling it somehow, from the code I have to look at).
Mainly, the StartMovie function is not a global function, it is a method. So you must call it on the movie frame. In your example that means myMovie:StartMovie() not just StartMovie().
Posted by steveo on Wed, 25 May 2011 20:39:58
Thanks for the quick reply! You're right about the lack of troubleshooting tools in that little snippet. I had tried to create the simplest possible thing to narrow down the problem.
Here's the frame in my main addon. I deleted all the other functionality of the frame -- it's just supposed to launch a movie file upon receiving a CHATMSGADDON with the appropriate prefix. The "print" in the if statement (print("Try to launch video")) does show up in the default chat window, so I know the logic is working that far, and the AVI file referenced is both in the addon's directory and in the TOC. But no video...
local f = CreateFrame("Frame") f:RegisterEvent("CHAT_MSG_ADDON") f:SetScript("OnEvent", function(self, event, prefix, msg, channel, sender) if prefix == "SsRv1" then if msg == "playmedia1" then print("Try to launch video") CreateFrame("MovieFrame","MiniMovie",UIParent) MiniMovie:StartMovie("Interface\\AddOns\\SCRIBEskeleton\\WOW_Intro_LK_800",255) end end
I'm not ignoring your comment about enabling run-time error checking... just reading up on how to do it :)
Posted by steveo on Wed, 25 May 2011 20:58:09
I downloaded !BugGrabber (pretty cool), and it claims that the problem is in my method call:
Usage: MiniMovie:StartMovie(movieID) [flags the line where this is indeed called, but without any more info]
Posted by jnwhiteh on Wed, 25 May 2011 21:26:22
You can do Interface Options -> Help -> Display Lua Errors.
As for why you're getting the error.. I'm not sure. The error message seems to indicate that it wants a number instead of a filename. Its possible theyve changed things. You might download the addon HighRoller on wowinterface to see if it still works.
Posted by steveo on Wed, 25 May 2011 21:30:50
Could it be a change?? I found this line in http://purl.rikers.org/%23wowuidev/20101026.html.gz, for October 26... so I assume that's sometime shortly after version 4.0.x
22:39.55 Skeen wait, they removed the: StartMovie(movieID)? >.
I looked in the most recent API list and I can't find StartMovie... Am I barking up a tree that's not even there any more?
Posted by steveo on Wed, 25 May 2011 21:31:20
HighRoller doesn't work either... ;(
EDIT... well, I tried again. HighRoller does execute, though it throws a big long lua error message...
Of course, HighRoller's AVI file (algorithm.avi) is actually the music. The graphics are a button with a countdown timer... not a video at all. And the music doesn't seem to play.
Posted by jnwhiteh on Wed, 25 May 2011 21:55:05
Not sure.. there is still a StartMovie method on MovieFrame..
Posted by steveo on Wed, 25 May 2011 22:01:20
Based on the info here: http://wowprogramming.com/utils/xmlbrowser/live/GlueXML/MovieFrame.lua
I changed the ID from a path to a number (23 is the Cataclysm movie), and it launched, albeit with my icon bar in the middle of the screen :)
So I'm wondering if they no longer allow for custom movies...
Posted by jnwhiteh on Wed, 25 May 2011 22:13:44
That is possible, there was a change similar for music, but I know custom music still works, but perhaps that will help you out!