01-29-2010, 08:36 AM
Winston wrote:
Is there a way to force Flash video to play using QuickTime in Safari?
Place a link in your Bookmarks Bar and associate this javascript with it:
javascriptfunction%20()%20{var%20video_id%20=%20null;var%20video_hash%20=%20null;var%20video_player%20=%20document.getElementById(%27movie_player%27);if%20(video_player)%20{var%20flash_variables=video_player.attributes.getNamedItem(%27flashvars%27);if%20(flash_variables)%20{var%20flash_values=flash_variables.value;if%20(flash_values)%20{var%20video_id_match=flash_values.match(/video_id=([^(\&|$)]*)/);if%20(video_id_match!=null)%20video_id=video_id_match[1];var%20video_hash_match=flash_values.match(/t=([^(\&|$)]*)/);if%20(video_hash_match!=null)%20video_hash=video_hash_match[1];}}}if%20(video_id==null%20||%20video_hash==null)%20{var%20args=unsafeWindow.swfArgs;if%20(args)%20{video_id=args[%27video_id%27];video_hash=args[%27t%27];}}if%20(video_id==null%20||%20video_hash==null)%20return;var%20yt_mp4_path%20=%27http://www.youtube.com/get_video?fmt=18&video_id=%27+video_id+%27&t=%27+video_hash;var%20div_embed=document.getElementById(%27watch-player-div%27);if%20(div_embed)%20{div_embed.innerHTML=%27%3Cembed%20src=\%27%27+yt_mp4_path+%27\%27%20type=%22video/mp4%22%20width=640%20height=500%20scale=\%27aspect\%27%3E%3C/embed%3E%27;}})();
It will work for YouTube videos and possibly others.