Digital Wackys Blog

Digital Wackys のオフィシャルブログです。はてなダイアリーから引っ越しました。

iPhone用サイトをiPod touchでオフライン表示させる

[PR]って書けっていうから書きますが、商品提供などがあったとしても特に記載がない限り率直な意見を述べたレビューであり、忖度した広告記事ではありません。アフィリエイトは利用しています。

twitterでつぶやく

制作したiPhone用サイトをiPod touchでオフライン状態でプレゼンしたいと思って色々調べてみた。
iPhone Webサーバ」でググるとまず出てくるのが「ServersMan@iPhoneである。
ちょっと前から試しに使ってみているのだが、コレがいまいち使いづらい…。
ファイル操作がWeb経由なので、大量のデータを送るのには向いていない。


さらにググっているとこんな記事を発見。
iPhoneでWebサーバー動かしてみました」
http://webf.yoka-yoka.jp/e232227.html


結果として上記サイトの手順通り(一部修正必須)で、iPod touch内に保存されたローカルHTMLを標準ブラウザMobile Safariで表示できた。


以下、簡単に手順をまとめる。

以上。


【作成する書類の詳細】
/etc/lighttpd.conf
server.modules = (
"mod_access",
"mod_alias",
"mod_dirlisting",
)
server.dir-listing = "enable"
server.document-root = "/var/mobile/Site/"
index-file.names = (
"index.html", "index.htm",
)
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mp4" => "video/quicktime",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar"
)
server.port = 80


/System/Library/LaunchDaemons/com.amcgregor.lighttpd.plist




Label
com.amcgregor.lighttpd
OnDemand

ProgramArguments

/usr/sbin/lighttpd
-f
/etc/lighttpd.conf
-D

StandardErrorPath
/dev/null


【作成するフォルダの詳細】
/var/mobile/Site/(index.html)


全て上手くできればこんな感じで表示される。
URL欄がlocalhost/」になってるでしょ^^


ところがここで、肝心のiPhone Panoramaが表示できないことに気がついた!(XoX)
iPhone Panoramaの表示に使用しているのは「MoblVR」というJavaScriptなのだが、有料のPro版は指定したドメイン以外では動作しないのだ…。
ってことで、とりあえず幾つかのサンプルを無料版のMoblVRで入れておくことにしたのだが…。 無料版のMoblVRはまだバグ解消されておらず、Mobile Safariにグリグリ操作を持ってイカレルのだ。なので一度手を離したらオシマイ…(T_T)
これではあまりプレゼンに使えないなぁ…。


単なるiPhone用のパノラマをプレゼンするならCube Worldで良いのだが、iPhone用サイトに直接入れられるってのが“味噌”なんだよねぇ…。
いい加減iPhone買え!ってコトなのか?
でもやっぱSBM嫌いっ!


twitterでつぶやく