The navigator is pre-defined function of JS. When the navigator is called from Lightning, we are getting the mediaDevices property from navigator Object. It will return Undefined.

lighhtning Locker API Viewer is provide to see which standard DOM APIs are supported by Lightning Locker.

It says below standard API's are supported from version 46 and above

  1. navigator
  2. mediaDevices

Locker API Viewer URL : https://developer.salesforce.com/docs/component-library/tools/locker-service-viewer.

In our lightning component API version is v49. But unfortunately we are not getting the mediaDevices property value.


mediaDevices please see the attachment

If any one give solution, we will really appreciate

2 Answers 2


sorry to inform you but this is just not (yet) supported by the navigator property on the current API version v50.

There is an Salesforce Idea open talking about this issue since a few years however. maybe with enough activity they will notice the issue.


You could however try to set your API version to v39 as there is no Locker Service there, leaving you with the untampered with navigator object including the mediaDevices property. But that could either have effects on your implementation because functionality you used might not be available on that version and of course, from a security point of view, this is not the best thing to do.


Yes this looks like not supported yet in v50 . I am getting undefined value when trying to access navigator.doNotTrack attribute . I tried to solve this by passing doNotTrack attribute from VF page to LWC component . But that solution does not work if we drag and drop LWC component .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .