2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cordova カメラプラグインをchromeで使う方法

Posted at

メモ

cordovaをchromeで確認をする時にカメラを使う必要があったが、カメラが使えなかったので、プラグインの中身を少しいじった。

内容

以下のようなエラーがでた

Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.

調べるとcreateObjectURLは使えないということだったので、直す。

platforms/browser/platform_www/plugins/cordova-plugin-camera/src/browerのディレクトリ内にCameraProxy.jsがあるので105行目あたりを直す

CameraProxy.js
video.src = window.URL.createObjectURL(localMediaStream);

以下のように直す

CameraProxy.js
video.srcObject = localMediaStream;

これで使えるようになると思います。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?