JS WebAPI と WindowsDisplayAPI の間で共通の表示ラベルを見つけようとしています。
mediaDevices から画面情報を取得しようとすると、プライマリ モニターに「screen:0:0」というラベルが付けられました
navigator.mediaDevices.getDisplayMedia({video: true, audio: true})
.then(stream => {
document.getElementById('vid').srcObject = stream
document.getElementById('vid').play
console.log(stream.getTracks()[0].label)
}
次に、WindowsDisplayAPI から画面情報を取得しようとしましたが、プライマリ モニターに「\\.\DISPLAY1」というラベルが付けられました。
注: 上記の手順を python と .net ライブラリを使用して結び付けましたが、どちらも同じ結果 ['\\.\DISPLAY1'] が得られました。画面情報を取得するために使用したpythonコード。
from screeninfo import get_monitors
for m in get_monitors():
print(m)
私の質問は、
WebAPI は画面情報をどのようにマッピングしますか? WebAPI 情報を WindowsDispalyAPI 情報にマップする方法はありますか?
参考までに、JS WebAPI ドキュメント - https://docs.microsoft.com/en-us/uwp/api/windows.graphics.display?view=winrt-22000
コア Windows ディスプレイ API ドキュメント - https://docs.microsoft.com/en-us/uwp/api/windows.graphics.display?view=winrt-22000
私が使用した WindowsDisplayAPI .net ライブラリ - https://github.com/falahati/WindowsDisplayAPI
私が使用した Python screeninfo パッケージ - https://github.com/rr-/screeninfo
ありがとう!!!