Tuesday, November 24, 2009

Setting the Date of a VideoResource()

New in 0.7.0.0 is the ability to set the the date of a VideoResource. In retrospect this is something I should have included from day one but unfortunately I didn't see the potential. I want to thank hottamale from the site for requesting this and reminding me that it actually exists.

So in order to make this available and preserve backwards compatibility I had to come up with a work around and so I decided to add a special XML tag to the description to handle it (I'm claiming the <special> tag)


local dateXML = '<special date="1.0"><year>2009</year><month>11</month><day>11</day></special>';

VideoResource("test", "video.mp4", "This is before the special tag"..dateXML.."and this is after", "", 100000);


The plugin will extrapolate the Date information and remove the data from the description before it ever gets to the user's screen. Just keep in mind that the format is very strict and will attempt to catch and throw an error if malformed but if not properly set you could end up with ugly tags being sent to the user.

No comments:

Post a Comment