HTML - Audio Player Is Off Position When I Click Play Button
I'm having a really odd problem with the html audio player. It looks fine if I don't click the play button, but the moment I click the play button, it would disappear and reappear around 15-20 pixels lower. Here is my code for a simple audio player:
HTML: Code: <div id="audioplayer"> <span class="eightonesmall" id="audiotext"> Background music control</span> <audio controls="controls"> <source src="music/liangzhuhualuowuhui.ogg" type="audio/ogg" /> <source src="music/liangzhuhualuowuhui.mp3" type="audio/mp3" /> </audio> </div> CSS: Code: body { margin: 0; padding: 0; width: 100%; height: 100%; overflow:hidden; background-image:url(../pictures/drawings/backgrounds/menubackgroundbubbles.png); background-position:center; background-attachment:fixed; } #audiotext { vertical-align:middle; color:#CCCCCC; } #audioplayer { position:fixed; top:10px; right:10px; border:3px double #FFF; height:30px; } The same problem occurs for an audio player that I've set to hidden, and will appear if I click an arrow and disappear if I click another arrow. It hides it and re-appears fine, just the player shifts down 15-20 pixels if I click play... HTML: Code: <div class="collapsearrow"> <img src="pictures/thumbnails/musicboxbuttons/collapsearrow.png" alt="collapsearrow" onclick="document.getElementById('song1').style.visibility='visible';"/>Liangzhu </div> <div id="song1" style="visibility:hidden;"> <img src="pictures/thumbnails/musicboxbuttons/contractarrow.png" alt="contractarrow" onclick="document.getElementById('song1').style.visibility='hidden';"/> <audio id="musicboxplayer" controls="controls"> <source src="music/liangzhuhualuowuhui.ogg" type="audio/ogg" /> <source src="music/liangzhuhualuowuhui.mp3" type="audio/mp3" /> </audio> </div> CSS: Code: #musicboxplayer { position:relative; width:86px; height:25px; } .collapsearrow { float:left; } #song1,#song2,#song3,#song4 { width:150px; float:left; } Does anyone know what's causing this? Thanks. Similar TutorialsHi, I have an album which has 5 to 6 audio files(wma). I used checkboxes to list the audio files. I want to select one or more of the audio files by ticking in checkbox and play those selected using a button. How can I do that using html? I see that many music sites use this functionality, but not sure how to code this using html? Can someone help? Note: I have already hosted the audio files and have the web url for all the wma files. Does anyone know how to position the <audio> player so it's stacked on top of a background image? If I make the player visible with <audio controls="controls">. I tried to treat it as an image by: Code: <style> <!-- this is the background image --> #container { display: block; margin-left: auto; margin-right: auto; position: relative; border:none; width: 380px; height: 633px; background-image: url("pictures/kohakuriver1.png"); background-position:center; <!-- this is the audio player --> #container audioplayer { position: absolute; border:none; left: 65px; width: 245px; height: 53px; #audio {top: 700px} </style> ... ... <body> ... <div id="container"> <audio controls="controls"> <source src="music/hupochuanClip.mp3" id="audio" type="audio/mpeg"/> <source src="music/hupochuanClip.ogg" id="audio" type="audio/ogg"/> </audio> </div> </body> It didn't work completely, it did move it to some odd place but not where I want it. Changing the height value won't have any effect (I tried changing it to like 7000px and it's still in the same place). Is it possible to simply add the word "Play" to an html web page, which, when selected, would play an audio file stored in my web page directory? If possible, can you provide the code? i'm guessing the web visitor would simply need audio player software on his/her computer? Which is on most if not all computers today. Correct? thanks. When I put in my code, it works just fine on my Mac in Safari or Firefox. However, when I test it on a PC in Explorer 7 or 8 it starts playing automatically. This is what my code looks like: Code: <audio controls="controls"> <source src="/media/GOAL.wav" type="audio/wav" autostart="false"/> <embed height="100px" width="200px" src="/media/GOAL.wav" /> </audio> The "autostart" code I put in apparently is wrong. Is there a way to fix this so it does not autostart in Explorer and any other browers? Thx. How to play an audio file in HTML? _______________ I'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. Hey all, I've built a website for my music and I'm fairly new to all this so bear with me. Essentially, I have two flash-based music players on my site. One is a simple single-track player that auto-plays some background music for the site. The functionality is limited to the user starting/stopping the music and adjusting the volume. The other is an advanced music player featuring a playlist of preselected tracks and allows the user to start/stop music, rewind, fast forward, adjust volume and select tracks in the playlist. This player does not start automatically. My question is this: when someone visits the site, the single-track background music player will start. Is there code that would allow the advanced music player, should it be turned on (i.e. someone selects a track and plays it), to override and actually stop the play of the single-track? TIA! I'm wondering if anyone knows if this is possible and if so how: I want to create a web page that will play a random audio file from a folder on my server. I'd like the user to hear the audio file and then try and identify it and be told whether they are correct or not and what the correct answer is. Can this be done with html or do I need to use flash? Any help would be greatly appreciated! Thanks. Can i use javascript to control the file that playing by the real audio plug in, i mean i embeded the plug in, and i want to dynamically assign the files by using the drop down listbox. I had tried it , but although i successfully set the filename, but cant control the start value. Another question is whether window media play can play real audion file or not ?? Thanks for answering. mother of the bride discount wedding dresses mother of the groom dresses Can i use javascript to control the file that playing by the real audio plug in, i mean i embeded the plug in, and i want to dynamically assign the files by using the drop down listbox. I had tried it , but although i successfully set the filename, but cant control the start value. Another question is whether window media play can play real audion file or not ?? Thanks for answering. mother of the bride dress discount wedding dress mother of the groom dress Can i use javascript to control the file that playing by the real audio plug in, i mean i embeded the plug in, and i want to dynamically assign the files by using the drop down listbox. I had tried it , but although i successfully set the filename, but cant control the start value. Another question is whether window media play can play real audion file or not ?? Thanks for answering. mother of the bride dress discount wedding dresses mother of the groom dresses Hello all. I am still new to HTML coding. I come from the dark side (flash) and am seeing the light anyway I am building a "flash alt" site and I am building it around the Cargocollective.com platform. and I DESPERATELY need a HTML or JAVA or some other iphone / ipad friendly music player for the site. I have been searching for weeks but all I keep finding are the same flash plugs that make the whole concept redundant. any help, guidance, or advice on this matter would be greatly appreciated.... thanks 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. Can some one help me with or direct me to some HTML code that I can use to do one of the following. A. After a visitor of my website clicks on some text, a box appears below the text that will play an embedded Youtube video (on autoplay). B. After a visitor of my website clicks on some text, an video that wasn't on autoplay previously begins to play. Note that I want the user to click on some text, not flash. Thank you. Hi, New here. Tried browsing for this but came up short. Would like to try and write the code myself for this, but it seems like a pretty unoriginal concept. What I need is a way to make an image play a track with one mouse click. Thanks for any help you can give me. - Mopset I have a site I'm working on, and I have a flash demo movie that users can view. However, in Internet Explorer (so I'm told) You have to click once to "focus" on the flash movie, then you have to click again on the actual play button. You can view the problem from IE6 he (not sure about IE7) Click on the "view online demo" button below the header, and the movie slides out. http://www.jhilgert.com/EM/ I would like IE to focus on the movie without clicking, so users only have to click once to "play" the movie. Any help is greatly appreciated, and feel free to talk to me like I'm a fifth grader, I really would like to understand this. Hey guys... I'm new and have looked everywhere. I can get an embedded WMV/AVI/etc. to work on my website and I can even position the file to where I want using my screen's resolution 1440X900, but when I view this website in a 1024X768 resolution, the embedded media file is not where it's supposed to be. Can anyone please please help me figure out how to embed a windows media file and keep the same position on the webpage for all resolutions (800X600 and up)... I have created the webpage with Adobe Imageready, and then edited the HTML accordingly to embed the media player. Please help.... Thanks.... Hello, I have a client were working with. He uses myspace. He wants a youtube video to autoplay from youtube. He wants it to look sleek and doesn't want the controls buttons to show. I've read this is possible but can't get the div code right. It's an HD video and it's height="480" width="720". We came across this url: http://www.createblog.com/myspace-sc...eo-top_bottom/ and We found this code as an example it says: Where it says YOUTUBE URL HERE insert your youtube embed url, not the url of the YouTube page. Change the first 380 and the 230 to change the video's size and the -90 to position the video. **** <div style="width:380px; height:230px; overflow:hidden!important; text-align:center;"><br /> <object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height="410" width="380" style="position:relative; top: -90 px;" data=" YOUTUBE URL HERE "> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value="YOUTUBE URL HERE" /> <param name="wmode" value="transparent" /> </object> </div> **** This is our code were tried but it is not working? can you please help us. Thank you in advanced. Our code we tried: **** <div style="width: 720 px; height: 480 px; overflow:hidden!important; text-align:center;"><br /> <object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height=" 410 " width=" 380 " style="position:relative; top: -90 px;" data=" http://www.youtube.com/v/vaKuFww3ljM&ap=%2526fmt%3D18&loop=1&controls=0&showinfo=0&autoplay=1&&iv_load_policy=3 "> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value=" http://www.youtube.com/v/vaKuFww3ljM&ap=%2526fmt%3D18&loop=1&controls=0&showinfo=0&autoplay=1&&iv_load_policy=3 " /> <param name="wmode" value="transparent" /> </object> </div> **** Hello, I've done alot of seaching and haven't found to many articles on this. I would like to embed a youtube video on my site, but don't want to play the audio that goes with it. I tried adding &volume=0 after the tag, but this doesn't work. Any ideas!! Much thanks in advanced! here's the code used: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="540" width="650"> <param name="allowScriptAccess" value="never" /> <param name="allowNetworking" value="internal" /> <param name="movie" value="http://www.youtube.com/v/aKuFww3ljM&ap=%2526fmt%3D18&loop=1&autoplay=1&volume=0" /> <param name="wmode" value="transparent" /> <embed type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" src="http://www.youtube.com/v/aKuFww3ljM&ap=%2526fmt%3D18&loop=1&autoplay=1&volume=0" height="540" width="650" wmode="transparent" /> </object> Ok, I'm wanting to add a text box to my site and when you click a button it'll open the letters in the text box as a url for my site For example, in the text box I have hello when I click the button it'll open up http://htmlforums.com/hello.htm I also need to know how to add .htm to after the string in the text box when you click the button. I also want this to open in the same window. Any help please? Thanks. |