fazworld

Q: 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

Close

Q: Why is adding HTML code so difficult?

  • All replies
  • Helpful answers

first Previous Page 3 of 4 last Next
  • by cmath,

    cmath cmath Jun 6, 2012 5:26 AM in response to cmath
    Level 1 (0 points)
    Jun 6, 2012 5:26 AM in response to cmath

    Here's a link for Subler http://code.google.com/p/subler/

  • by Rycankun,

    Rycankun Rycankun Jun 6, 2012 7:35 PM in response to cmath
    Level 1 (0 points)
    Jun 6, 2012 7:35 PM in response to cmath

    Hey Cmath,

     

    Thanks for all the tips, unfortunatly the video still will not work in a hype app which is what I really need, I guess back to the drawing board.

     

    Thanks!

  • by cmath,

    cmath cmath Jun 6, 2012 8:54 PM in response to Rycankun
    Level 1 (0 points)
    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!

  • by Aminta,

    Aminta Aminta Jul 19, 2012 2:17 AM in response to cmath
    Level 1 (0 points)
    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:

     

    IMG_0765.jpg

     

     

    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

  • by tk0us,

    tk0us tk0us Jul 19, 2012 4:13 AM in response to Aminta
    Level 2 (265 points)
    Jul 19, 2012 4:13 AM in response to Aminta

    Use QuickTime 10 and go to File > Export for Web. The resulting files can be used in .m4v format in Author

  • by cmath,

    cmath cmath Jul 19, 2012 7:01 AM in response to tk0us
    Level 1 (0 points)
    Jul 19, 2012 7:01 AM in response to tk0us

    That's not the problem, tk0us. Aminta is trying to use a mp4 (not m4v) video in a HTML widget. The m4v file is working fine in the Media widget but the HTML widget requires a mp4.

  • by cmath,

    cmath cmath Jul 19, 2012 7:03 AM in response to Aminta
    Level 1 (0 points)
    Jul 19, 2012 7:03 AM in response to Aminta

    Aminta - see my post reply in the other thread you posted on https://discussions.apple.com/message/18960438?ac_cid=tw123456#18960438

  • by Aminta,

    Aminta Aminta Jul 19, 2012 7:43 AM in response to tk0us
    Level 1 (0 points)
    Jul 19, 2012 7:43 AM in response to tk0us

    Thanks tk0us, I followed your hint, then I changed the extension from m4v to mp4 but still no luck....

  • by tk0us,

    tk0us tk0us Jul 19, 2012 8:30 AM in response to Aminta
    Level 2 (265 points)
    Jul 19, 2012 8:30 AM in response to Aminta

    don't chnage it, you need the m4v

  • by cmath,

    cmath cmath Jul 19, 2012 8:32 AM in response to tk0us
    Level 1 (0 points)
    Jul 19, 2012 8:32 AM in response to tk0us

    tK0us - please tell us how you get an m4v video to work in an HTML widget. Apple's documentation says that HTML widgets will only accept .mp4 videos. If you have an example widget I'm sure we would all love to see it. Thanks!

  • by tk0us,

    tk0us tk0us Jul 19, 2012 8:41 AM in response to cmath
    Level 2 (265 points)
    Jul 19, 2012 8:41 AM in response to cmath

    sorry, thought you were talking about media or Keynote

  • by tk0us,

    tk0us tk0us Jul 19, 2012 9:27 AM in response to fazworld
    Level 2 (265 points)
    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

  • by Aminta,

    Aminta Aminta Jul 20, 2012 1:38 AM in response to tk0us
    Level 1 (0 points)
    Jul 20, 2012 1:38 AM in response to tk0us

    Thanks tk0us, I followed your hint but still no luck. Maybe the problem is that I have the new iPad...

  • by Aminta,

    Aminta Aminta Jul 27, 2012 10:16 AM in response to cmath
    Level 1 (0 points)
    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!

  • by cmath,

    cmath cmath Jul 27, 2012 9:02 PM in response to Aminta
    Level 1 (0 points)
    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!

first Previous Page 3 of 4 last Next