Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Getting Started with webOS webView, imageView, video and audio widgets

webView, imageView, video and audio widgets

Viewers allow you to embed rich media objects within scenes. The viewer widgets included with Mojo version 1 include webView, imageView, video and audio.  The latter two are based on the HTML5 spec for including video and audio objects in a webpage.


Displays a "contained web object" (like a web page) in a scene. This can be used to render local markup or an external URL.

mojo webview widget

Click here for an example of setting up a WebView widget.


Similar to WebView, the ImageView widget displays a full-screen image with support for zooming, panning, and "flicking" left and right between additional images.

mojo imageview widget

Audio and Video

These objects are based on HTML5 media extensions. These objects should be used when you want to maintain your application's context or play content directly within your scene.

Audio and Video objects cannot be set up directly through HTML tags in your scene file; they must be set up through JavaScript in the assistant's setup method. You must then set the source and set up event handlers before you can play the media.

The video object requires coordination of the video sink through helper functions freezeVideo and activateVideo. When the application is not in the foreground, it must release the video sink so that the active application can use it to display video, if necessary.

Media objects support both file-based and streaming sources.

And with that, we've completed our tour of Mojo's widgets! Tomorrow we'll start on an entirely new topic, Data, with a look at using cookies for local storage.

This is one of many daily development-related webOS articles. Grab the RSS feed to stay in the know!

Much of the information in this article was presented in Chapter 5 of Palm webOS by Mitch Allen.



    Add Comment

      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)