Domasv13 Posted December 12, 2016 Share Posted December 12, 2016 Hey ,i need a background music. How to do that ? header.tpl ? Code ? Thanks Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 Hi, You can put your code in the header.tpl file. Hey , thanks for you answer. Maybe you can tell more specific place to put a code , because i tried but it won't work. Maybe code is not good ? <embed name="music" src="/music/music.wav" loop="false" hidden="true" autostart="true"></embed> Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 Did you test it in a separate page? And did you have the right audio path? src="/music/music.wav" // is it the right path Yes , the path is correct . Even tried with URL. Didn't tried on separate , gonna try now Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 Tried on maintenance.tpl , Not working . Can't understand why . Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 where did you put this file music.wav ? in /music/ Even tried using full url. Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 ok, you should test a working version. What do you mean working version ? Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 Working version of your code. It's not working m8 . Maybe u have project where you can try to add the code to header ? Link to comment Share on other sites More sharing options...
Domasv13 Posted December 12, 2016 Author Share Posted December 12, 2016 Anyone can help ? Need help with background music Link to comment Share on other sites More sharing options...
Soyons Solidaire Posted December 13, 2016 Share Posted December 13, 2016 (edited) Hello <embed src="my_fichier" autostart="true" loop="false" hidden="true"></embed> Edited December 13, 2016 by Soyons Solidaires (see edit history) Link to comment Share on other sites More sharing options...
Domasv13 Posted December 15, 2016 Author Share Posted December 15, 2016 Solved , Script with cookies for continuously music. <audio preload="auto" src="/music/song.mp3" loop="true" autobuffer> Unsupported in Firefox </audio> <script> function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; } function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } var song = document.getElementsByTagName('audio')[0]; var played = false; var tillPlayed = getCookie('timePlayed'); function update() { if(!played){ if(tillPlayed){ song.currentTime = tillPlayed; song.play(); played = true; } else { song.play(); played = true; } } else { setCookie('timePlayed', song.currentTime); } } setInterval(update,1000); </script> <div id="page"> <div class="header-container"> <header id="header"> <div class="banner"> <div class="container"> <div class="row"> {hook h="displayBanner"} </div> </div> </div> <div class="nav"> <div class="container"> <div class="row"> <nav>{hook h="displayNav"}</nav> </div> </div> </div> <div> <div class="container"> <div class="row"> {if isset($HOOK_TOP)}{$HOOK_TOP}{/if} </div> </div> </div> </header> </div> <div class="columns-container"> <div id="columns" class="container"> {if $page_name !='index' && $page_name !='pagenotfound'} {include file="$tpl_dir./breadcrumb.tpl"} {/if} <div id="slider_row" class="row"> <div id="top_column" class="center_column col-xs-12 col-sm-12">{hook h="displayTopColumn"}</div> </div> <div class="row"> {if isset($left_column_size) && !empty($left_column_size)} <div id="left_column" class="column col-xs-12 col-sm-{$left_column_size|intval}">{$HOOK_LEFT_COLUMN}</div> {/if} {if isset($left_column_size) && isset($right_column_size)}{assign var='cols' value=(12 - $left_column_size - $right_column_size)}{else}{assign var='cols' value=12}{/if} <div id="center_column" class="center_column col-xs-12 col-sm-{$cols|intval}"> 1 Link to comment Share on other sites More sharing options...
Karpat Posted January 30, 2017 Share Posted January 30, 2017 code for header.tpl? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now