Pandora Source Code Lines 2918-2924 definition - html

This is from the Pandora One Source Code Lines 2918-2924
(view-source:http://www.pandora.com/) on Google Chrome
<script id="audioQualityUpsaleTmpl" type="text/x-jquery-tmpl">
<div class="upsale_container clearfix">
<h2>Enjoy Higher Quality Audio</h2>
<p>When Listening on the web, experience music at 192K bits per second. <br/>More bits means
better sounding Audio.
</p>
<div id="audioSample">
<object width="236" height="35">
<param value="high" name="quality">
<param value="transparent" name="wmode">
<param value="always" name="allowScriptAccess">
<param value="/static/pandora_one/flash/pandoraone_sampler.swf" name="movie">
<embed width="236" height="35" allowscriptaccess="always" wmode="transparent"
src="/static/pandora_one/flash/pandoraone_sampler.swf">
</object>
</div>
{{tmpl "#upgradeForUpsaleTmpl"}}
</div>
</script>
Can someone please explain to me what this section of code is designed to do?
Thank you

It appears to be a template for a javascript templating engine (it seems to be jquery based, however I'm not familar with it). You can tell this from the type="text/x-jquery-tmpl" tag.
Templates are often defined within script tags like this (with a type tag that is not javascript declared) because they are not rendered by the browser on page load, however are not executed as javascript. This allows the text to be selected client side, via something like $('#my-template'), and used as a template.

Related

Auto Play isn't working for swf flash video (weather app)

I may be missing something but I am trying to embed a weather app I found into my website. I am using this as my HTML code:
<div style="width:800px; height:250px;">
<object type="application/x-shockwave-flash" data="http://swf.yowindow.com/yowidget3.swf&autostart=true" width="800" height="250">
<param name="movie" value="http://swf.yowindow.com/yowidget3.swf&autoStart=true"/>
<param name="allowfullscreen" value="true"/>
<param name="wmode" value="opaque"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="autoPlay" value="true"/>
<param name="flashvars"
value="location_id=gn:5007804&location_name=Royal%20Oak&time_format=12&unit_system=us&background=#FFFFFF&mini_temperature=true&mini_time=true&mini_locationBar=true&mini_action=full_screen&copyright_bar=false;&autostart=true;"
/>
</object>
</div>
Notice how I put the param name = "Autoplay" value="true" line as well as trying to put it in the URL. Am I missing something here?
If I just paste the URL http://swf.yowindow.com/yowidget3.swf into a webbrowser, it auto plays no problem so it must be one of the parameters I have entered wrong.
I have looked many times on StackOverflow for a solution and have entered autoPlay="true" in many spots without any luck.
I tested your shown code and it's working fine (Chrome browser on Windows). Maybe you need to clear browser history & clear any cached files?
It only shows a "click to play" icon if the display width is smaller than 600px. Did you ever have such a smaller setting that is being cached & re-used?
Also regarding data="http://swf.yowindow.com/yowidget3.swf&autostart=true" the &autostart=true is not needed. Please remove it & test again (resave as different filename.html if needed).

turn off autoplay for audio file

I included an audio greeting in a website I'm making, and want audio to only start when a user click play. I set it up so that autoplay="false, and autostart="false"
here is my code so far
<section>
<h1>Welcome to Morlans Famous Shop!</h1>
<object>
<param name="greetings" value="audio/EN_sta60_black_market_00083397_M.wav" />
<param name="autostart" value="false" />
<param name="autoplay" value="false"/>
<param name="controller" value="true" />
<embed src="audio/EN_sta60_black_market_00083397_M.wav" controller="true" autoplay="false" autostart="false" type="audio/wav" pluginspage="http://www.apple.com/quicktime/download/" />
</object>
<p>Hello there. Welcome to Morlans famous shop. You want many good supplies, yes? </p>
<p>My shop carries all sorts of supplies need to survive the tough environments that the galaxy has to offer. From medigel, to armor, Morlans famous shop carries it all.</p>
<p>Oh, you will be pleased I think. Very good things I have, you will see.</p>
</section>
is there anything that I am missing?, any help would be appreciated
<script language="javascript" type="text/javascript">
function playSound(soundfile) {
document.getElementById("dummy").innerHTML= "<embed src=\""
+soundfile+"\" hidden=\"true\" autostart=\"true\"
loop=\"false\" />";
}
</script>
Have a look at that. Taken from this site.
http://webdesign.about.com/od/sound/a/play_sound_oncl.htm
That requires javascript though.
Still having some issues? Look here to get an understanding of the use of audio http://www.w3schools.com/html/html_sounds.asp

Whats wrong with this video embed code?

Following embed code is from http://hd.se/landskrona/2010/04/09/kunglig-glans-pa-idrottsgalan/ but it doesn't work in Internet Explorer 8. Firefox no problems.
Any recommendations for improvements?
Thanks for your time!
<object width="480px" height="294px" id="_36313041" data="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" type="application/x-shockwave-flash">
<param name="movie" value="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value='config={"key":"$3fff7448b28a8cffc85","contextMenu":["hd.se videospelare 1.0"],"plugins":{"rtmp":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.rtmp.swf"},"controls":{"height":24,"opacity":1,"all":false,"play":true,"time":true,"scrubber":true,"playlist":false,"mute":true,"volume":true,"fullscreen":true,"backgroundColor":"#222222","backgroundGradient":"none","buttonColor":"#7c7c7c","buttonOverColor":"#36558b","progressColor":"#7c7c7c","bufferColor":"#7c7c7c","timeColor":"#ffffff","durationColor":"#ffffff","timeBgColor":"#222222","scrubberHeightRatio":0.5,"scrubberBarHeightRatio":0.5,"volumeSliderHeightRatio":0.5,"volumeBarHeightRatio":0.5,"autoHide":"fullscreen","hideDelay":1800,"tooltips":{"buttons":true,"play":"Spela","pause":"Paus","next":"Nästa","previous":"Föregående","mute":"Ljud av","unmute":"Ljud på","fullscreen":"Fullskärmsläge","fullscreenExit":"Lämna fullskärmsläge"},"tooltipColor":"#153872","tooltipTextColor":"#ffffff"},"contentIntro":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.content.swf","top":0,"width":736,"border":"none","backgroundColor":"#202020","backgroundGradient":"none","borderRadius":"none","opacity":"85pct","display":"none","closeButton":true}},"canvas":{"backgroundColor":"#000000","backgroundGradient":"none"},"play":{"replayLabel":"Spela igen"},"screen":{"bottom":24},"clip":{"scaling":"fit","autoPlay":true},"playlist":[{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstart","autoPlay":false,"scaling":"fit"},{"url":"http://hd.se/multimedia/archive/00425/_kunligglans_HD_VP6_425359a.flv","scaling":"fit","autoPlay":true},{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstopp","autoPlay":true,"scaling":"fit"}]}' />
</object>
UPDATE 2010-05-14:
If I'm not mistaken HD.se uses Flowplayer and all those flasvars are for that. Perhaps someone here is good with Flowplayer? I've never used it myself.
You cannot have 'px' in the width and height attributes, only a number. Also IDs cannot start with an underscore, they can only start with a letter.
So your code should start <object width="480" height="294" id="f_36313041". However, if the ID is used for anything you may have to change external code somewhere.
Have you double-checked the value of "flashvars" too? It's an incredibly long and complex string so there could easily be an error there somewhere.
You should not create object/embed tags directly to embed Flash. Always use an external JS file to generate the required tags. SWFObject is the most widely used one.
http://en.wikipedia.org/wiki/SWFObject
Info on why you want to use an external JS file:
http://blog.deconcept.com/2005/12/15/internet-explorer-eolas-changes-and-the-flash-plugin/

html flash embed

I use the below code within for my JQuery lightbox without include js file AC_RunActiveContent.js or swfobject-1.5.js in the html file. It works fine for IE and Firefox. Just wanna know if there is any problem for not include AC_RunActiveContent.js or swfobject-1.5.js. Is it a must to have AC_RunActiveContent.js or swfobject-1.5.js for display a flash properly in different browsers version?
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="789" height="617" id="Loader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="en_MAIN.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="en_MAIN.swf" quality="high" bgcolor="#ffffff" width="789" height="617" name="Loader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
No, that's the Adobe-style standard markup. It works across all current browsers.
It's ugly, doesn't validate and has to state each parameter twice, which is what the Flash embedding scripts you mention are attempting to address (plus sometimes also there's an IE ‘object activation’ workaround that is no longer necessary). If you don't care about that, you're fine as you are. If you do, this question has some discussion on alternatives.
I don't think your code is connected to Lightbox: AC_RunActiveContent.js and swfobject-1.5.js are javascript workarounds for getting Flash to work in IE. Since Lightbox uses JQuery, not Flash, you shouldn't need them.
Look closely at the lightbox instructions for more information.

How might I update this code

<object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/>
<param value="high" name="quality"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="opaque" name="wmode"/>
<embed height="25" width="75" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high" src="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK"/>
</object>
I am having to insert this legacy markup into a new site that I'm building. Problem is its using an <embed> tag.
Would I just do away with the <embed> and put some content in as an alternative, for those that do not have flash? Basically I'm just trying to bring this piece of html into the 21st century.
You can nest object elements to display alternatives. The W3C explains it here. I copied a snippet below:
One significant consequence of the OBJECT element's design is that it offers a mechanism for specifying alternate object renderings; each embedded OBJECT declaration may specify alternate content types. If a user agent cannot render the outermost OBJECT, it tries to render the contents, which may be another OBJECT element, etc.
In the following example, we embed several OBJECT declarations to illustrate how alternate renderings work. A user agent will attempt to render the first OBJECT element it can, in the following order: (1) an Earth applet written in the Python language, (2) an MPEG animation of the Earth, (3) a GIF image of the Earth, (4) alternate text.
<P> <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space"
classid="http://www.observer.mars/TheEarth.py">
<!-- Else, try the MPEG video -->
<OBJECT data="TheEarth.mpeg" type="application/mpeg">
<!-- Else, try the GIF image -->
<OBJECT data="TheEarth.gif" type="image/gif">
<!-- Else render the text -->
The <STRONG>Earth</STRONG> as seen from space.
</OBJECT>
</OBJECT>
</OBJECT>
I recommend that you use swfobject which is a cross platform, open source library to display flash on your pages.
http://code.google.com/p/swfobject/
There are a variety of ways to load the flash and the alternative (non-flash) content. For example the following code could replace your code:
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK",
"myContent", "25", "75", "9.0.0");
</script>
<div id="myContent">
<p>Alternative content</p>
</div>
Basically, you should keep embed, because it is a fallback for some old browsers. It might hurt validation of page, but as long as you know why it is there, it is OK.
At least that's the way Adobe officially recommends: Macromedia Flash OBJECT and EMBED tag syntax
You are right to want to do code for XXIth century, but we have to deal with browser from previous millennium... :-)
I use function AC_FL_RunContent for embedding flash objects - it's good because it supports all browsers and is recommended by Adobe.
More is here:
They also suggest using <object> tag instead of <embed>
I found this code on the web (from a usability site) which caters for IE and others, and I use it on my flash pages (I've changed it to your code):
<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" width="75" height="25">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="75" height="25">
<param name="movie" value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" />
<!--><!--dgx-->
<param name="loop" value="false">
<param name="menu" value="false">
<param name="quality" value="high">
</object>
<!-- <![endif]-->