Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some comments for windows users. #204

Merged
merged 2 commits into from
May 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions usb-label-printer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ var productId = 0x0021; // changed from 0x0020

(thanks @kjantzer for the [information](https://github.com/GoogleChrome/chrome-app-samples/issues/126#issuecomment-29547981))

### Windows issues

Some Windows device drivers take ownership of the device and don't allow Chrome to connect to them. If openDevice or findDevice doesn't work for you, you can try to use a generic low level driver instead.
For more info, check this [chrome-app-samples issue](https://github.com/GoogleChrome/chrome-app-samples/issues/203).

LICENSE
=======
Expand Down
12 changes: 6 additions & 6 deletions usb-label-printer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function printCanvas() {

var info = {
"direction": "out",
"endpoint": 2, // 2 is the Bulk OUT Endpoint
"endpoint": 2, // 2 is the Bulk OUT Endpoint. You may use chrome.usb.listInterfaces to figure which address to use for Outputing data.
"data": data
};
chrome.usb.claimInterface(device, 0, function() {
Expand Down Expand Up @@ -298,7 +298,7 @@ function ditherImg(imgData) {
navigator.webkitGetUserMedia({audio: false, video: true}, function(videoStream) {
stream = videoStream;
video.src = webkitURL.createObjectURL(stream);
video.style.display = 'block';
video.style.display = 'block';
video.play();
}, function(e) {
console.error(e);
Expand All @@ -315,19 +315,19 @@ function ditherImg(imgData) {
tempCanvas.setAttribute('height', height);
}, false);


var takePicture = function() {
stream.stop();
video.style.display = 'none';
tempCanvas.width = width;
tempCanvas.height = height;
tempCanvas.getContext('2d').drawImage(video, 0, 0, width, height);
var data = tempCanvas.toDataURL('image/png');
logoImg.src=data;
};
logoImg.src=data;
};

video.addEventListener('click', takePicture);



var updateCanvasSize = function(e) {
Expand Down