TEST TEST

an7_mov

iaian7 » code » txp   John Einselen, 28.05.07 (updated 10.04.11)    

With yet another IE browser version, things have gotten complicated when trying to use Quicktime media on a website. The latest specifications require the use of JS and inline code to embed a QT file (more can be found on the Apple website).

There are two options: either write a separate JS file for every QT media element you’ll use on your site, or use a master JS file and send the parameters via an inline script. Using the later method, the an7_mov plugin allows Textpattern to easily interface with the new requirements. Most of the settings (autoplay, loop, controller, etc.) can be setup in the plugin code as defaults, making repeated use of the tag as simple as possible.

an7_mov example

<txp:an7_mov dir="2007/06/" mov="2007preview.mov" width="480" height="270" />

tag options

dir="media"
– the media directory where QT files reside

mov=""
– name and extension of the file to embed

width=""
– width of the file

height=""
– height of the file (the QT controller height is automatically added if you set it to display)

activex=""
– unnecessary by Apple’s own admission, but included all the same

autoplay="false"
– starts playing immediately or not, true / false

bgcolor="black"
– background colour (only shows while the media initially loads), in javascript or #hex format

cache="true"
– saves the media on the users computer to make page reloads faster, true / false

controller="true"
– show the QT controller, true / false

kiosk="false"
– prevent movies from being saved, true / false

loop="false"
– look the movie, true / false / palindrome (loop back and forth)

showlogo="true"
– display the QT logo (only shows while the media initially loads), true / false

volume="80"
– default volume level, value 0 to 100

class="an7_mov"
– class for the DIV wrapper

an7_movbox example

<txp:an7_movbox dir="2007/06/" mov="2007preview.mov" width="480" height="270" />

1

Please note: mediaboxAdvanced does not natively support .mov files due to the problems in performing reliable browser checks. Because of this, the QT object may continue playing in some browsers, even after the overlay is closed.

an7_video example

<txp:an7_video dir="2007/06/" flv="2007preview.flv" width="480" height="270" />

an7_videobox example

<txp:an7_videobox dir="2007/06/" flv="2007preview.flv" width="640" height="360" />

1

download

this plugin is currently in beta

1 (version 0.4.4)

Required scripts for an7_mov and an7_video –

AC_Quicktime
SWFobject (for flash content) (less than 8kb)
JW FLV player

Required scripts for an7_movbox and an7_videobox –

Mediabox or mediaboxAdvanced (and associated support files)

installation

Open the textpattern plugin file and copy / paste the text into your Textpattern “install plugin” field (Admin > Plugins). Finish the installation procedure and enable the plugin.

Download the required javascripts and insert the appropriate code in your page header. Please refer to each scripts page for more details and setup options.

<script src="/css/mediabox.js" rel="stylesheet" type="text/css"></script>
...
<script src="js/AC_QuickTime.js" language="JavaScript" type="text/javascript"></script>
<script src="/js/swfobject.js" type="text/javascript"></script>
<script src="/js/mootools.v1.11.js" type="text/javascript"></script>
<script src="/js/mediabox.js" type="text/javascript"></script>
...

version history

v0.4.4
— fixed support for mp4, mpg, swf, and more
v0.4.3
— fixed IE inline flash support
v0.4.2
— fixed erroneous lowercasing of names
v0.4.0
— updated for MediaboxAdvanced 0.9.0
— added option for lightbox code, use an7_movbox with any lightbox style script
v0.3.0
— fixed integration with Mediabox 0.6.7
v0.2.0
— added flash video and Mediabox support, still beta
v0.1.0
— public beta release

help and support

For questions and support, please visit the an7_mov post in the Textpattern Forums.

credits

The tutorials from thresholdstate.com tutorials were helpful as always, as was php.net and the apple.com developers documents.

Dale Chapman, 1.10.07

Hi

Thanks for a great plugin. I have it working nicely with the exception of one small thing. I run the movies over a cross-fading slideshow, and during the transitions, video flickers and displays poorly. This is to be expected because of z-indicies.

So…

Is there any way you could provide a means of calling an external function (say, slideshow pause) when mediabox is invoked and another (say, slideshow play) when the user closes the mediabox window?

I assume this would not be too difficult, but I’d love to get your help, or point me to the right places in your script.

Thanks
-Dale

vic, 7.08.09

thanks for this mate…loving your code!

bookmark