Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

YouTube Clips in Ibooks

Hey Everyone,


I've been trying unsuccessfully to include youtube clips using the HTML widget tool. I don't have any experience using Dashcode, and I don't know if I'm the only one, but it seems like the HTML editor inside IBooks doesn't work too well... Has anyone else found an easy way to embed youtube clips or other website content using widgets? I'd appreciate any help!


-Felipe

iBook, Mac OS X (10.7.2)

Posted on Jan 22, 2012 11:02 AM

Reply
15 replies

Jan 22, 2012 12:34 PM in response to ChicagoBoy11

Super easy and you do not really need to know how to use dashcode -


1) open dashcode and select "custom"

2) under test and share select 10.4.0 backward-compatibility (under options)

3) name the widget Youtube embed

4) click "save to disk"

5) save the widget to your desktop

6) right click on your widget and select show package contents

7) open main.html with your text editor and replace all the html code in main.html with:


<center><font color="#F7F7F7" size="4"><b>YouTube Video Embed Beta</B></font></center>

<center><iframe class="youtube-player" type="text/html" width="280" height="225" src="http://www.youtube.com/embed/6NFrHD4-wY0" frameborder="0">

</iframe></center>


save the file and close the widget folder - drag and drop into your iBooks HTML container, enjoy ;3


I have HTML5 CSS3 Canvas Javascript animations, complex calc javascript and a whole host of other things using this simple process of modifying a widgets base files. Its really pretty slick.


Note: you can set the width/height in the info.hlist file/


Enjoy!

Jan 23, 2012 6:31 AM in response to hbattousai

Thanks so much for your help - it.... kinda worked. The youtube video shows up just fine, but if my life depended on it I can't resize the widget from the default size. I changed the info on the info.plist file, saved, re-imported, etc.. but it keeps making the size of the widget be the size of the default image. Changing the dimensions of the iframe seems to work - the video does appear to be bigger - but it is always cropped to the size of the default image. The title in the code you provided is also contained in that small space, so it appears on multiple lines when I make the font bigger, so I don't think it's an issue with the youtube code, but that for whatever reason the widget just won't resize. Any ideas???

Jan 23, 2012 8:15 AM in response to ChicagoBoy11

I'll see if I can figure something out, I have a complex calculator running in a 640x640 iBooks HTML container which seems to view as the correct size. I set the width height in the info.phlist and in the HTML code itself.


I'll try changing the width/height on that slice of Youtube embed and see what I can come up with. You can always take out that name as its not really needed, I just threw that in as a lable.

YouTube Clips in Ibooks

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.