{"id":45286,"date":"2019-06-16T03:01:10","date_gmt":"2019-06-15T17:01:10","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=45286"},"modified":"2019-06-15T18:36:23","modified_gmt":"2019-06-15T08:36:23","slug":"webcam-mobile-deprecation-revisit-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/webcam-mobile-deprecation-revisit-tutorial\/","title":{"rendered":"Webcam Mobile Deprecation Revisit Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Webcam Mobile Deprecation Revisit Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest_revisit.jpg\" title=\"Webcam Mobile Deprecation Revisit Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Webcam Mobile Deprecation Revisit Tutorial<\/p><\/div>\n<p>When it comes to topics like media, and worldwide decisions regarding online standards and practices, it stands to reason that &#8220;things might change&#8221; regarding code you write for web applications, trying to work over a variety of web browsers and platforms.  In this regard, an oft times forlorn word for programmers is <a target=_blank title='Software deprecation information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Deprecation#Software_deprecation'>(software) &#8220;deprecation&#8221;<\/a> &#8230;<\/p>\n<blockquote cite='https:\/\/en.wikipedia.org\/wiki\/Deprecation#Software_deprecation'><p>\nWhile a deprecated software feature remains in the software, its use may raise warning messages recommending alternative practices; deprecated status may also indicate the feature will be removed in the future. Features are deprecated rather than immediately removed, to provide backward compatibility, and to give programmers time to bring affected code into compliance with the new standard.\n<\/p><\/blockquote>\n<p> &#8230; in the sense that you write something that satisfies, working at the time, but that false sense of &#8220;deprecation smugness&#8221; may come back to bite months or years later.  Today, it was our turn to &#8220;revisit webcams&#8221; from the days of <a title='Webcam Mobile Tutorial' href='#wmt'>Webcam Mobile Tutorial<\/a> with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html----GETME\">this changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html----GETME\">webcamtest.htm<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\" title=\"Click picture\">live run<\/a> link.<\/p>\n<p>In a lot of platforms window.URL.createObjectURL(stream) is now deprecated (fully &#8230; ie. <a target=_blank title='?' href='https:\/\/www.dailymotion.com\/video\/xoh8j'>is no more<\/a>) &#8230; <b>and so<\/b> (following the lead of the <a target=_blank title='Great webpage, thanks' href='https:\/\/stackoverflow.com\/questions\/27120757\/failed-to-execute-createobjecturl-on-url'>great webpage<\/a>, thanks) &#8230;<\/p>\n<p><code><br \/>\nfunction handleVideo(stream) {<br \/>\n    try {<br \/>\n      video.<a target=_blank title='srcObject information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLMediaElement\/srcObject'>srcObject<\/a> = stream;<br \/>\n      <font color=red>video.play();<\/font> \/\/ new today<br \/>\n    } catch (error) {<br \/>\n      video.src = window.URL.createObjectURL(stream);<br \/>\n      <font color=red>video.play();<\/font> \/\/ new today<br \/>\n    }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; start thinking &#8220;HTMLMediaElement.srcObject&#8221; from here on.<\/p>\n<p>The video initial setting of autoplay (in the HTML design) is not as good as to follow the lead of <a target=_blank title='Excellent link, thanks' href='https:\/\/stackoverflow.com\/questions\/53483975\/navigator-mediadevices-getusermedia-not-working-on-ios-12-safari'>this excellent link<\/a>, thanks, <b>and so<\/b> &#8230;<\/p>\n<p><code><br \/>\n    video.setAttribute('autoplay', '');  \/\/ new today soon after onload<br \/>\n    video.setAttribute('muted', ''); \/\/ new today  soon after onload<br \/>\n    video.setAttribute('playsinline', '');  \/\/ new today soon after onload<br \/>\n    \/\/ ... then ... later ... <font color=red>as above<\/font> ...<br \/>\n    <font color=red>video.play();<\/font> \/\/ new today<br \/>\n<\/code><\/p>\n<p>We also found <a target=_blank title='Very useful link, thanks' href='https:\/\/www.html5rocks.com\/en\/tutorials\/getusermedia\/intro\/'>HTML5Rocks<\/a> really helpful, as usual, thanks again.<\/p>\n<hr>\n<p id='wmt'>Previous relevant <a target=_blank title='Webcam Mobile Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/webcam-mobile-tutorial\/'>Webcam Mobile Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Webcam Mobile Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcam_mobile.jpg\" title=\"Webcam Mobile Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Webcam Mobile Tutorial<\/p><\/div>\n<p>Am hoping most of you laptop and desktop computer users were able to see a <a target=_blank href='https:\/\/en.wikipedia.org\/wiki\/Webcam' title='Webcam information from Wikipedia ... thanks'>webcam<\/a> working with our web application we left off last with <a title='Webcam Photobooth Tutorial' href='#wptt'>Webcam Photobooth Tutorial<\/a> as shown below, and that&#8217;s great if that is the case, but the fact is that lots of platforms, predominantly mobile ones, it would appear do not support a Javascript call like &#8230;<\/p>\n<p><code><br \/>\nnavigator.getUserMedia({video: true, audio: true}, handleVideo, videoError);<br \/>\n<\/code><\/p>\n<p> &#8230; alas and alack!  However, for all you long suffering (mainly mobile device) blog readers &#8230; thanks for reading &#8230; for what we taketh away, let us now putteth innereth a bitteth today.  The webcam is a &#8220;streaming&#8221; video, but the next best thing we can do short of &#8220;streaming&#8221; is to loop an existing video, wouldn&#8217;t you say?  Even there, though, platforms like Safari on iOS (ie. on an iPad or iPhone) still want that user clicking intervention to start any video &#8230; remember our last discussion regarding this Apple bandwidth concern when we presented <a target=_blank title='Piano Playing Web Application Mobile Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/piano-playing-web-application-mobile-tutorial\/'>Piano Playing Web Application Mobile Tutorial<\/a> &#8230; and we cater for that with a four second chance for these Safari iOS users to &#8220;click away&#8221;.<\/p>\n<p>On a mobile platform what form could the &#8220;webcam&#8221; (as a camera device) take?  We think it can be worked, like with mobile iOS apps like Photobooth, the &#8220;webcam&#8221; can take the form of the mobile device camera, and we touched on that when we used the HTML(5) input <i>capture<\/i> syntax when we presented <a target=_blank title='Audio\/Video HTML5 Form Input Capture via PHP Download Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/audiovideo-html5-form-input-capture-via-php-download-tutorial\/'>Audio\/Video HTML5 Form Input Capture via PHP Download Tutorial<\/a>, as food for thought in this area, should you be curious?!<\/p>\n<p>By the way, before we forget, today&#8217;s thanks go to a regular here at this blog, the incredible <a target=_blank href='https:\/\/www.html5rocks.com\/en\/tutorials\/getusermedia\/intro\/' title='https:\/\/www.html5rocks.com\/en\/tutorials\/getusermedia\/intro\/'>html5rocks.com<\/a> website, a great HTML5 and more other web ideas resource &#8230; so &#8230; thanks.<\/p>\n<p>We &#8220;loop&#8221; the (webcam) video via Javascript <b>DOM<\/b> code like &#8230;<\/p>\n<p><code><br \/>\nif (navigator.getUserMedia) {<br \/>\n    navigator.getUserMedia({video: true, audio: true}, handleVideo, videoError);<br \/>\n} else {<br \/>\n<b><br \/>\n    video.type = \"video\/mp4\";<br \/>\n    video.loop = true;<br \/>\n    video.autoplay = true;<br \/>\n    video.controls = true;<br \/>\n    video.src = 'webcamtest.m4v';<br \/>\n    video.style.visibility = 'visible';<br \/>\n    document.getElementById('errmsg').innerHTML = \"So sad, cannot work the 'navigator.getUserMedia({video: true, audio: true}, handleVideo, videoError)' Javascript call we require.  But you can see the blog posting's video on a loop (well, it worked in &lt;a onclick=putOnSpeed(); style=text-decoration:underline;cursor:pointer;&gt;Speed&lt;\/a&gt;) that for best viewing should be &lt;a style=text-decoration:underline;cursor:pointer; onclick=document.getElementById('autoflip').click();&gt;flipped&lt;\/a&gt;.\";<br \/>\n    document.getElementById('sosad').innerHTML = \" (would have been nice ... but ...)\";<br \/>\n<\/b><br \/>\n    setTimeout(andno,4000);<br \/>\n}<br \/>\n<b><\/b><br \/>\nfunction andno() {<br \/>\n    video.style.visibility = 'hidden';<br \/>\n}<br \/>\n<\/code><\/p>\n<p>A big curiosity for our tiny scrambled brain is that, if you are one of these &#8220;previously deprived&#8221; (but now sooooooo well looked after &#8230; crumpets, Jeeves?!) and have seen what happens with that looping local video (that same one from this blog posting thread&#8217;s <a title=\"Webcam Primer Tutorial\" href=\"#wpt\">&#8220;Primer&#8221;<\/a> tutorial), is that it is one of those &#8220;flipped&#8221; scenarios, so we suggest one of &#8230;<\/p>\n<ul>\n<li>viewing this blog posting in your vehicle&#8217;s side mirror &#8230; but please, not while driving &#8230; or &#8230;<\/li>\n<li>stand on your head, rotate 180 degrees and do the &#8220;flop&#8221; while viewing this blog posting&#8217;s web application (&#8220;you can call this technique &#8216;flop and click'&#8221;) &#8230; of course &#8230; off you go &#8230; or &#8230;<\/li>\n<li>use the Auto Flip New Items checkbox we put in at that last <a title='Webcam Photobooth Tutorial' href='#wptt'>Webcam Photobooth Tutorial<\/a> to do the job<\/li>\n<\/ul>\n<p> &#8230; to unscramble, and <a target=_blank title=\"Stay Calm\" href=\"https:\/\/en.wikipedia.org\/wiki\/Keep_Calm_and_Carry_On\">&#8220;stay calm&#8221;<\/a>.<\/p>\n<p>And so that brings us to the opportunity for a <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\" title='Click picture'>live run<\/a> link that now involves the HTML and Javascript of <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html--GETME\" title=\"webcamtest.html\">webcamtest.html<\/a> that changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html--GETME\" title=\"webcamtest.html\">this way<\/a> regarding this &#8220;what do we do if there is an error&#8221; commonplace coding scenario, especially regarding cross-platform and cross-browser considerations, with our webcam\/video\/canvas web application.<\/p>\n<p>Maybe at the live run link above the &#8220;putteth innereth a bitteth&#8221; bit was apparent to you, but for you other readers (and other bewildered users?!), visit <span style=\"cursor:pointer;text-decoration:underline;\"  onclick=\"var ourh=String.fromCharCode(60) + 'ifra' + 'me src=' + '\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.htm?youtubeid=dB77R4Ro59o' + '&#038;youtube_duration=5681.041&#038;email=&#038;email=&#038;emoji=on&#038;c0=on&#038;i0=4271&#038;j0=4655&#038;i1=&#038;j1=&#038;i2=&#038;j2=&#038;i3=&#038;j3=' + '&#038;i4=&#038;j4=&#038;i5=&#038;j5=&#038;i6=&#038;j6=&#038;i7=&#038;j7=&#038;i8=&#038;j8=&#038;i9=&#038;j9=&#038;i10=&#038;j10=&#038;i11=&#038;j11=&#038;i12=&#038;j12=&#038;i13=&#038;j13=' + '&#038;i14=&#038;j14=&#038;i15=&#038;j15=&#038;i16=&#038;j16=&#038;i17=&#038;j17=&#038;i18=&#038;j18=&#038;i19=&#038;j19=&#038;i20=&#038;j20=&#038;i21=&#038;j21=&#038;i22=' + '&#038;j22=&#038;i23=&#038;j23=&#038;i24=&#038;j24=&#038;i25=&#038;j25=&#038;i26=&#038;j26=&#038;i27=&#038;j27=&#038;i28=&#038;j28=&#038;i29=&#038;j29=' + ' style=height:800px' + ';' + 'width:100%' + ';' + ' id=ispeed' + String.fromCharCode(62) + String.fromCharCode(60) + '\/' + 'ifra' + 'me' + String.fromCharCode(62); document.getElementById('speed').innerHTML=ourh; location.href='#speed';\">this link<\/span> to see what we mean.<\/p>\n<div id='speed'><\/div>\n<hr>\n<p id='wptt'>Previous relevant <a target=_blank title='Webcam Photobooth Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/webcam-photobooth-tutorial\/'>Webcam Photobooth Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Webcam Photobooth Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.png\" title=\"Webcam Photobooth Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Webcam Photobooth Tutorial<\/p><\/div>\n<p>The <a target=_blank href='https:\/\/en.wikipedia.org\/wiki\/Webcam' title='Webcam information from Wikipedia ... thanks'>webcam<\/a> of a computer device can be like a video selfie except that when filming something it can be flipped horizontally, like when dealing with mirrors, on occasions, especially after a heavy night!  And that&#8217;s where the Mac OS X (and iOS) <a target=_blank title='Mac OS X apps out of the box' href='https:\/\/support.apple.com\/kb\/PH18738'>Photobooth<\/a> desktop (or mobile &#8220;desktop&#8221;) application comes to our thinking.  It has a very useful option <i>Edit &gt; Auto Flip New Items<\/i>, a simulation of functionality we&#8217;d like to add onto the web application of our previous <a title='Webcam Primer Tutorial' href='#wpt'>Webcam Primer Tutorial<\/a> as shown below.  The thought of doing all this to the implicit video of the Webcam sounds daunting, but the clue to this being easier than expected came from the &#8220;bowels&#8221; of that previous tutorial, basing itself on the help of a few excellent links you can link into below too, and its use of an HTML(5) canvas element to be an intermediary between the webcam (video) and your dear little selves.  And it is on this canvas (sounds apt to say &#8220;palette&#8221; today) that there are tremendous HTML5 &#8220;goodies&#8221; functionality-wise to call on to be able to &#8230;<\/p>\n<ul>\n<li><a target=_blank href='https:\/\/www.w3schools.com\/tags\/canvas_scale.asp' title='HTML(5) canvas element scale method information from w3schools'>scale<\/a><\/li>\n<li><a target=_blank href='https:\/\/www.w3schools.com\/tags\/canvas_rotate.asp' title='HTML(5) canvas element rotate method information from w3schools'>rotate<\/a><\/li>\n<li><a target=_blank href='https:\/\/www.w3schools.com\/tags\/canvas_translate.asp' title='HTML(5) canvas element translate method information from w3schools'>translate<\/a><\/li>\n<\/ul>\n<p> &#8230; and so, effectively (horizontally) &#8220;flip&#8221; (or also today&#8217;s &#8220;we didn&#8217;t know&#8221; flop (meaning vertically flip)) the canvas right there in the middle of the action, doing twirls and triple pikes just for you gals and guys &#8230; awwwww, shucks!  This ability of our Webcam application was precisely what was missing as we lamented in yesterday&#8217;s <a title='Windows Memory Stick Research Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-memory-stick-research-primer-tutorial\/'>Windows Memory Stick Research Primer Tutorial<\/a> &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/windows-memory-stick-research-primer-tutorial\/'><p>\nThe YouTube\u2019s genesis was from the Mac OS X desktop application PhotoBooth, mainly done this way because of its excellent Edit -&gt; Auto Flip New Items option, otherwise we\u2019d have used our recent Webcam web application.\n<\/p><\/blockquote>\n<p>We&#8217;d like to thank <a target=_blank title='Useful link, thanks' href='http:\/\/stackoverflow.com\/questions\/3129099\/how-to-flip-images-horizontally-with-html5'>this webpage<\/a> for a great Javascript function to manipulate our HTML(5) canvas element this way.<\/p>\n<p>This opens our web application up to allowing you to use a Webcam to show a &#8220;filmed&#8221; thing in an unmirrored context, and so, if you, as we did today with our YouTube video &#8230;<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/kpMSroD06ys\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p> &#8230; <i>record<\/i> this from afar, as we did with an iPad Camera app&#8217;s Video mode, it will appear the correct way around, as the Photobooth application can also do, and was the genesis of our inspiration to do today.<\/p>\n<p>We&#8217;ll leave you the HTML and Javascript code we&#8217;ve got those <strike>three<\/strike> four links <strike>above<\/strike> to thank for, mainly.  The code can be downloaded and\/or perused via the <a target=_blank title='webcamtest.html' href='http:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html-GETME'>webcamtest.html<\/a> (https:) source code link, that changed for today&#8217;s purposes in <a target=_blank title='webcamtest.html' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html-GETME'>this way<\/a>. To try it out for yourself, if your computer device suits, try this <a target=_blank title='Click picture' href='https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html'>live run<\/a> link.<\/p>\n<hr>\n<p id='wpt'>Previous relevant <a target=_blank title='Webcam Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/webcam-primer-tutorial\/'>Webcam Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/index.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Webcam Primer Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.jpg\" title=\"Webcam Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Webcam Primer Tutorial<\/p><\/div>\n<p>The <a target=_blank href='https:\/\/en.wikipedia.org\/wiki\/Webcam' title='Webcam information from Wikipedia ... thanks'>webcam<\/a> of a computer device can be a very useful piece of hardware.  We&#8217;ve written an &#8220;entry level&#8221; web application using your device&#8217;s webcam, should it have one, and should you give permission for the web application to access it, and if the web browser and platform combination you use suits some or all of the functionality offered in this first draft.  We would like to thank three great online resources for the code stitched together for this first draft web application, those being &#8230;<\/p>\n<ol>\n<li><a target=_blank title='https:\/\/www.kirupa.com\/html5\/accessing_your_webcam_in_html5.htm' href='https:\/\/www.kirupa.com\/html5\/accessing_your_webcam_in_html5.htm'>www.kirupa.com<\/a> link taught us about the getUserMedia method of the navigator object &#8230;<\/li>\n<li><a target=_blank title='https:\/\/software.intel.com\/en-us\/html5\/hub\/blogs\/using-the-getusermedia-api-with-the-html5-video-and-canvas-elements' href='https:\/\/software.intel.com\/en-us\/html5\/hub\/blogs\/using-the-getusermedia-api-with-the-html5-video-and-canvas-elements'>software.intel.com<\/a> link helped us with code and event logic allowing for a 33mS refresh of the webcam&#8217;s underlying <a target=_blank href='https:\/\/www.w3schools.com\/html\/html5_video.asp' title='HTML video element information from w3schools'>video<\/a> to an HTML(5) <a target=_blank href='https:\/\/www.w3schools.com\/html\/html5_canvas.asp' title='HTML(5) canvas element information from w3schools'>canvas<\/a> element, along with a greyscale manipulation of that canvas element&#8217;s &#8220;snapshot in time&#8221; contents<\/li>\n<li><a target=_blank href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Canvas_API\/Tutorial\/Pixel_manipulation_with_canvas' title='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Canvas_API\/Tutorial\/Pixel_manipulation_with_canvas'>developer.mozilla.org<\/a> link helped us with some other image within canvas pixel level functionalities such as colour reversal, and zooming in ((like a magnifier) as you see often on eCommerce product pages) and an individual canvas pixel rgba(r,g,b,opacity) report<\/li>\n<\/ol>\n<p>None of this functionality calls on anything else but HTML(5) and Javascript &#8220;smarts&#8221;, and is eye opening in that way, no doubt.<\/p>\n<p>And so today&#8217;s first draft is mainly about the webcam (hardware) &#8220;capture&#8221; capabilities, its &#8220;conduit&#8221; to the outside world &#8230; that being you user gals and guys &#8230; say hello &#8230; is that curious and exciting notion that you capture the webcam video <a target=_blank href='https:\/\/en.wikipedia.org\/wiki\/Streaming_media' title='Media streaming information from Wikipedia ... thanks'>streaming<\/a> &#8220;snapshot&#8221; fast enough into a canvas element, it looks like you are just dealing with a &#8220;magical&#8221; canvas, though the (usually green) webcam light on your device (and the web browser tab (usually red) light, and any other web browser webcam icons shown) should be the giveaway that a webcam underpins the goings on.<\/p>\n<p>There are cross-platform and cross-browser issues with webcams, that is for sure.  Maybe you&#8217;ve gone and clicked the <a target=_blank title='Click picture' href='https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html'>live run<\/a> equivalent of clicking the tutorial&#8217;s picture, already, above, and noticed a slightly different pattern of arrangement to our usual.  We direct you to an https: URL, because the Google Chrome web browser asks for this type of URL to go with allowing permission to access the device&#8217;s webcam.<\/p>\n<p>And so that leaves us to show you the HTML and Javascript code we&#8217;ve got those three links above to thank for, mainly.  The code can be downloaded and\/or perused via the <a target=_blank title='webcamtest.html' href='https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.html_GETME'>webcamtest.html<\/a> (https:) source code link.  We also direct you to a video we made for you to visualize all this, below &#8230;<\/p>\n<p><video controls><source type='video\/mp4' src=\"https:\/\/www.rjmprogramming.com.au\/webcamtest\/webcamtest.m4v\"><\/source><\/video><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d29927' onclick='var dv=document.getElementById(\"d29927\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/webcam\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d29927' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d30150' onclick='var dv=document.getElementById(\"d30150\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/photobooth\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d30150' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d30190' onclick='var dv=document.getElementById(\"d30190\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mobile\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d30190' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d45286' onclick='var dv=document.getElementById(\"d45286\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/media\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d45286' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to topics like media, and worldwide decisions regarding online standards and practices, it stands to reason that &#8220;things might change&#8221; regarding code you write for web applications, trying to work over a variety of web browsers and &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/webcam-mobile-deprecation-revisit-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[113,1989,183,184,2985,354,576,652,760,781,997,2986,1319,1369,1413],"class_list":["post-45286","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-audio","tag-autoplay","tag-camera","tag-canvas","tag-deprecation","tag-dom","tag-html","tag-javascript","tag-media","tag-microphone","tag-programming","tag-srcobject","tag-tutorial","tag-video","tag-webcam"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45286"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=45286"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45286\/revisions"}],"predecessor-version":[{"id":45293,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/45286\/revisions\/45293"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=45286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=45286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=45286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}