Support for the Web MIDI API has been added to Chrome Canary since early 2013.
Why then, when I type requestMIDIAccess in the JavaScript console and hit enter, do I get "ReferenceError: requestMIDIAccess is not defined"?
According to official documentation, it should be a defined function.
What gives?
The Web MIDI API is available by default only in Chrome versions 43 and newer.
In earlier versions it is not enabled by default, but can be enabled as an experimental feature flag. In Chrome, load the special URL chrome://flags and search within the page for "Enable Web MIDI API".
The options on the flags page require the browser to be restarted before they will take effect. The features hidden behind these flags are in an experimental state and are subject to change at any time, so the API in older versions may differ from what is available in Chrome 43.
Note also that the requestMIDIAccess function is a method of window.navigator, not directly of window. Therefore you need to call it as navigator.requestMIDIAccess.
Also note that after you plug-in a new MIDI device, you may need to quit and restart Chrome. It does not seem to handle dynamic adjustment of the device list.
Related
As far as I know, in browser, such as Chrome, sharing desktop or application needs a Chrome Extension to work, eg:
chrome.permissions.request({
permissions: ['desktopCapture'],
}
But why does Google Hangouts do not need any extension to capture desktop?
Is there any API of JavaScript for this?
As of now, Google Hangouts does use an extension, it's just integrated into Chrome to the point of not being visible.
Source: Chromium issue to remove this special treatment
You can test that it is (stealthily) installed by manually opening
chrome-extension://nkeimhogjdpnpccoofpliimaahmaaome/background.html
At the same time, work is ongoing to support WebRTC spec for screen sharing (getDisplayMedia) in Chrome. It's not yet enabled by default in released Chrome versions, but will be very soon (code is already in the codebase).
Implementation tracking: Chromium issue
Task: Goal is to get all the functions which are triggered by installed extensions.
Expected Output: Javascript function calls, similar to what appears in timeline panel.
Description: As mentioned above I want to get the timeline data from chrome. For that I am using timeline feature of chrome remote debugging protocol to get timeline data using chrome javascript debugger API. I am starting a debuger with following code:
chrome.debugger.attach({ tabId: tabid }, version, onAttach.bind(null,tabid);
chrome.debugger.sendCommand({ tabId: tabid }, "Tracing.start");
However when I ran this code I get an error which states that timeline is deprecated, use tracing. Although official documentation haven't mentioned that timeline is deprecated. I have also tried tracing which removes the error but still no event is captured. Is there any issue of flags?
After reading code of Chrome Apps & Extensions Developer Tool, I found out that chrome.activityLogPrivate API to log all the events by different extensions. However, I am not able to run it by calling inside my extension, it remains undefined. I am not able to find documentation of this extension also.
Stable 1.1 Debugging protocol has no "Tracing", however, the "tip of the tree" docs say exactly this:
Timeline domain is deprecated. Please use Tracing instead.
It should be a warning only, since:
As of Google Chrome 31, we commit to supporting v1.1. All subsequent 1.* versions of the protocol are going to be backwards compatible with 1.1. Our protocol backwards compatibility commitment is:
No commands or events are removed from the protocol.
No required parameters are added to the commands.
No required parameters are removed from command responses or events.
So your commands should work normally.
chrome.activityLogPrivate API is what it says on the tin - private. It is only enabled for specific whitelisted extensions in Chrome's code, and it's not publicly documented.
So no, you cannot use it unless you use hacks like this one, which are not guaranteed to work.
I am able to achive it in firefox by folowing below steps:
make my server https
append my domain to the user preference media.getusermedia.screensharing.allowed_domains in about:config to whitelist it for screen sharing.
use constraint like {video: {mediaSource: "screen"}},
but in chrome, I am getting totally lost.
most places keep telling: You'll need to first enable the flag called Enable screen capture support in getUserMedia() in chrome://flags. ( but I am unable to find this flag anywhere)
I have checked Muaz Khan's screen share plugin, it works great, but afraid that it is coupled with other WebRTC experiment projects, and I am not sure how to customize the plugin to my project.
At this junction, I have come to an understanding that, without plug-in or flags, cannot capture the desktop mediastream.
so what I would like to know is, what is the flag I must enable/ what must be part of a plug-in written from scratch to make chrome support capturing desktop the same way it allows us to capture camera.
In Chrome/Chromium you cannot use "standard" Javascript to capture users screen anymore.
It was replaced by the chrome.desktopCapture API, which is exclusive for Chrome extensions.
The example you're providing rely in this API and an extensions. It's plugin free but not extension free.
The enable-usermedia-screen-capture flag was removed from chrome://flags/ in Chrome M36 (Chromium Issue 347641).
For testing or experimenting, the feature can still be enabled when starting Chrome with chrome --enable-usermedia-screen-capturing (tested in Chrome 68).
Screenshot:
The Chrome Platform Status also highlights a MediaStream.getDisplayMedia() implementation, which will allow developers to record or share the screen from the browser without any plugin. The specification for this can be found in the Screen Capture Editor's Draft.
Is there a way through JavaScript or a web service to see if a plug-in installed in Firefox is being blocked by Mozilla? In particular, on my web site, I want to be able to tell if Mozilla is blocking an outdated version of Adobe Flash and adjust our UI accordingly.
The address that Firefox uses to download the blocklist is defined as extensions.blocklist.url preference:
https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/
Fortunately, not all of these parameters are required, this address will work to download the current blocklist:
https://addons.mozilla.org/blocklist/3/%7Bec8030f7-c20a-464f-9b0e-13a3a9e97384%7D/21.0/
This is the ID of Firefox and the version number of the current release, so the blocklist could be different for other Mozilla applications and other Firefox versions. Looking through https://addons.mozilla.org/blocked/, there are some items listed as "for Firefox version n.n.n and higher", some are listed as "for Firefox and SeaMonkey" and others again as "for all Mozilla applications". Still, it seems that the blocklist for the current Firefox version should be the most complete one.
You can download and process this file in a web service, then adjust the behavior of your web application accordingly.
I'm having serious trouble in getting getUserMedia to work in Firefox 20. What I would need is a simple webcam capture.
I've tried a couple of examples over the web, here's one for example:
http://www.html5rocks.com/en/tutorials/getusermedia/intro/
Is it so that Chrome is actually the only browser supporting the getUserMedia properly today? I've also tried photobooth.js with no luck. Any good solutions around?
Thanks in advance.
Chrome 21+, Firefox 17+ and Opera 12+ actually support getUserMedia (been using it as well). But Chrome and Firefox still prefix them with webkit and moz, respectively, so you need a simple polyfill to patch up the differences.
I read somewhere before that the initial versions of these browsers that supported these features had them disabled by default. You need to enable them first. As far as I have used these browsers, the latest versions have them enabled (FF20 and GC26)
In order to use getUserMedia, it has to be hosted on a web server. An error will be thrown if you try to run the page locally. If you have NodeJS installed, you can run this little NodeJS script to run a portable static file server.
in webkit you hve to prefix webkit and in moz you need prefix moz . you can use adapter.js as polyfil so you can call the same function to work in all web rtc enabled browser . And web rtc still have problem in chrome to moz or moz to chrome Peer connection
you are needed to enable flags in chrome 24 or less . but with chrome 25+ it is flagless