{"id":34866,"date":"2021-01-03T02:40:45","date_gmt":"2021-01-03T02:40:45","guid":{"rendered":"https:\/\/www.myedme.com\/login\/?p=34866"},"modified":"2021-01-03T02:46:23","modified_gmt":"2021-01-03T02:46:23","slug":"new-video-question-type","status":"publish","type":"post","link":"https:\/\/myedme.com\/login\/new-video-question-type\/","title":{"rendered":"New Video Question Type"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->\n        <title>edMe Video Question<\/title>\n        <link rel=\"stylesheet\" href=\"css\/html5.webcam.demo.css\" \/>\n<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n<!-- WARNING: Respond.js doesn't work if you view the page via file:\/\/ -->\n<!--[if lt IE 9]>\n    <script src=\"https:\/\/www.webcodegeeks.com\/wp-content\/litespeed\/localres\/oss.maxcdn.com\/html5shiv\/3.7.3\/html5shiv.min.js\"><\/script>\n    <script src=\"https:\/\/www.webcodegeeks.com\/wp-content\/litespeed\/localres\/oss.maxcdn.com\/respond\/1.4.2\/respond.min.js\"><\/script>\n<![endif]-->\n<style type=\"text\/css\" href=\"style.css\">\nvideo{\n    display: inline-block;\n    background-color:grey;\n    height: 480px;\n    width: 640px;\n}\ncanvas{\n    display:inline-block;\n    background-color: lightgray;\n    height: 480px;\n    width: 640px;\n}\n<\/style>\n    <\/head>\n    <body>\n        <h1>Question #1<\/h1>\n \n        <video height=\"480px\" width=\"640px\" id=\"webcamfeed\" autoplay controls><\/video>\n        <canvas height=\"480px\" width=\"640px\" id=\"snap\"><\/canvas>\n        <input type=\"button\" id=\"capturewebcam\" value=\"Start Webcam\"\/>\n        <input type=\"button\" id=\"takesnap\" value=\"Take Snap\"\/>\n        <input type=\"button\" id=\"Save\" >Save &#038; Move On<\/input> \n    <\/body>\n<\/html>\n\n<script>\n jQuery(document).ready(function(jQuery) {\n            console.log(\"Ready for webcam\");\n\n    var videoElement = document.getElementById(\"webcamfeed\");\n    var captureWebcam = document.getElementById(\"capturewebcam\");\n    var captureSnap = document.getElementById(\"takesnap\");\n    var canvas = document.getElementById(\"snap\");\n\n    function getUserMedia() {\n        if (navigator.getUserMedia) {\n            navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||\n                navigator.mozGetUserMedia || navigator.msGetUserMedia;\n\n        } else {\n            navigator.getUserMedia = navigator.mediaDevices.getUserMedia;\n        }\n        return navigator.getUserMedia;\n    }\n    captureWebcam.addEventListener(\"click\", function() {\n        var media = getUserMedia();\n        if (media) {\n            navigator.getUserMedia({\n                video: {\n                    width: 640,\n                    height: 480\n                },\n                audio: false\n            }, function(stream) {\n\n                videoElement.src = window.URL.createObjectURL(stream);\n\n            }, function(error) {\n                \/\/Catch errors and print to the console\n                console.log(\"There was an error in GetUserMedia!!!\");\n                console.log(error);\n            });\n        }\n    });\n    captureSnap.addEventListener(\"click\", function() {\n        var context = canvas.getContext('2d');\n        context.drawImage(videoElement, 0, 0, 640, 480, 0, 0, 640, 480);\n    });\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>edMe Video Question Question #1 Save &#038; Move On<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34866","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/posts\/34866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/comments?post=34866"}],"version-history":[{"count":2,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/posts\/34866\/revisions"}],"predecessor-version":[{"id":34868,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/posts\/34866\/revisions\/34868"}],"wp:attachment":[{"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/media?parent=34866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/categories?post=34866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myedme.com\/login\/wp-json\/wp\/v2\/tags?post=34866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}