Message Boards Message Boards

Accessing a YouTube video in a notebook

Posted 11 years ago

i am creating a notebook for my presentation at the wolfram Technology conferenc in October and wanted to show a Youtube video in the presentation. here's what i found out: you can call a youtube video from within a notebook if you can access wi-fi where you're showing the notebook. here's an example:

SystemOpen["https://www.youtube.com/watch?v=IaO69CF5mbY"]

if you don't have wi-fi where you use the computer, you can download and save a youtube file on your computer and then just double-click on it it to run the video. see

http://www.computerhope.com/issues/ch001002.htm

Attachments:
POSTED BY: Richard Gaylord
4 Replies

It depends a bit on your operating system. I am on OSX. I have VLC installed on it. You can get that from here:

http://www.videolan.org/vlc/index.en_GB.html

The command I showed above - here amended by some Timeout option to avoid a warning -

SetOptions[$FrontEndSession, DynamicEvaluationTimeout -> 120];
Button["Play Movie", Run["/Applications/VLC.app/Contents/MacOS/VLC --fullscreen --input-repeat=0 --no-osd --no-video-title-show  -L ~/Desktop/1245200s1.mov"]] // Quiet

makes a button in your notebook; you can hide the input to make it look nicer and even get rid of the "Out" by setting the appropriate options for the cell. When you click on the button, you run a terminal command that starts VLC. The option "--fullscreen" makes VLC go directly into full screen mode. I also set the video not to repeat and hide the title. The last bit of the command is obviously the location of the video, in my case video.mp4 is on the Desktop.

When you start the slideshow, and click on the button "Play Movie" you get to a full screen and play the video. When the video is done, you need to quit VLC and return to your notebook. It's not quite ideal, but it worked ok for my lectures and presentations.

If everything works as planned you do not have to open another program by hand/close the slideshow. Depending on the setup the Mac opens another desktop and you might have to swipe once to get back to your notebook, but there is no looking for the file, opening of a media player etc involved.

I have no idea whether/how that might work on Windows. On Linux it should work pretty much in the same way.

Cheers,

Marco

POSTED BY: Marco Thiel

That is very useful indeed! Thank you, I always had problems properly downloading videos for lectures. I have VLC installed. To use the video in my slideshow I found the following command quite useful:

Button["Play Movie", 
Run["/Applications/VLC.app/Contents/MacOS/VLC --fullscreen --input-repeat=0 --no-osd --no-video-title-show  -L ~/Desktop/video.mp4"] 
// Quiet]

It produces a button that opens the video in full screen.

Marco

POSTED BY: Marco Thiel

I would advise caution about using the service at http://www.computerhope.com/issues/ch001002.htm The input field there calls a service from savefrom.net. On doing a WhoIs on savefrom.net the domain registry information is anonymous. One of the IP addresses associated with savefrom.net is 146.185.29.109, and at least for this it indicates that its server is located somewhere in Alabama (nothing against Alabama, just trying to find out where the server for savefrom.net is located):

GeoGraphics[FindGeoLocation["146.185.29.109"], GeoRange -> Quantity[60, "Miles"]]

And here is the nearest city:

In[7]:= GeoNearest[Entity["City"], FindGeoLocation["146.185.29.109"]] // InputForm

Out[7]//InputForm= {Entity["City", {"Jemison", "Alabama", "UnitedStates"}]}

So, buyer beware. If you process a youtube video link through this service it is not clear whether it has been modified in some way in the course of its processing.

General rule for the Internet: don't download anything from a source you are not completely familiar with... ;-)

POSTED BY: David Reiss
Posted 11 years ago

i don't understand how this works. attached is a youtube video file i downloaded and saved. how would i call it from within a notebook to play (i don't want to have to close the notebook, locate the file and play it (i do have VLC which is a free app) and then re-open the notebook. it makes for a poor presentation style.

Attachments:
POSTED BY: Richard Gaylord
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract