-
background music problem
hello. I embedded background music in my webpage and it plays fine on all my browsers including my android phone, but it seems not to play on my Iphone. Is there a special script which will allow background music to play on Iphone safari?
-
-
This should:
http://www.dynamicdrive.com/forums/s...275#post265275
The hover effects on the control image might not work on touch screens. If you just want the sound to play though, you don't need to use that part.
And then there's always:
http://www.schillmania.com/projects/soundmanager2/
-
The Following User Says Thank You to jscheuer1 For This Useful Post:
-
As far as I know, there is no "hover" event on a touchscreen device. You would need to touch somewhere else, then move on top of the object, then stay stationary. That doesn't work very easily.
However, there are some preliminary ways to use gestures with Javascript on an iPhone if you search for them. I've used them (actually with the soundmanager2 script above), and they work, at least somewhat. They aren't perfect, but they aren't useless either.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
The Following User Says Thank You to djr33 For This Useful Post:
-
Thanks for the help guys. Now to figure out how to install it
-
-
Hello. took your advice and downloaded the soundmanager. I,ve since I've been trying to understand it while getting it to work. The doc doesn't do a good job explaining how to input the script. Do you have a general idea on how to input the script to my page?
-
-
Just copy the code from one of the example pages. The doc is more for customization.
Unfortunately, it's not a very easy script to use (in some ways), but it's a very good script and works for almost all browsers/devices.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Thanks for responding again. I really do appreciate the help.I copy and paste the script from an example page and made the changes, but I still can't get it to play. This is the script I copied and edited: (http://www.soundinvestmentent.com//M...ome_apple.html)
<script type="text/javascript" src="/path/to/soundmanager2.js"></script>
<!-- configure it for your use -->
<script type="text/javascript">
soundManager.url = '/http://soundinvestmentent.com'; // directory where SM2 .SWFs live
// Note that SoundManager will determine and append the appropriate .SWF file to the URL,
// eg. /path/to/sm2-flash-movies/soundmanager2.swf automatically.
// Beta-ish HTML5 audio support (force-enabled for iPad), flash-free sound for Safari + Chrome. Enable if you want to try it!
// soundManager.useHTML5Audio = true;
// do this to skip flash block handling for now. See the flashblock demo when you want to start getting fancy.
soundManager.useFlashBlock = false;
// disable debug mode after development/testing..
// soundManager.debugMode = false;
// Option 1: Simple onload() + createSound() method
soundManager.onload = function() {
// SM2 has loaded - now you can create and play sounds!
soundManager.createSound('welcome','/http://soundinvestmentent.com/welcome.mp3');
soundManager.play('welcome');
};
// Option 2 (better): More flexible onload() + createSound() method
soundManager.onload = function() {
var mySound = soundManager.createSound({
id: 'aSound',
url: '/path/to/an.mp3'
// onload: [ event handler function object ],
// other options here..
});
mySound.play();
}
// Option 3 (best): onready() + createSound() methods, handle load/failure together:
soundManager.onready(function() {
// check if SM2 successfully loaded..
if (soundManager.supported()) {
// SM2 has loaded - now you can create and play sounds!
var mySound = soundManager.createSound({
id: 'welcome',
url: 'http://soundinvestmentent.com/welcome.mp3'
// onload: [ event handler function object ],
// other options here..
});
mySound.play();
} else {
// (Optional) Hrmm, SM2 could not start. Show an error, etc.?
}
});
</script>
-
-
Do you have the rights or a license to use that song? If so, can you and would you grant the same to me so I can use it in my demos? If it's a remix, like your voice-over, over the rap, which is itself a remix, I believe that grants you rights as the licensor.
On to your question - There's no script on or associated with that page that would play any sound.
But I must admit, I took a quick look at sound manager and saw no quick path to just getting a sound to play.
Anyways, I'm wanting to develop my code, so try this page out in your mobile device(s):
http://home.comcast.net/~jscheuer1/molecules/
There could be other problems, but the only one I'm anticipating is with the rollover effects of the control image. Clicking it should still turn the sound on and off. Test it in a regular browser on a regular computer to see how the hover effects should go. I have added some touch events, so even that part (hover) might work.
However, as I say, if you don't want the user to be able to control the sound, we can disable the control button and there should be no problem.
But if there is a problem with the control button hover, or any other problems, please explain in detail what the problem(s) is/are and what device the problem is on.
If we're real lucky, mobile devices will be fine with it or at least able to toggle the sound and simply not see any rollover effects of the control button.
If we're real unlucky, the sound won't even play on the mobile device.
Things could range widely in between those two extreme possibilities.
Whatever happens, please let me know. And let me know about the rights to the song. What's it called?
Last edited by jscheuer1; 12-26-2011 at 07:58 AM.
Reason: ask question
-
-
Hi John. Yes I have permission to use the song. I tried the link on both android and Iphone but you don't hear anything. You can hear it on the desktop browser. I
-
-
Bad news. Um try this very limited test page:
http://home.comcast.net/~jscheuer1/m...html5_test.htm
If that works in the mobiles, there's hope.
And if it's working in each mobile, click (tap it is I guess) on the button. See if it alerts anything, and if so what. This may be different in the different mobiles.
Back to the song. OK, so you have permission to use it. Do you have the rights to it, and if so are you willing to grant me a free license to use it in my demos?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks