Internet Browser: Difference between revisions
Fill in lots of documentation using source code and official docs |
|||
Line 27: | Line 27: | ||
== Multimedia Support == | == Multimedia Support == | ||
Internet Browser supports HTML5 audio and video. The only video format supported is H.264 either in an MPEG-4 container or in an MPEG-2 transport stream with a M3U8 index according to the HTTP Live Streaming specification. The only audio format supported is AAC in an MPEG-4 container. | Internet Browser supports HTML5 audio and video. The only video format supported is H.264 either in an MPEG-4 container or in an MPEG-2 transport stream with a M3U8 index according to the HTTP Live Streaming specification. The only audio format supported is AAC encoded with the Low Complexity (LC) profile in an MPEG-4 container. | ||
The browser can display BMP, PNG, GIF, JPEG, and SVG images, but Image Preview mode only supports JPEG images. | The browser can display BMP, PNG, GIF, JPEG, and SVG images, but Image Preview mode only supports JPEG images. | ||
Line 113: | Line 113: | ||
==== Reading values ==== | ==== Reading values ==== | ||
In order to read any values from the GamePad, the function <tt>wiiu.gamepad.update()</tt> must be invoked. This will populate all of the properties on the <tt>wiiu.gamepad</tt> object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. It is safe to invoke this function in a timer for real-time updates. | In order to read any values from the GamePad, the function <tt>wiiu.gamepad.update()</tt> must be invoked. This will populate all of the properties on the <tt>wiiu.gamepad</tt> object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. For convenience, this function also returns a reference to the <tt>wiiu.gamepad</tt> object, allowing for idioms like <tt>var state = wiiu.gamepad.update();</tt>. It is safe to invoke this function in a timer for real-time updates. | ||
After a successful update, <tt>wiiu.gamepad.isDataValid</tt> will be set to 1. If no update has happened yet, or if the GamePad is not connected, it will be set to 0. | After a successful update, <tt>wiiu.gamepad.isDataValid</tt> will be set to 1. If no update has happened yet, or if the GamePad is not connected, it will be set to 0. | ||
Line 124: | Line 124: | ||
! Variable | ! Variable | ||
! Value | ! Value | ||
|- | |||
|<tt>wiiu.gamepad.tpTouch</tt> | |||
|1 if touch is present | |||
|- | |||
|<tt>wiiu.gamepad.tpValidity</tt> | |||
|0 = X and Y coordinates valid | |||
1 = X coordinate invalid | |||
2 = Y coordinate invalid | |||
3 = X and Y coordinates invalid | |||
|- | |- | ||
|<tt>wiiu.gamepad.tpX</tt> | |<tt>wiiu.gamepad.tpX</tt> | ||
Line 137: | Line 146: | ||
|Y position in page coordinates | |Y position in page coordinates | ||
|} | |} | ||
==== Analog Sticks ==== | ==== Analog Sticks ==== | ||
Line 365: | Line 372: | ||
==== Reading values ==== | ==== Reading values ==== | ||
In order to read any values from | In order to read any values from a Wii Remote, the function <tt>wiiu.remote.update(n)</tt> must be invoked, where <tt>n</tt> is the number of the Wii Remote. This populates all of the properties on the <tt>wiiu.remote</tt> object with the current information about the pointer, accelerometers, gyroscopes, and buttons of the selected Wii Remote. For convenience, this function also returns a reference to the <tt>wiiu.remote</tt> object, allowing for idioms like <tt>var state = wiiu.remote.update(0);</tt>. It is safe to invoke this function in a timer for real-time updates. | ||
If the specified Wii Remote returns valid data, <tt>wiiu.remote.isDataValid</tt> will be set to 1. If no update has happened yet, or if the selected Wii Remote is not connected, it will be set to 0. | |||
==== Buttons ==== | ==== Buttons ==== | ||
Line 465: | Line 472: | ||
|- | |- | ||
| <tt>wiiu.remote.dpdValidity</tt> | | <tt>wiiu.remote.dpdValidity</tt> | ||
| | | 0 = X and Y coordinates valid | ||
1 = X coordinate invalid | |||
2 = Y coordinate invalid | |||
3 = X and Y coordinates invalid | |||
|} | |} | ||
Additionally, the function <tt>wiiu.remote.setCursorViewable()</tt> will enable or disable the display of | Additionally, the function <tt>wiiu.remote.setCursorViewable(n, enable)</tt> will enable or disable the display of a Wii Remote's cursor. | ||
==== Motion Plus ==== | ==== Motion Plus ==== | ||
Line 529: | Line 539: | ||
=== wiiu.videoplayer === | === wiiu.videoplayer === | ||
The <tt>wiiu.videoplayer</tt> object | The <tt>wiiu.videoplayer</tt> object controls the display of fullscreen HTML5 videos. | ||
< | {| class='wikitable' | ||
! Property | |||
! Value | |||
|- | |||
| <tt>wiiu.videoplayer.viewMode</tt> | |||
| 1 if browser is visible on GamePad. 0 if video is visible on GamePad. Read/write. | |||
|- | |||
! Method | |||
! Effect | |||
|- | |||
| <tt>wiiu.videoplayer.end()</tt> | |||
| Stops the currently playing video. Returns true if successful. | |||
|- | |||
! Event | |||
! Documentation | |||
|- | |||
| <tt>"wiiu_videoplayer_end"</tt> | |||
| Triggered when video playback ends. | |||
|} | |||
=== wiiu.imageview === | === wiiu.imageview === | ||
The <tt>wiiu. | The <tt>wiiu.imageview</tt> object manages the Image Preview feature. | ||
{| class='wikitable' | |||
! Property | |||
! Value | |||
|- | |||
| <tt>wiiu.imageview.viewMode</tt> | |||
| 1 if browser is visible on GamePad. 0 if image preview is visible on GamePad. Read/write. | |||
|- | |||
! Method | |||
! Effect | |||
|- | |||
| <tt>wiiu.imageview.end()</tt> | |||
| Closes Image Preview mode. Returns true if successful. | |||
|- | |||
| <tt>wiiu.imageview.getErrorCode()</tt> | |||
| Returns the most recent error code for Image Preview. The error codes are documented below. | |||
|- | |||
! Event | |||
! Documentation | |||
|- | |||
| <tt>"wiiu_imageview_start"</tt> | |||
| Triggered when Image Preview mode is enabled. | |||
|- | |||
| <tt>"wiiu_imageview_end"</tt> | |||
| Triggered when Image Preview mode is closed. | |||
|- | |||
| <tt>"wiiu_imageview_change_viewmode"</tt> | |||
| Triggered when Image Preview is toggled between the TV and the GamePad. | |||
|- | |||
| <tt>"wiiu_imageview_change_content"</tt> | |||
| Triggered when Image Preview opens a new image. | |||
|- | |||
| <tt>"wiiu_imageview_error"</tt> | |||
| Triggered when an error occurs when loading an image. See <tt>wiiu.imageview.getErrorCode()</tt> and the table of error codes below. | |||
|} | |||
< | <tt>wiiu.imageview.getErrorCode()</tt> may return the following values: | ||
{| class='wikitable' | |||
! Code | |||
! Meaning | |||
|- | |||
| -1 | |||
| No error | |||
|- | |||
| 202 | |||
| Unsupported image format | |||
|- | |||
| 203 | |||
| Image dimensions too large | |||
|- | |||
| 204 | |||
| File size too large | |||
|- | |||
| 205 | |||
| Too many pixels in progressive-mode JPEG | |||
|} | |||
== External links == | == External links == | ||
* Nintendo | * Official Nintendo documentation for <tt>wiiu</tt> [http://www.nintendo.co.jp/wiiu/hardware/features/internetbrowser/extended_functionality.html] [[http://translate.google.com/translate?sl=ja&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fwww.nintendo.co.jp%2Fwiiu%2Fhardware%2Ffeatures%2Finternetbrowser%2Fextended_functionality.html Translated to English]] | ||
* | * Official Nintendo <tt>wiiu</tt> demonstration page [http://www.nintendo.co.jp/wiiu/hardware/features/internetbrowser/sample.html] | ||
* | * Nintendo open-source code download page [http://www.nintendo.co.jp/wiiu/support/oss/index.html] | ||
* | * Source code for <tt>wiiu</tt> object, extracted from above [http://wiiu.essh.co] | ||
* Cyan's port of Blob Sallad for the Wii U Internet Browser [http://cyan.ff6.free.fr/WiiU/] | * Cyan's port of Blob Sallad for the Wii U Internet Browser [http://cyan.ff6.free.fr/WiiU/] |