Tsalagi_4 has asked for the wisdom of the Perl Monks concerning the following question:
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/"/"/gWith 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Displaying Youtube Video
by marto (Cardinal) on Jun 11, 2010 at 11:47 UTC | |
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 12:23 UTC | |
by marto (Cardinal) on Jun 11, 2010 at 12:32 UTC | |
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 13:13 UTC | |
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 14:01 UTC | |
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 19:31 UTC | |
by Tsalagi_4 (Initiate) on Jun 11, 2010 at 15:52 UTC | |
by Anonymous Monk on Jun 11, 2010 at 17:58 UTC | |
by StommePoes (Scribe) on Jun 13, 2010 at 10:26 UTC |