How to detect if Safari power saver mode is enabled? - macos

I'm experiencing issues with the YouTube player failing to load when the power save mode is enabled in Safari 6.1 and 7 on OSX. The issue doesn't happen if the youtube user is using the experimental HTML5 player, but it's still in beta and most people are still using the Flash player. The "disable plugins to save power" option is on by default in most new versions of Safari and this causes the YouTube iFrame API to enter an endless loop as it tries to initialize the player.
Is there any attribute on the window or navigator objects that would possibly indicate that the power save mode is enabled so that I can warn users?

This issue is semi-intentional. The Power Saver mode in Safari deliberately stops flash content. You can read more about it in this article.
If the flash content is 'front and centre' (within a 3000 x 3000 pixel boundary starting at the top left corner of the document) it should still play. So it may help, if the youtube video is off to the side of the page, to try and centre it. Apple says content will not play if it is in the margins (see this page under the Safari Power Saver heading).

Well i do not think there is any readable JS property to know that,
if so Apple would have a flawed design, and the Safari Users would get nagged to disable that mode, in order to have the web site working "properly" ...
What you could do of course is to try to make a server call on your web site via flash, and then try to read the changed session variable via JavaScript, then you would know ...

Related

Why does youtube video work fast on Chrome than firefox?

As a java UI & Backend developer for past 10 years, What surprises me is the following browser behavior :
Firefox : I click on a related video (youtube website) and it takes some time to figure out the video and then buffering starts for the video.
Chrome : I click on a related video (youtube website) and it starts as if it was already buffering or buffer ready. This is surprising as there is no delay.
(note: If you have a very fast connection, you may not notice it. Slow it down by some parallel network related activity and then experiment)
My Concern is : Is Chrome browser programmed to preload some data related to youtube related videos to give a faster experience?
Google owns youtube and it makes sense for doing so.
But doing so,seems weird. Its like unusual customization for a particular website from a sea of websites.
Anyone knows a thing or two about it?
I noticed that when you install firefox you have to install flash manually, while chrome does not require that, i think it comes with it, or does not use flash at all. It might have something to do with that..

AVFoundation CoreMedaIO virtual camera not being detected in browser

