using javascript to play audio just on iPad - javascript

Rather than repeat a long javascript for playing audio, here is the link: webpages.charter.net/jolove/Includes/play_song.js:.
This plays for any desktop browser (Mac or Windows), but not for my iPad.
Here is the calling website: webpages.charter.net/jolove/Escort_Folder/Dedication_Poem_iOS.html
This is really bugging me, so I would definitely appreciate any help on this, any help at all.
John Love

Not sure exactly what your question is, but you can use the HTML5 <audio> tag which is supported by the iPad. Check out http://developer.apple.com/safaridemos/audio.php or just google "HTML5 audio".

I'm almost forced to conclude that iPad will not play audio files.
Here is a very fresh site, where I use
the audio. But, this time, I got a button that says "cannot play audio file". For the sake of completeness, here is the included webpages.charter.net/jolove/Escort_Folder/js/play_song.js

Related

HTML video in popup box randomly plays/doesn't play in Chrome

This will once again be one of those question there's probably no answer to, but I'll try it anyway.
I created a custom WP plug-in that takes a folder name and outputs all videos inside the folder as images, which when clicked make a video pop-up. The video has custom controls (only play/pause and mute) and I'm using fancybox to make the video pop-up.
Everything works reliably in Opera and Firefox. The video doesn't bother playing in IE9 and, what's most annoying, it sometimes plays in Chrome and sometimes doesn't. (btw Safari won't even pop-up, no idea why).
The plug-in is quite a piece of code, but the end result is a bunch of links with an image inside and a hidden div that contains the links relevant to the current video. Then there's the video container, which is the code for the pop-up. Upon clicking one of the links, the src of the video is swapped for the one that is in the hidden content of the link.
It's quite hard to explain, so please have a look at the code on the website:
http://londoncreativedigital.com/downloads/creativeshowcase/
If you're still reading, here's the plug-in's code
https://github.com/marian-cerny/simple-video-embed
Video playing/pausing is handled in assets/player-controller.js.
I would greatly appreciate any help. I just can't logically explain what can be the reason for this. I tried to debug the JS, but couldn't come up with anything.
For a second I thought that adding a webm video would help, but it doesn't. It behaves the same way, even after adding a webm and removing the mp4 version. (tried on localhost, the online version doesn't have the webm vids).
You hardly ever need to blame your markup or javascript, suppose there is something different than this. I've been it such situations couple of times. All right, here is what I did.
opened video directly in chrome and FF.
open the developer bar on both, and look up the net(network) tab, where you suppose to see headers and other loading information.
in my case here is only one request in FF, and multiply from Chrome and there is canceled or pending only.
tryed the same with ogg clip, it is good in FF though chunked, and bit better in Chrome, part of requests are in pending, part canceled and fiew is good.
What could be wrong here, all right, as I said I do have similar problems in the past, I worked with professional movie maker, who do very good with all that codecs stuff. I just showed him perfectly working mp4 video from the videojs.com and he fixed his somehow by changing encoder or something like this. Unfortunately, I could not connect him how and ask, but probably it gives you some ideas. Please whenever you will be able to solve it, update status over here, I was bit intrigued all that times but had no chance to resolve my curiosity.
Your video was only once worked for me, but I am not sure if it was mp4 or ogg at that point. Also I am on win7 with latest Chrome and FF.

Javascript Youtube mp4 download to ios

I searched for many solutions to play Youtube videos on iOS.
At the moment i just use a webview to show only the player and then press the play button (only embed the video in the webview).
But I know there is a javascript solution to get an mp4 link for the youtube video.
This is the javascript:
http://userscripts.org/scripts/show/25105
The script searches for the video element and grabs all informations and finally make it possible to download the mp4.
Im not good in javascript, so i dont know if there is an possibility to write that code, that it just works with http://myurl.com/getvideo?id=VIDEOID .
I would try it myself, but i dont know if it is possible to grab all these informations the script uses without the player element.
Maybe you can help me ;)
(im using iOS 5 btw)
My english is not the best, so if u have problems to understand something, just ask.
you can check PSYouTubeExtractor that allows you to retrieve the mp4 version of a YouTube video, it is pretty easy to use.

JQuery sound - playing and stopping?

I wanted to implement something with JQuery (trying to avoid external plugins), that will play sound on clicking "play" and stop the sound by clicking "stop", and will also work cross-browser (including iPhone and iPad devices, so no flash).
Is there a solution to this?
I have only ever found external plugins..
Unfortunately no. For years the only way to play audio in the browser has always required a plugin. More recently, the HTML5 standard has provided a cross-browser standard for playing audio. Unfortunately many browsers still don't implement HTML5, so this doesn't really fix your problem either.

Is there a way to embed an mp3 player in a website that isn't flash based (so that the website is iPhone OS compatible)

I did a lot of searching for what I thought would be a pretty common question, but I came up with nothing. If there is another thread with a similar topic, please let me know.
Basically, I'm looking for a way to have an .mp3 file play in a website without relying on a flash-based player. I've searched w3 schools and every forum I can think of, but every media player I've found so far has been some sort of proprietary flash player.
Doesn't HTML support some sort of native player? I've found some that rely on Windows Media Player which is close, but I want the player to work on an iPhone and something tells me WMP won't get that done...
PS, as I'm thinking more about this this idea just popped into my head: a javascipt player and inside the <noscript> tag, put a flash player? I'm running a music blog (# http://www.freshoncampus.com) so the less code per post, the better...
Yes you can, with HTML 5.
This is a pretty good explanation of how you might go about doing this.
The caveat is that HTML5 support is not universal, but iOS devices (iphone) have a good start with supporting HTML5.
Edited to add:
From the question, it's hard to discern if you're looking for a way to play multiple mp3's with a nice gui interface, or just use audio as a background.
For the former, you will need to use Javascript to handle controls, and loading of the src element (I'd search for custom built javascript or jquery plugins to handle this).
For the latter, my solution above will work.
Also, background music in a webpage is highly annoying to most users, so caveat emptor.
You could go with something like http://www.schillmania.com/projects/soundmanager2/
which should autodetect the best option to play the sound.
jplayer? Not sure about MP3/OGG thing though...
First, HTML5's “audio” tag.
Second, you can use “embed” tag — it will play with whatever browser plugin is installed (not just WMP).
Not sure what would work in iPhone, though.
(and I might be wrong about exact tag names)

Play sound in mobile browser?

I want to make myself a web based stop watch for training that I can use on my Blackberry mobile browser.
The stopwatch should count 3 minutes, then ring a bell, wait 1 minute, then ring another bell and then repeat.
My problem is I can't seem to get sound to work on my blackberry browser.
I tried using <embed src="bell.wav"> which works fine in the browser of a normal computer, but it doesn't make a sound on my blackberry.
Should I build this stopwatch with Javascript and HTML or should I build it with flash?
According to the BlackBerry HTML Reference, the EMBED tag isn't supported. You might want to experiment with the OBJECT tag. One example I've seen to play embedded video in the browser is something like this:
<object height="288" width="352"
data="http://admin.example.com/_ipvideos/video_file_35.3gp"
type="video/3gpp" />
Something similar might work for simple audio files, too.
As for Flash, you're out of luck as none of the current BlackBerry browsers don't support it. If you're not having luck doing this in a webpage, you might want to bite the bullet and write a native app to do it. Or give BlackBerry Widgets a try.

Categories

Resources