Audio Player Code |
Post Reply |
Author | |
tlmac
Newbie Joined: Nov 27 2016 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: Nov 27 2016 at 11:41pm |
Hello,
Can some one tell me how to add audio player code to my site. I thought I was doing it correctly ( I chose the visual code block from the "Elements" tab), but the player does not appear when I preview it. Do I have to actually publish the page before seeing it? Thanks, tlmac
|
|
tlmac
|
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
Hi,
It should work when you preview in a browser (F12) |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
If it does not, please publish your website somewhere and give the link
|
|
skye
Newbie Joined: Jul 29 2016 Location: Hungary Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hello,
I have little problem with voice file's play: Page1 has 2 text link with same href="../Voice.htm" Page2 - this is Voice.htm - has a visual source code: <audio autoplay> <source src="../Files/Audio/Sziv.ogg" type="audio/ogg"> Your browser does not support the audio element. </audio> It works fine, however i want to change src="" on second page html with first page's text links. Should it use php/javascript commands to send the wanted src attribute to second page's code ? Thanks for every help! |
|
Have you ever looked closely a dragon's eye ?
|
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
You need either PHP or Javascript, no need for both. But be careful about security. If you send the URL via parameter and use it directly, anyone can abuse and inject harmful code, there are sevderal types of attack possible.
The easiest+safest is send only indexes / ids of links. So your links would be ../Voice.php?ind=1 and ../Voice.php?ind=2 (you may need to use LOCAL instead of HTTP + manually type at the bottom of link configuration). On the link page (which you should make PHP using Page->Server Scripts), and in your Source Code Visual enter: <?php $name = "Sziv.ogg"; // default if (isset($_GET['ind'])) { if ($_GET['ind'] == 1) $name = "Sziv.ogg"; elseif ($_GET['ind'] == 2) $name = "Sziv2.ogg"; elseif ($_GET['ind'] == 3) $name = "Sziv3.ogg"; // and so on } ?> <audio autoplay> <source src="../Files/Audio/<?php echo $name ?>" type="audio/ogg"> Your browser does not support the audio element. </audio> |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |