Skip to content

Commit

Permalink
built website from c83010e
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Aug 25, 2015
1 parent c8aa07e commit 25ec47e
Show file tree
Hide file tree
Showing 3 changed files with 1,654 additions and 698 deletions.
24 changes: 17 additions & 7 deletions website/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,21 @@ var selfieCard = {
errBack = function(error) {
alert('error getting video feed');
};
if (!navigator.webkitGetUserMedia) {
alert('This only works in Chrome (no navigator.webkitGetUserMedia)');
}
navigator.webkitGetUserMedia(videoObj, function(stream) {
video.src = window.webkitURL.createObjectURL(stream);
video.play();

navigator.getMedia = (navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia);

navigator.getMedia(videoObj, function(stream) {
var vendorURL;
if (navigator.mozGetUserMedia) {
video.mozSrcObject = stream;
} else {
vendorURL = window.URL || window.webkitURL;
video.src = vendorURL.createObjectURL(stream);
video.play();
}

$('#snap').click(function() {
context.drawImage(video, 0, 0, 160, 120);
Expand Down Expand Up @@ -260,7 +269,7 @@ function bootEditor(element, mobiledoc) {
if (editor) {
editor.destroy();
}
editor = new ContentKit.Editor(element, {
editor = new ContentKit.Editor({
autofocus: false,
mobiledoc: mobiledoc,
cards: [simpleCard, cardWithEditMode, cardWithInput, selfieCard],
Expand All @@ -270,6 +279,7 @@ function bootEditor(element, mobiledoc) {
}
}
});
editor.render(element);

function sync() {
ContentKitDemo.syncCodePane(editor);
Expand Down
Loading

0 comments on commit 25ec47e

Please sign in to comment.