HTML - Cross-platform Audio & Video Players
I have a "web site on a CD" application and wish to have users be able to play audio and video clips. I currently have MP3 audio and AVI compressed video but can convert to other formats. The CD is created via MacImage so that both PC and Mac formats are correctly encoded.
I have an HTML audio player and separate HTML video player (see below), both of which pass the W3C Validator as "4.01 Transitional" and play without problem on Windows/XP with IE6/7/8 and on Mac with Safari/QuickTime. The players do not work when used with Firefox or SeaMonkey on XP and do not work correctly with Firefox on Linux. I am seeking HTML code that will cater for all users on all platforms (PC, Mac and Linux) with as many browsers as possible (at least 1 on each platform). My audio player code is: <object type="audio/mpeg" width="360" height="50"> <param name="src" value="AudioTest.mp3"> <param name="Autostart" value="true"> <param name="Controller" value="true"> <param name="ShowStatusBar" value="true"> </object> My video player code is: <object type="video/avi" width="480" height="360"> <param name="url" value="VideoTest.avi"> <param name="src" value="VideoTest.avi"> <param name="autostart" value="true"> <param name="controller" value="true"> <param name="ShowControls" value="true"> <param name="ShowStatusBar" value="true"> <param name="ShowDisplay" value="false"> <param name="AutoRewind" value="false"> </object> Does anyone have any suggestions? Similar TutorialsI'm not sure where the best place to post this question is, so I thought I'd start here and see what I get. I want to set up a video player like it is on this site: http://blueroomnyc.com/work/Q3hLj98J...story-refresh/ There are 3 links to different videos on the page, but they all open in the same place when activated. How is this accomplished? Is it javascript? I'd like to be able to do the same thing with an audio plugin as well. Thanks. I am doing a site for someone, Every once in a while they want to add audio/video to a certain page on their site.. Whats an easy way of accomplishing this? The pictures, they can upload whenever, but Audio and video is another story.. Whats the best method of letting a NON webdesigner upload audio and video to a site? Thanks a lot guys... I appreciate it... I'm about to embark on something I realise will probably take a while to get right. Before I begin, it'd be good to pool opinions on the best approach. I've already done some preliminary research and to be honest at the moment it's all beyond my understanding! The goal is to create a custom player of audio and video files with custom GUI, as part of a webpage. I don't want to use Quicktime because, AFAIK, it would prohibit a custom "look". It may be necessary to create four separate players as the following situations need to be accommodated: 1) playing a single audio file 2) playing an "album" of audio files, in sequence 3) playing a single video file 4) playing an "album" of video files, in sequence The player GUI would feature a "screen". When playing a video, the screen would show the video. When playing an audio file, there would be a still image associated with each song which would occupy the screen. Then below the screen would be the usual apparatus for people to control playback: a trackbar, time counter, buttons for "play", "pause" and "stop". There would also be "next" and "previous" buttons for use when playing an album - they would be disabled when playing a single audio or video. I have a few questions... 1. Apart from Flash, I don't want my visitors to need to install any software before they can use the player. I presume this depends solely on the media formats involved? 2. What video format would you recommend? What about FLV? 3. What audio format would you recommend? Ideally I'd like to use OGG but if that would introduce complications then I'll use something else. 4. There's always going to be a download button on the player so that the visitor can download the file being played. Now I've noticed on some sites that if a video is loading (before being played), and you attempt to directly download it, sometimes the download will "fail" at the point at which the loading was halted. So if the video has only loaded 40% and you start downloading it directly, the resulting file on your harddrive will only be 40% of what it should be. It's probably due to the streamed video being downloaded to an anonymous temp folder and being left in an incomplete state which the OS then thinks is a completed download. Can anything be done to stop this happening? Perhaps hide the "download" button until the file has finished loading? Below is a mock-up of how I'd like the player to look, so you know what I'm going for. The purple background is supposed to resemble an HTML page. I look forward to reading people's views. Thanks for reading this long post, Seymour. Hey guys! I've just realized my first site html5 and all it was ok about indeed the on-line publishing on my server. Indeed every test made on the local disk were good without Firefox does not read the audio and video files. It works with Google Chrome and Safari but not Firefox. I am anxious to specify that I'm under Mac Os X and that I converted well files in format OGG and that I am rather a graphic designer who try write some code. I try to find the solution for several days but unsuccessfully. Can anybody help me please? Here is the fragment of the code: HTML Code: <!-- Track 01 --> <div> <h3>Fall</h3> <div class="mp_options"> <span class="mp_play">Play</span> <span class="mp_addpl">Add to playlist</span> </div> <div class="mp_song_info" style="display:none;"> <span class="mp_song_title">Fall</span> <span class="mp_mp3">music/album1/Red_Fish_Fall.mp3</span> <span class="mp_ogg">music/album1/Red_Fish_Fall.ogg</span> </div> </div> <!-- Track 02 --> I have a nice little HTML5 demo that plays a video in a canvas that is not displayed. As part of the demo, I copy "frames" from the hidden canvas into a resized canvas that is displayed. My "custom" code to manipulate the video frames works fine. What doesn't work depends on the browser, but also the source of the video. If the source of the video is on the local disk along with the html file, it plays fine and it loops fine in both Safari, Chrome. Opera and Firefox. If the source of the video is on the web, either as a local (to the website) where the html file is stored, or if the html file is local but the video is on the web, then Safari works fine. Chrome displays the video ONE time and then stops. The loop does not work. Remember, same code, works fine if all data is local. Changing the source URL of the video to a website is the ONLY change. Opera and Firefox do not display anything except the box rectangle when the video source is on the web. Firefox gives the error: Quote: Error: uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: file:///Volumes/Olorin/sliceNdice/demow.html :: processFrame :: line 34" data: no] No errors show up in Opera, but no video is displayed. The Code: (or a snippet, actually) Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title>HTML5 Video Deom</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript"> var video; var copy; var copycanvas; var draw; var VID_WID = 640; var VID_HIGH = 360; var OUT_WID = 480; var OUT_HIGH = 320; function init(){ video = document.getElementById('sourcevid'); copycanvas = document.getElementById('sourcecopy'); copy = copycanvas.getContext('2d'); var outputcanvas = document.getElementById('output'); draw = outputcanvas.getContext('2d'); setInterval("processFrame()", 33); } function processFrame(){ //get video image copy.drawImage(video, 0, 0); // manipulate image here draw.drawImage(copycanvas, 0,0); } </script></head> <body onload="init()" style="margin:0px;"> <div><br/><br/></div> <div style="display:none"> <video id="sourcevid" autoplay loop=loop> <source src="http://catalystart.reststop.com/html5/BigBuckBunny_640x360.mp4" type="video/mp4"/> <source src="http://catalystart.reststop.com/html5/BigBuckBunny_640x360.ogv" type="video/ogg"/> </video> <canvas id="sourcecopy" width="640" height="360"></canvas> </div> <div> <canvas id="output" width="480" height="320" style="border: solid 5px #666666"></canvas> </div> </body> </html> Works if all files are local, shows box outline if all files are on the web: Code: <video id="sourcevid" autoplay loop=loop> <source src="BigBuckBunny_640x360.mp4" type="video/mp4"/> <source src="BigBuckBunny_640x360.ogv" type="video/ogg"/> </video> Fails: Code: <video id="sourcevid" autoplay loop=loop> <source src="http://catalystart.reststop.com/html5/BigBuckBunny_640x360.mp4" type="video/mp4"/> <source src="http://catalystart.reststop.com/html5/BigBuckBunny_640x360.ogv" type="video/ogg"/> </video> Note: Safari works in both cases, as long as all files and website are reachable. Chrome works to play the video ONCE, then stops. Firefox and Opera show an empty outline, but no video. I'm not a cross-browser expert. I will accept any and all possible solutions to try. In the meantime, I will continue to see if I can find the problem. Obviously, I want it to work from a website. I have a div, with a script inside of it to get my online players from my server. But I have a 40 slot Minecraft server, and my div height is 300px. I'm just wondering, is there anyway of the div auto-expanding when the player list hits 290px? Will this be with html/css, or will it be javascript? HTML Code: <div id="players"> <center><span style="color: #FF0">Online Players: </span><br /><?php while($row = mysql_fetch_array($result)){ echo $row['player'] . "<br>"; } ?> HTML Code: #players{ width:205px; height:300px; margin-left:auto; margin-top:21px; background-image: url(../images/main.png); -moz-border-radius:10px; -webkit-border-radius:10px; background-color:#ffffff; border:1px solid black; opacity:0.6; filter:alpha(opacity=60); float:right; color: #FFF; } Can someone help me build a basic site for our school (k-12) kids to use to learn from their teachers. I liked the concept of the website coursera.org. I've attached the files that i download. We want to offer the service free to children in the neighborhood that dont get to go to school at all. I would appreciate it if someone can help me clean up this code and add comments to it so that I can update it with my basic HTML knowledge. Please take a look and advise. It is intended to be FREE ONLY, not for commercial use. thanks Navs Hey all, Is it possible to shut down video screen automatically after displaying the video? I mean, after video is over, is it possible to hide the video screen? ( I tried to use embed tag... <embed src="myVideo" autostart="true" /> ??) Thanks, Doron Hello, first post. HELLO! my video widget playlist on my index is a different size on my index.php but the correct size throughout the rest of my site. Its quite annoying, can anyone shed any light on this issue? thanks. http://www.brewrecords.net HTML Code: <?php get_header(); ?> <div id="content"> <div id="homepagetop"> <div class="textbanner"> <?php $recent = new WP_Query("cat=" .ot_option('hp_top_cat'). "&showposts=1"); while($recent->have_posts()) : $recent->the_post();?> <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <?php endwhile; ?> </div> <div id="homeslider"> <?php include(TEMPLATEPATH."/includes/slider.php");?> </div> <div class="homewidgets"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage Top Right') ) : ?> <div class="widget"> <h4>Widget Area</h4> <p>This section is widgetized. To add widgets here, go to the <a href="<?php echo admin_url(); ?>widgets.php">Widgets</a> panel in your WordPress admin, and add the widgets you would like to <strong>Homepage Top Right</strong>.</p> <p><small>*This message will be overwritten after widgets have been added</small></p> </div> <?php endif; ?> </div> </div> <div id="homepage"> <?php include(TEMPLATEPATH."/sidebar_left.php");?> <div class="homepagemid"> <h3><?php echo cat_id_to_name(ot_option('hp_mid_cat')); ?></h3> <?php $recent = new WP_Query("cat=" .ot_option('hp_mid_cat'). "&showposts=" .ot_option('hp_mid_num') ); while($recent->have_posts()) : $recent->the_post();?> <div class="homepagecontent"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-thumbnail' ); ?></a> <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div> <?php endwhile; ?> </div> <?php include(TEMPLATEPATH."/sidebar_right.php");?> </div> </div> <!-- The main column ends --> <?php get_footer(); ?> This may be a relatively easy answer but here we go.... HTML Code: <a href="audio.wav">Play this wav file!</a> The above is just a simple example but my problem is that no matter what I keep getting prompted for a download... Is there any specific reason why IE7 cannot directly access wav files or is this issue due to security settings.... Normally, in the past I haven't had an issue but at this time I am at a loss.... Any help would be appreciated... Thanks, Dark_Jackal Hey, On my site i have currently got windows media player to play an embedded wma file Code: <object id="MediaPlayer" height=46 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> <param name="filename" value="Windows XP Startup.wma"> <param name="Showcontrols" value="True"> <param name="autoStart" value="True"> <embed type="application/x-mplayer2" src="Windows XP Startup.wma" name="MediaPlayer"></embed> </object> That's my current source code for it ideally i would like to make it have the playlist option so on the playlist they can double click which songs they would like to listen Is this possible Cheers Lolium P.s, would it be possible for people who view the web page to browse the directory were the audio files will be kept? so they can choose which song to play?? I'm trying to playback an mp3 from within a table cell using a <a href> link. I don't want to use Flash and also don't want to use the HTML5 <audio> tag. I found this code Quote: function DHTMLSound(surl) { document.getElementById("dummyspan").innerHTML= "<embed src='"+surl+"' hidden=true autostart=true loop=false>"; } <span id=dummyspan></span> <form> <input type="button" value="Play Sound" onClick="DHTMLSound('success.wav')"> </form> and tried to incorporate it into the page. No luck. I think should be able to add the onClick part to the <a href> and have it play, but I get nothing. Thanks for any help, Mei Hi everyone. I am working on a project with a few friends. The site is designed for people who are illiterate and so we are looking into how we could go about having audio cues play whenever the user hovers over a button or a section of an image map. If anyone would know of a good tutorial on how to do so in html5 it would be appreciated. Hello, I'm creating a site that requires the inbuilt audio player to keep streaming music between page loads. What coding options are available for this, HTML, PHP or otherwise? Regards Eddie I want to be able to add a mp3 audio file of a sermon to a church website I am building. I have done searches and find a lot of "embed" code, but none of these work. Nothing shows on the web page. What is the simplest way of doing this. I understand "embed" is not a legal word. I have tired "Object", but nothing shows using this command either. Any help will be appreciated. Lawrence My "BYO AUDIO" had a problem where it was fine with Firefox, but on IE it would keep playing even if it was paused! So, I got some guy to fix it and now it works great in IE, and the audio dragbar or anything doesn't even show up in Firefox!! I have no idea how this could have happen, all I know is he did something related to "Playweb". If anyone knows, that would be great. Thanks! Link: http://tinyurl.com/yhwe37e Hi, What is the html code to have a Youtube video on my website? Is it possible to embed just the Audio with a stop, pause, progress display? What is the html for this How to play an audio file in HTML? _______________ I am designing a web page using Wordpress and have a rudimentary but working knowledge of HTML and have resources to help, so bear with me... My web site calls some audio files and they work fine. The line I am using is (a href=" url ") announcement (/a) Substitute appropriate GT & LT symbols accordingly... When I activate the page, the audio player covers the entire screen and all I get is a slide bar showing the progress of the audio track. Very boring,... What can I do to place an image there or change the size of the image to allow other image or words to be on the screen. I would appreciate it if I could get a sample of code to tweak. <object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height="0" width="0" data="http://www.youtube.com/v/link&autoplay=1&rel=0"> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value="http://www.youtube.com/v/link&autoplay=1&rel=0" /> </object> I want to add a code to make the YouTube audio off. Any ideas? |