There are two lines of code that formats the entry into this field. In two places I had to replace the code like this.

$vidlect   = "$main::in{'vidlect'}" ; $vidlect =~ s/"/"/g

With this

$vidlect   = "$main::in{'vidlect'}" ; $vidlect =~ s/\0//;

Thanks for the attempt at helping

Hello. I have a program to take notes while watching online video lectures. It's a hassle alt+tabbing between the two windows all the time, so I thought I would hack the code to display video inside the notes editor mode. The program for taking notes is written in Perl. It has a form to save a new notes page to a file and then a form to edit those notes. I successfully added an input field to save the embed code from the You Tube lecture and save it to a variable but I cant get the video to show calling it from the variable in which the embed code is stored.

There are three modes. One to add a new note file, one to read the new note file and one to edit it. After I create a new notes file for a new lecture with the link to the video pasted in the input field I go into edit mode to enter my notes. It is during edit mode that I want to be able to view the video

Here is the code that saves the initial notes file.

# Write the new file out. my $strdate = gmtime( time ); open( FILE, ">$filename" ) || &InvalidFile(); print FILE <<EOF; <!-- Author: $author --> <!-- Date: $strdate (GMT) --> <!-- Title: $title --> <!-- Keywords: $kwords --> <!-- Video Lecture: $vidlect --> <!-- Changes: Modified $strdate (GMT) $author | $changes --> $body EOF

Here is the form code to edit the notes file

print <<EOF; <form action="$main::script" enctype="multipart/form-data" method=post +> <p> <pre> <b>Your name</b>: <input type=text name=author value="$author" size=40 /> <b>The title</b>: <input type=text name=title value="$title" size=40 /> <b>Keywords</b> : <input type=text name=keywords value="$kwords" size=40 /> (optional) <b>Video Lecture</b> : <input type=text name=vidlect value="$vidlect" size=140 /> </pre> </p> <textarea rows=15 cols=175 WRAP=SOFT name=body>$body</textarea><br> </p> EOF

I used two methods to test if the variables actually captured the code. Here they are.

print <<EOF; <div>$vidlect</div> EOF print <<EOF;

and

<div>$vidlect</div>

It may be worth noting that when I view source through the browser, the the video link code is html entities rather than the true html code. I don't know that much about Perl but other code may be changing the original link.

Thanks in advance for any help

Here is the link from youtube

<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Pij6J0HsYFA&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

Even with the size of 140 it seemed to be capturing the entire link code but I expaned it with the same result. Another thing of interest is that if I past the link code directly into the form, the lecture displays fine. Thanks for replying.


In reply to Displaying Youtube Video (Resolved) by Tsalagi_4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.