Apple Event: May 7th at 7 am PT

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

Why is adding HTML code so difficult?

I'm trying to add a weather widget into my book. Yes, I've been spending a lot of time looking into dashcode and creating the widget from scratch, but I can't get it done. Even though I got Xcode and dashcode installed, I'm not that technically inclined and can't figure out how to take this snippet:


<script src="http://weatherandtime.net/swfobject.js" type="text/javascript" ></script><div id="div_weather_05" style="padding:0px;text-align:center; margin:auto auto;width:170px; height:220px;"><div style="padding:1px;position:relative; z-index:100; color:#FFFFFF; text-align:center;left:50px;top:182px; width:115px;height:auto;overflow:hidden;"><a style="margin:0px; padding:3px; color:#FFFFFF; text-decoration:none; font-size:12px;" href="http://weatherandtime.net/en/Asia/Sri-Lanka/Colombo-weather.html" title="Colombo Weather"><nobr>Colombo Weather</nobr></a></div><span id="swf_weather_05"> </span></div><script type="text/javascript" language="Javascript">swfobject.embedSWF("http://weatherandtime.net/weather_05.swf", "swf_weather_05", "170", "200", "10","weather_05.swf", {city: "19459",lang:"en"}, {menu:"false",wmode:"transparent",allowScriptAccess:"always"}, {id:"weather_05",name:"weather_05"});</script>


and make it into a widget that I can just drag and drop into the book's HTML widget window. Is there an easier way to do this? Otherwise, unfortunately, I don't think I'll be able to use some of these key features.

Posted on Jan 22, 2012 10:51 AM

Reply
Question marked as Best reply

Posted on Jan 22, 2012 12:47 PM

Well for one, you are trying to load flash content so that won't work but it looks like you can't access external data from the iBooks

45 replies

Jun 6, 2012 8:54 PM in response to Rycankun

Sorry, Rycankun. I'm not sure why the same html5 video tag wouldn't work in a Hype app. I coded my HTML myself. Don't know anything really about Hype. Good luck. Hopefully Apple will fix this issue so everyone can easily add mp4 videos to HTML widgets like the documentation says. Seems like such a simple thing - you'd think they'd at least aknowledge the problem or publish correct documentation to do it correctly. Good luck!

Jul 19, 2012 2:17 AM in response to cmath

Hi cmath! I'm trying to make it work a video in Html Widget but I get this:


User uploaded file



I start from an Mp4 - H264 file that works with Media Widget. I open it in Subler, I change the profile in "Main@3.1", then I save it as ".m4v". I change back ".m4v" extensione in ".mp4" but it doesn't work.


Any help?


Thanks,


Davide

Jul 19, 2012 9:27 AM in response to fazworld

I have used QuickTime 10 > File > Export for Web then take the .m4v and change it to .m4a

next, use the html5 video tags like


<video src="yourvideo.m4a" controls></video>


I have "faked out" the widgets with this technique for html widgets. I do not know if it works everytime however it works on an iPad2 for me


hope this helps

Jul 27, 2012 10:16 AM in response to cmath

Hi cmath, I've finally found the solution!


Strange but true, is a problem of path! I mean: assume you have internally working Html wdgt with video into in a highly branched folder of your Mac but when you put it in a iBook of yours it doesn't work. You have to:


1) Extract the contents of the .wdgt file in a very simple branched folder of OS X like "User" or "Download"


2) Rebuild the .wdgt from this folder


3) Create a brand new iBook always from the same folder. The book has to have a simple title like "Try"


4) Put the .wdgt in the new iBook, make a preview on iPad and - voilà - it magically and strangely works!

Jul 27, 2012 9:02 PM in response to Aminta

Wow! Whatever works. This has obviously been a collection of 'work-arounds' to get it work properly. I've been traveling and haven't had a chance to respond. Are you able to get it to work without going through the step of converting to m4v with Subler and back to mp4 by changing the ext? If so that would be so great if the videos you're getting out of Handbrake are working when you go through the packaging process you've described. Thanks for all of you investigation on this. I understand how frustrating it is when things don't work the way they're supposed to.


Just for the record. I was creating the wdgt package from my Desktop or Downloads folder. Good work!

Why is adding HTML code so difficult?

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