BullGuard Antivirus Sale - 60% Off with openElement !
openElement Website Homepage
Forum Home Forum Home >

openElement

> Scripts for Your Website
  New Posts New Posts RSS Feed - Audio Player Code
  FAQ FAQ  Forum Search   Register Register  Login Login

Audio Player Code

 Post Reply Post Reply
Author
Message
tlmac View Drop Down
Newbie
Newbie


Joined: Nov 27 2016
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote tlmac Quote  Post ReplyReply Direct Link To This Post Topic: Audio Player Code
    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
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 4773
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Nov 28 2016 at 9:12am
Hi,

It should work when you preview in a browser (F12)
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 4773
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Nov 28 2016 at 9:16am
If it does not, please publish your website somewhere and give the link
Back to Top
skye View Drop Down
Newbie
Newbie
Avatar

Joined: Jul 29 2016
Location: Hungary
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote skye Quote  Post ReplyReply Direct Link To This Post Posted: Feb 10 2017 at 6:47pm
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 ?
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 4773
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Feb 10 2017 at 8:07pm
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>
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,016 seconds.