Skip to content

Instantly share code, notes, and snippets.

@harmstyler
Created November 6, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harmstyler/4026105 to your computer and use it in GitHub Desktop.
Save harmstyler/4026105 to your computer and use it in GitHub Desktop.
Javascript in eZ Templates with literals and variables
<div class="landing-video-surround">
<div class="audio-player" id="LandingPageVideo"></div>
</div>
<script type="text/javascript">
var videoURL = '{$video-url|trim}',
videoHeight = '{$player_height}',
videoWidth = '{$player_width}',
jwPlayer = {'javascript/player.swf'|ezdesign},
titleCard = '{$title-card-url}',
rtmpFile = '{$rtmp-file|trim}',
rtmpStreamer = '{$rtmp-streamer|trim}';
{literal}
jwplayer("LandingPageVideo").setup({
logo: {hide: true},
height: videoHeight,
width: videoWidth,
'skin': '/extension/jsh/design/ezflow/javascript/modieus/modieus-slim.xml',
image: titleCard,
plugins: {
"gapro-2": {
accountid:'UA-688649-2',
trackingobject:'_gaq',
trackstarts:'true',
trackpercentage:'true',
tracktime:'true',
idstring:'||streamer||/||file||'
}
},
modes: [{
type: "flash",
src: jwPlayer,
config: {
bufferlength: 6,
provider: "rtmp",
streamer: rtmpStreamer,
file: rtmpFile
}
},{
type: "html5",
config: {
file: videoURL
}
}]
})
{/literal}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment