Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Using embedded flash object to play sounds in a Symbian WRT widget

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Article
Created: Maveric (27 Oct 2010)
Last edited: hamishwillee (14 May 2013)

Under construction.

Contents

Introduction

The purpose of this wiki article is to demonstrate how you can play sounds in a Symbian WRT widget using embedded Flash object.


Prerequisites

  • Any code editor of your choise. Notepad++ is very popular among the user as a text editor which gives syntax highligthing.
  • A supported device for testing, N97 is used in this example.

Example code

This example code shows how to perform the actual embedding and playing, and can be found as a full widget attached to this article.

basic.js - code for WRT default JavaScript file

Note: Editing this file is not necessary for this example, you can leave it as is.


index.html - code for WRT default HTML-file

In the CSS file basic.css will simply define a background-color and text alignment to the middle of the widget.

The Flash media content placeholder will be embedded into the widget as an object, then the embed tags make this understood by the S60 browser so it can execute the content on the device.

The screen height and size can be adjusted accordingly, here the figures are just for testing on an N97 device.

First part of the code is for embedding a flash animation/video, you can use both elements as there are example files added as ".swf" and ".mp3". In the example, the animation/movie is commented out and only the mp3 object part will be executed. You can test with these both, same time or separately by uncommenting the first section.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Embed FLASH example</title>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<script language="javascript" type="text/javascript" src="basic.js"></script>
<style type="text/css">
@import "basic.css";
</style>
</head>
<body onLoad="javascript:init();">
</body>
 
 
<!--MOVIE
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="240" height "320" id="player" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="test.swf" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#6C5635" />
<embed src="test.swf" loop="false" menu="false" quality="high" wmode="opaque" bgcolor="#6C5635" width="240" height="320" name="downcount" align="middle" allowScriptAccess="sameDomain" type="application/x-schockwave-flash" pluginspage="http://get.adobe.com/flashplayer/otherversions/" />
-->

This second part of the example code in the HTML file will be executed.

<!--MP3-->
<center>
MP3 PLAYER DEMO
<p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="240" height "200" id="player" align="middle">
<param name="movie" value="player_mp3.swf?mp3=test.mp3">
<param name="wmode" value="transparent">
<param name="loop" value="false" />
<param name="menu" value="true" />
<param name="quality" value="high" />
<param name="bgcolor" value="#6C5635" />
<embed src="player_mp3.swf?mp3=test.mp3" loop="false" menu="false"
quality="high" wmode="opaque" bgcolor="#6C5635" width="240" height="200"
name="player" align="middle" allowScriptAccess="sameDomain"
type="application/x-schockwave-flash" pluginspage="http://get.adobe.com/flashplayer/otherversions/" />
</object>
</html>
</center>
</p>

Media file and link for testing

test.mp3

Media:test.mp3

test.swf

Media:test.mp3

player.swf

Media:test.mp3

This page was last modified on 14 May 2013, at 03:17.
950 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×