[WIP] DIVX (And maybe other video types) mod

evilc

Joined: 2004-08-01
Posts: 47
Posted: Tue, 2008-10-28 15:50

OK, this is something I have been wanting to do for ages.
I love the way G2Image links are query links so moving albums does not break the links and I wanted the same thing for videos (I use JCE and the Media Manager plugin can post videos from your gallery if you disable the .htaccess security, but it makes URL links which break if you move albums around)

I have been hacking around and I can get G2Image to quite happily generate the correct HTML, but at the moment, something is stripping the embed tag - I do not know if this is the editor or G2Image at the moment, but i suspect the former. I have a thread about this here

Anyway, for the moment, proof of concept code is very simple, for now we can just hijack the fullsize_only option as this generates a URL to the underlying item not a thumbnail.

First, it's probably best to set your Gallery up to handle DIVX properly. I have posted my mod for this here.

So, back to the G2Image mod... Edit functions.js, and replace the entire contents of the case 'fullsize_only': block with:

					htmlCode += '<object codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" classid="clsid:67dabfbf-d0ab-41fa-9c46-cc0f21721616" height="308" width="360">';
					htmlCode += '<param name="src" value="' + fullsize_img[i] + '" />';
					htmlCode += '<param name="mode" value="mini" /><param name="bufferingmode" value="null" /><param name="autoplay" value="false" /><param name="name" value="test_divx.divx" />';
					htmlCode += '<embed autoplay="false" bufferingmode="null" mode="mini" type="video/divx" src="' + fullsize_img[i] + '" name="test_divx.divx" height="308" width="360"></embed>';
					htmlCode += '</object>';

Now, as stated above, there is currently an issue with the embed part of the tag being stripped, but to prove it is generating the code right, search and replace that block of code < to &lt; and > to &gt; - then it pastes it as text in WYSIWYG view. Cut that text into the clipboard, switch to HTML (Code) view and paste it as HTML and it works.

More info as I progress, I have emailed Kirk on this asking for assistance, and I have a gazillion posts, so hopefully some solution will be found.