public class MediaUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.io.File |
copyMediaToTempFile(Form form,
java.lang.String mediaPath)
Copies the media specified by mediaPath to a temp file and returns the
File.
|
static android.graphics.drawable.BitmapDrawable |
getBitmapDrawable(Form form,
java.lang.String mediaPath)
Loads the image specified by mediaPath and returns a Drawable.
|
static void |
loadMediaPlayer(android.media.MediaPlayer mediaPlayer,
Form form,
java.lang.String mediaPath)
Loads the audio or video specified by mediaPath into the given
MediaPlayer.
|
static int |
loadSoundPool(android.media.SoundPool soundPool,
Form form,
java.lang.String mediaPath)
Loads the audio specified by mediaPath into the given SoundPool and
returns the sound id.
|
static void |
loadVideoView(android.widget.VideoView videoView,
Form form,
java.lang.String mediaPath)
Loads the video specified by mediaPath into the given VideoView.
|
static java.io.InputStream |
openMedia(Form form,
java.lang.String mediaPath) |
public static java.io.InputStream openMedia(Form form, java.lang.String mediaPath) throws java.io.IOException
java.io.IOException
public static java.io.File copyMediaToTempFile(Form form, java.lang.String mediaPath) throws java.io.IOException
form
- the FormmediaPath
- the path to the mediajava.io.IOException
public static android.graphics.drawable.BitmapDrawable getBitmapDrawable(Form form, java.lang.String mediaPath) throws java.io.IOException
form
- the FormmediaPath
- the path to the mediajava.io.IOException
public static int loadSoundPool(android.media.SoundPool soundPool, Form form, java.lang.String mediaPath) throws java.io.IOException
soundPool
- the SoundPoolform
- the FormmediaPath
- the path to the mediajava.io.IOException
public static void loadMediaPlayer(android.media.MediaPlayer mediaPlayer, Form form, java.lang.String mediaPath) throws java.io.IOException
mediaPlayer
- the MediaPlayerform
- the FormmediaPath
- the path to the mediajava.io.IOException
public static void loadVideoView(android.widget.VideoView videoView, Form form, java.lang.String mediaPath) throws java.io.IOException
videoView
- the VideoViewform
- the FormmediaPath
- the path to the mediajava.io.IOException