Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Digital Lifestyle
Web Design and Hosting
Safari and Flash Video
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Creativedot" data-source="post: 1384749" data-attributes="member: 200916"><p>Hello..</p><p></p><p>i am building a site where it has lots of video on it and i need it to work on all browsers.</p><p></p><p>I found that browsers need different video containers to work... Safari needs HTML5 , Firefox and Chrome need Flash. </p><p></p><p>Here is the code i am using :</p><p></p><p></p><p>[CODE]// Player support options</p><p>define('PLAYER_FLASH', 0);</p><p>define('PLAYER_HTML5', 1);</p><p>define('PLAYER_HTML5FALLBACK', 2);</p><p>define('PLAYER_UNSUPPORTED', 3);</p><p> </p><p>// Returns a supported video player type for the user's browser</p><p>// Recognized extensions are: flv f4v mp4 m4v ogv webm</p><p>function getSupportedPlayerType($ext, $browser)</p><p>{</p><p> if ($ext === 'flv' || $ext === 'f4v')</p><p> return PLAYER_FLASH;</p><p> else</p><p> {</p><p> switch($browser)</p><p> {</p><p> case 'firefox':</p><p> case 'opera': </p><p> if ($ext === 'webm' || $ext === 'ogv')</p><p> return PLAYER_HTML5;</p><p> else if ($ext === 'mp4' || $ext === 'm4v')</p><p> return PLAYER_FLASH;</p><p> else</p><p> return PLAYER_HTML5FALLBACK;</p><p> break;</p><p> </p><p> case 'ie9plus':</p><p> case 'safari':</p><p> if ($ext === 'mp4' || $ext === 'm4v' || $ext === 'mov')</p><p> return PLAYER_FLASH;</p><p> else if ($ext === 'webm' || $ext === 'ogv')</p><p> return PLAYER_UNSUPPORTED;</p><p> else</p><p> return PLAYER_HTML5FALLBACK;</p><p> break;</p><p> </p><p> case 'chrome':</p><p> return PLAYER_FLASH;</p><p> break;</p><p> </p><p> case 'ipad':</p><p> if ($ext === 'ogv' || $ext === 'webm')</p><p> return PLAYER_UNSUPPORTED;</p><p> else</p><p> return PLAYER_HTML5;</p><p> break;</p><p> </p><p> // Ancient IE only supports Flash</p><p> case 'ie':</p><p> default:</p><p> if ($ext === 'webm' || $ext === 'ogv')</p><p> return PLAYER_UNSUPPORTED;</p><p> else</p><p> return PLAYER_FLASH;</p><p> break;</p><p> }</p><p> }</p><p> </p><p> return PLAYER_UNSUPPORTED;</p><p>}[/CODE]</p><p></p><p></p><p>The weird and annoying thing is that HTML5 in safari is not loading as fast as Flash and sometimes it just doesnt play at all... So i decided to use Flash ...everything seemed ok...i tested it on windows and OS different machines etc etc,...until a friend the other day told me that he couldnt view the video at all</p><p></p><p>Is Flash really unstable for safari? Whats the solution to this?</p><p></p><p>Many Thanks for reading this</p></blockquote><p></p>
[QUOTE="Creativedot, post: 1384749, member: 200916"] Hello.. i am building a site where it has lots of video on it and i need it to work on all browsers. I found that browsers need different video containers to work... Safari needs HTML5 , Firefox and Chrome need Flash. Here is the code i am using : [CODE]// Player support options define('PLAYER_FLASH', 0); define('PLAYER_HTML5', 1); define('PLAYER_HTML5FALLBACK', 2); define('PLAYER_UNSUPPORTED', 3); // Returns a supported video player type for the user's browser // Recognized extensions are: flv f4v mp4 m4v ogv webm function getSupportedPlayerType($ext, $browser) { if ($ext === 'flv' || $ext === 'f4v') return PLAYER_FLASH; else { switch($browser) { case 'firefox': case 'opera': if ($ext === 'webm' || $ext === 'ogv') return PLAYER_HTML5; else if ($ext === 'mp4' || $ext === 'm4v') return PLAYER_FLASH; else return PLAYER_HTML5FALLBACK; break; case 'ie9plus': case 'safari': if ($ext === 'mp4' || $ext === 'm4v' || $ext === 'mov') return PLAYER_FLASH; else if ($ext === 'webm' || $ext === 'ogv') return PLAYER_UNSUPPORTED; else return PLAYER_HTML5FALLBACK; break; case 'chrome': return PLAYER_FLASH; break; case 'ipad': if ($ext === 'ogv' || $ext === 'webm') return PLAYER_UNSUPPORTED; else return PLAYER_HTML5; break; // Ancient IE only supports Flash case 'ie': default: if ($ext === 'webm' || $ext === 'ogv') return PLAYER_UNSUPPORTED; else return PLAYER_FLASH; break; } } return PLAYER_UNSUPPORTED; }[/CODE] The weird and annoying thing is that HTML5 in safari is not loading as fast as Flash and sometimes it just doesnt play at all... So i decided to use Flash ...everything seemed ok...i tested it on windows and OS different machines etc etc,...until a friend the other day told me that he couldnt view the video at all Is Flash really unstable for safari? Whats the solution to this? Many Thanks for reading this [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
Digital Lifestyle
Web Design and Hosting
Safari and Flash Video
Top