{"id":698,"date":"2007-04-20T12:31:21","date_gmt":"2007-04-20T20:31:21","guid":{"rendered":"http:\/\/www.wiredatom.com\/blog\/2007\/04\/20\/overlapping-audio-tracks-in-safari\/"},"modified":"2007-04-20T12:35:02","modified_gmt":"2007-04-20T20:35:02","slug":"overlapping-audio-tracks-in-safari","status":"publish","type":"post","link":"https:\/\/www.wiredatom.com\/blog\/2007\/04\/20\/overlapping-audio-tracks-in-safari\/","title":{"rendered":"Overlapping Audio Tracks in Safari"},"content":{"rendered":"<p>Apple&#8217;s Safari is definitely a work in progress with the kind of <a href=\"https:\/\/www.wiredatom.com\/blog\/2006\/07\/28\/safari-unable-to-load-nested-xhmhttprequest-objects\/\">weird<\/a> <a href=\"https:\/\/www.wiredatom.com\/blog\/2006\/10\/29\/more-ajax-woes-in-safari\/\">bugs<\/a> I keep running into. One of the bugs I hadn&#8217;t documented about is overlapping audio tracks in Safari under a very special circumstance.<\/p>\n<p>The issue is this: When using AJAX to load one quicktime clip over another, if the first movie hadn&#8217;t finished playing as the second movie is loaded in via AJAX, the user will hear the audio tracks of both movie clips playing at the same time. I have no idea why that is, and I am not even going try to guess. And apparently this has not been documented (or the little that I&#8217;ve found in Google) by any developer that I know of&#8230; <\/p>\n<p>Fortunately there&#8217;s a quick fix to this problem (or my clients will drive me crazy). The upside is that this problem can be mitigated with a quick Javascript since the Quicktime object supports Javascript controls. <a href=\"http:\/\/userwww.sfsu.edu\/~infoarts\/technical\/howto\/sound\/wilson.quicktimejavascript.html\" target=\"_blank\">And here&#8217;s how it&#8217;s done<\/a>. We all know websites, especially college ones, are reliable and all, you know, their content never changes and they never disappear&#8230; But I decided to keep a <a href=\"\/misc\/Control_Quicktime_Media_via_Javascript.pdf\" target=\"_blank\">snapshot of it<\/a> anyway for future reference. Apple also has a couple of <a href=\"http:\/\/developer.apple.com\/documentation\/QuickTime\/REF\/QT41_HTML\/QT41WhatsNew-72.html\" target=\"_blank\">decent<\/a> <a href=\"http:\/\/developer.apple.com\/documentation\/QuickTime\/Conceptual\/QTScripting_JavaScript\/index.html#\/\/apple_ref\/doc\/uid\/TP40001526\" target=\"_blank\">documentations<\/a> on the subject.<\/p>\n<p>Basically I used Javascript to stop playback of the first video before the second one is even loaded in by embedding the event as<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">onClick<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>. In some cases, it may help to dynamically embed it in the<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; body&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tag as<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">onLoad<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>.<\/p>\n<p>An interesting side note: Javascript documentation says that<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">onLoad<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>events can be triggered with<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; body&gt;, &lt; iframe&gt;, &lt; frameset&gt;, &lt; img&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>and<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; object&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tags in HTML, but in reality, use of<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; iframe&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>and<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; object&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>are weird among browsers.<\/p>\n<p>IE6, IE7, Firefox, Opera &#8212; support<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">onLoad<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>in the<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; iframe&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tag, but they do not support it in the<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; object&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tag.<br \/>\nSafari &#8212; the only loner browser that supports<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">onLoad<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>in the<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; object&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tag, but NOT the<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&lt; iframe&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>tag&#8230; <\/p>\n<p>Sometimes it can really suck being a web developer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apple&#8217;s Safari is definitely a work in progress with the kind of weird bugs I keep running into. One of the bugs I hadn&#8217;t documented about is overlapping audio tracks in Safari under a very special circumstance. The issue is this: When using AJAX to load one quicktime clip over another, if the first movie &hellip; <a href=\"https:\/\/www.wiredatom.com\/blog\/2007\/04\/20\/overlapping-audio-tracks-in-safari\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Overlapping Audio Tracks in Safari&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21,10],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-coding","category-geek-stuff"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p54IqZ-bg","_links":{"self":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}