I have been testing the Apple CoreMediaIO sample camera on Mac OS X 10.9 Mavericks.
Locally the applications i have tried could detect and recognize the sample camera automatically (like Skype, AVRecorder - Apple's AVFoundation capture API sample)
In Mozilla Firefox and Opera browsers the camera has been detected automatically on the Flash Player based sites that i have checked (for example Adobe's Cirrus sample), although in Safari and Chrome the sample camera was missing from the video input devices list.
How could i make these browsers recognize the CoreMediaIO sample camera on such a website?
Safari:
The problem causing this to happen is that on Mavericks the current Safari uses a sandboxed Flash Player which refuses to detect the sample camera.
You can solve this by allowing sites to run Flash Player in unsafe mode: (make sure you have allowed the website to use your cameras on the Flash Player pop-up window)
Go to Safari/Preferences.
Go to the Security page.
Click Manage Website Settings.
On the left pane select Adobe Flash Player.
Select the website you have allowed to use the camera and want to use the camera with.
Click on the combobox.
Select Run in Unsafe Mode.
On the pop-up window choose Trust.
Refresh the website.
From now on, Safari can detect the sample camera on the specific website.
I could not find a better/all-around solution yet.
Chrome:
This problem is mainly based on the Mac OS X AVFoundation API being disabled by default in the current Chrome (the CoreMediaIO sample uses it).
There are various methods to make Chrome detect the sample camera.
So far my best solution is the following:
Open a new tab in chrome.
Go to chrome://flags.
Search for "Enable use of Mac OS X AVFoundation APIs, instead of QTKit, Mac" entry.
Set the above-mentioned entry to Enabled.
Relaunch Chrome.
As far as i could get, the key AVFoundation flag's internal ID is IDS_FLAGS_DISABLE_AVFOUNDATION_NAME.
As long as you try to use AVFoundation based things in Chrome (OS X Mavericks) you will probably need this. (I don't really know why the default value is disabled, but i hope they will change it as Apple tends to deprecate QTKit.)
Other solutions that i prefer less:
Disabling Pepper Flash (PPAPI) and using NPAPI Flash Player instead.
Open a new tab in chrome.
Go to chrome://plugins.
Hit the plus (+) sign in the upper right corner next to Details.
Search for the Adobe Flash Player plugin section.
Locate the Pepper Flash version (PPAPI type).
Click Disable.
Refresh the website.
Google intends to deprecate NPAPI Flash Player soon, which leaves the Pepper Flash (PPAPI) as the only alternative, that was the reason to try and find a better solution than this. I don't recommend to rely on this solution considering the future of NPAPI Flash Player.
There is another temporary solution involving Mozilla Firefox. I don't know why exactly this works and i think this might easily change in the future, but i tried and verified that it works at the moment:
Close Chrome entirely (Chrome/Quit Google Chrome or Command+Q).
Start Firefox.
Go to the website you would like to use the camera with (any Flash Player based site works that calls for camera list).
Open Chrome.
Close Firefox.
Go to the website in Chrome.
If you close Chrome you will have to redo the process from Step #2. It seems like Firefox initializes something that makes the Chrome startup different and causes it to detect the sample camera. I don't recommend to rely on this though.

Flash, Internet Explorer and 60fps speed

I have created a Flash game which plays at 60 frames per second. It plays fine in all browsers except Internet Explorer 8 and 9; in these cases, it seems to be half (or less than half) the intended frame rate.
I have tried embedding it even by using Flash Authoring Tool's own html code, as well as the swfobject method, but to no avail. In all cases, GPU acceleration is enabled.
It's also not a matter of CPU performance, since it is tested on the same computer with all other applications closed. The problem only rises with IE.
One final peculiarity to consider : I have loaded FRAPS to count the actual rendering frame rate and it shows it to be 60 fps (inside IE), although it's crystal clear that this is not the actual speed achieved.
sounds like flash isn't properly installed on your IE browser
Try the following (assuming you have Adobe Flash Player v10.2 installed):
• Restart your computer.
• Open Internet Options (located in the Control Panel).
• Click on the Advanced tab.
• Click on the Reset button, place a check next to Delete Personal Settings and then click Reset.
• Launch IE9 and Adobe Flash Player will be properly enabled.
then try your tests again
GPU acceleration is not always the best solution. It depends on the way you have code the app.
Try another wmode value.

Possible to turn on logging / debugging, or otherwise solve a streaming issue in Flash?

I know virtually nothing about Flash so I'm kind of casting about in the dark.
I have the misfortune of being a BT customer, and whilst I have reasonable bandwidth (can view streaming high res video fine) I always have problems listening to radio programmes from the BBC. I think it could be buffering due to traffic shaping, or it could be the Flash applet used to play the content, or something else.
Is it possible to bring up some kind of debugging console, or view some kind of error log to see if there is some diagnostic information that could be useful in finding the problem?
Chrome/Firefox/Safari using Adobe Flash player 10.2.159 on Mac OS X 10.6
EDIT: In the debug Flash player the 'debug' option is greyed out, suggesting that the swf was compiled without debug symbols. This was created by a third party (BBC) not me.
You could install the debug Flash Player, so you should see if an error occurs (a popup will appear on the screen) during the streaming.flash player debugger download
You should also disable flash player plugin and turn on debugger. If you're using Chrome type chrome://plugins the disable flash player and enable Adobe Shockwave for Director Netscape plug-in.

iPad - Test an HTML5 site on a Win7 PC

I'm looking to target a website specifically for an iPad but we don't have any Macs in house for testing. What's the most accurate way to test the site on a PC? I image I could use the Safari browser and shrink the window down to approximate the iPad screen size but I wonder if there's a better method out there.
If you target a website specifically for a particular device, buy that particular device. This doesn't only apply to iPad.
Two caveats I noticed a lot of websites have for a touch-oriented device like an iPad, iPhone:
The mouse-hover event isn't generated. So, the HTML/CSS/Javascript menu structure which works without clicking on a WebKit browser (like Safari) on a mouse-oriented device might stop working completely.
The scrolling event (coming from a flick of a finger) is not passed to elements inside a page; instead it just scrolls the entire page. A subelement shown with a scroll bar on a non-touch-oriented device might be shown without the scroll bar at all. So, sometimes you lose the ability to scroll inside a subelement.
There might be other caveats. It's really difficult to imagine all the way a device might behave differently from a mouse-oriented device; so, buy an iPad.
By the way, it's of no use to buy a Mac in this situation: Safari on a Mac still behaves (as far as the mouse/touch events are concerned) rather differently from Safari on an iPad/iPhone. An iPad can be paired with a Windows PC.
See this Apple document for a few advices for preparing a web page for the iPad.
I'd just use Safari, as the mobile version uses the same rendering engine (though possibly modified to fit the iPads resources).
It should display the same, if not close.
You can try to use online imitation services.
For example http://app.crossbrowsertesting.com/, or https://saucelabs.com/. They provide lots of imitations environments, for different devices and OS. You can test the site, that is already in the web, or your local files.
I myself am working currently with app.crossbrowsertesting.com for the first time. It really shows the problem, that the client encountered on his iPad. Also have good notices about these services from experienced developer, a friend of mine.

Resources