Flash Content

Overview

Managing Flash based content is difficult without implementing a specific best practice for the rendering of flash content. This discussion paper hopes to provide such a practice.

This is a working paper for a suggested feature enhancement to FarCry 5.0.x

Content Management Requirements

There are three basic scenarios when adding Flash content:

  1. user embeds HTML markup with reference to a third-party SWF; eg. YouTube video embed.
  2. user is uploading their own Flash content and needs the physical SWF and associated metadata managed
  3. user is referencing a third-party SWF but wants to record the parameters and metadata of the Flash in the application

There are two common content rendering requirements when a user attaches/relates SWF content via a library to their content item:

  1. render the SWF content through the choice of template; ie. use attaches SW content and rendering is fixed in position by the template choice, or;
  2. embed the Flash into the body content with the ability to position the Flash element at any point in the markup

Rendering Flash

Flash content should be rendered using best practice Flash embedding via the swfobject 2.1 library:

There are specifically two components:

  1. Javascript library and commands in the HTML head section
  2. DIV with a specific ID in the body section
Sample swfobject implementation
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>SWFObject 2 dynamic publishing example page</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<script type="text/javascript" src="swfobject.js"></script>
		<script type="text/javascript">
		swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
		</script>
	</head>
	<body>
		<div id="myContent">
			<h1>Alternative content</h1>
			<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
		</div>
	</body>
</html>

This gives us some great options for robust SWF content management provider the contributors enforce the following:

  • all SWF content is registered in the Flash Library with appropriate metadata
  • any content item embedding Flash must have the Flash Content item associated as an array or UUID property
  • if the user must embed, then the only embed code is the alternative markup
    <div id="myContent">
    	<h1>Alternative content</h1>
    	<p>Content you see when you don't see Flash.</p>
    </div>
    
  • a view must be called on the associated flash content item that loads the swfobject library and registration call