Robin2:
When something isn’t working the LAST thing you should do is “add a few new links”. Take away EVERYTHING that is not absolutely essential to get the problem piece to work.
All lines of code (except for the video link) works. I added new links to expand my functionality of the project which has no bearing on the efforts done in this forum.
Try getting your page to display an image from another website - which will be simpler than getting a video to display.
Read stuff about web development - for example http://www.w3schools.com/html/html_images.asp.
That has been the site I was referencing during this HTML development, I have been takign lines of code directly from that site posted (w3schools).
I was also able to post a picture using the IMG tag.
In between the HTTP response added as per PeterH’s suggestion is the code(s) posted below: (I tried them all separately and one at a time)
//Create webcam feed I can post a picture, not video as of now.
//This displays nothing, doesnt show up on view source
client.print("<img src=\"http://www.justin.tv/crazy_american?utm_campaign=frontpage_player_click&utm_source=http://www.justin.tv/&utm_content=crazy_american#/w/6170309696/27\" width=\"300\" height=\"200\">");
I then try a different approach by keeping a movie local.
//Also displays nothing and doesnt show up on view source
client.print("<video width=\"320\" height=\"240\" controls><source src=\"movie.mp4\" type=\"video/mp4\"><source src=\"movie.ogg\" type=\"video/ogg\">Your browser does not support the video tag.</video>");
Try getting your page to display an image from another website - which will be simpler than getting a video to display.
So I did just that with this line and I was able to view an image.
//This worked in displaying an image and came up on view source
client.print("<img src=\"http://s21.postimg.org/cfdqt0uh3/Screenshot_9.png\" width=\"300\" height=\"360\">");
I then attempted the same code but with a video link, a blank box appeared but no video:
//This worked in displaying a blank box and came up on view source
client.print("<video src=\"http://www.youtube.com/watch?v=zlfsBlcH4ao\" width=\"640\" height=\"360\"></video>");
However, I can right click on the blank box and open video URL in another window. Its nice but not exactly what I want to do.
I then wanted to try using an iFrame tag:
//This did not work at all and nothing came up on view source
client.print("<iframe width=\"640\" height=\"360\" src=\"http://www.youtube.com/embed/zlfsBlcH4ao?feature=player_detailpage\" frameborder=\"0\" allowfullscreen></iframe>");
PeterH:
That page does not contain the output from this statement:
client.print("<img src=\"http://www.justin.tv/crazy_american?utm_campaign=frontpage_player_click&utm_source=http://www.justin.tv/&utm_content=crazy_american#/w/6170309696/27\" width=\"300\" height=\"200\">");
I suggest you investigate to find out why it is not appearing in your page. For example, try replacing the argument with a much simpler string and see whether that comes out OK. Try reinstating the first part of the longer string and see whether it comes out, and so on. Perhaps there’s a problem with the string length or something tripping you up, or perhaps you have just confused the Arduino parser and this code isn’t reaching the compiler at all.
Great suggestion, by using the code below I was able to get the iFrame tag to work… However there was an unsuspecting result:
//Tried this, found from: [url]http://stackoverflow.com/questions/9590383/how-to-makle-a-video-link-appear-within-a-html-code-on-arduino-w-ethernet-shield[/url]
client.print("<iframe width=640 height=360 src=");
client.print("http://stackoverflow.com/questions/9590383/how-to-makle-a-video-link-appear-within-a-html-code-on-arduino-w-ethernet-shield");
client.println(" frameborder=0 allowfullscreen></iframe>");
That last bit of code does not render the webpage of the URL posted. Instead of the Stackoverflow link, I am seeing another instance of my Arduino served webpage within the original page, and within that iFrame is even another instance (ofmy Arduino served webpage) embeded in the original iFrame. Another words, there is a webpage withing a webpage, and another webpage within that prior one. I don’t see how the above code allows for that…
But, that’s not the topics problem. It’s the video not showing up. I believe PeterH is right and it has something to do with:
…or perhaps you have just confused the Arduino parser and this code isn’t reaching the compiler at all.
zoomkat:
I think time is being wasted until the OP explains how the video is served up. I’ve got an old cam below which works sometimes. One can view the page source to see the html code.
http://web.comporium.net/~shb/wc2000-PT-script.htm
I believe I covered that. When my IP Cam comes in the mail, the video will be served via a local URL. Until then I am trying to get the coding to work by posting any video hosted on the web. It should be the same coding… just a different URL correct? The approach should be identical.
Zoomcat, what do you mean by your …old cam works “sometimes”? Why sometimes?
Btw, it doesn’t seem like you embedded video but refresh a bunch of static images to trick the viewer into thinking it’s playing a video. Nothing close to something like that was recommended here in a prior post, or from any amenable tutorial online. I will have to review zoomkat page further prior to attempting that technique of displaying a video feed.