Media in Native Android Environments

In Native Android environments, the following native methods allow for managing audio and video media.

There is a system limit of three simultaneous video surfaces.

Supported Android Method Calls

General Audio and Video

ActionAudio/VideoMediaPlayer Methods
Get duration of a programAudiogetDuration()
Launching and starting play in MediaPlayer instanceAudio, Video

create (Context context, Uri uri, SurfaceHolder holder)

create (Context context, Uri uri)

setAudioStreamType(int streamtype)

reset()

prepare()

prepareAsync()

setDataSource(Context context, Uri uri)

    Refer to Media URIs and Formats for URI formats.

setVideoScalingMode(int mode)

setSurface(Surface surface) or setDisplay(SurfaceHolder sh)

setScreenOnWhilePlaying(boolean screenOn)

start()

getTrackInfo()

setNextMediaPlayer(MediaPlayer next)

Pause playbackAudiopause()
Resume playbackAudiostart()
Fast-forward or rewindAudio

getCurrentPosition — used to obtain the current position

seekTo(int msec) — used to move to the new position

Automatically play the next programAudiosetLooping(boolean looping)(boolean looping)
Set or remove an audio trackAudio, Video

getTrackInfo()

selectTrack(int index)

deselectTrack(int index)

Set or disable subtitlesVideo

getTrackInfo()

selectTrack(int index) — used to set subtitles

deselectTrack(int index) — used to disable subtitles

Stop playbackAudio, Videostop()
Close a MediaPlayer instanceAudio, Videorelease()
Set the player to loopingAudiosetLooping(boolean looping)
Determine if the player is set to loopingAudioisLooping()
Determine if the player is playingAudio, VideoisPlaying()

4K Media Player

ActionAudio/VideoMediaPlayer Methods
Set the video view size to ensure the size does not scale downVideosetSurface(Surface surface)

Media Listener

MediaPlayer listeners:

Media URIs and Formats

The following URIs are used with the setDataSource MediaPlayer method.

  • The Category ID (cid:<\CID>\) is optional. Category ID is used for PAXUS logging.

  • Use Panasonic media streaming protocols, such as pac_rtp:// or pac_rtsp://, with the Native Android media player. The DRM is handled by the headend streamer Widevine and Fairplay DRM services component.

TypeFormatExample

RTP IP

Broadcast media by IP

pac_rtp://<ip>:<port>[cid:<CID>]pac_rtp://239.192.3.77:52220

RTP IP

Audio only

pac_rtp://audio:<ip>:<port>[cid:<CID>]pac_rtp://audio:239.192.3.77:52220

RTP IP

Video only

pac_rtp://video:<ip>:<port>[cid:<CID>]pac_rtp://video:239.192.3.77:52220

RTP Channel

Broadcast media by channel

pac_rtp://audio:<channel>[cid:<CID>] or pac_rtp://video:<channel>[cid:<CID>]pac_rtp://audio:1

RTSP MID

AVOD by MID

pac_rtsp://mid:<MID>[cid:<CID>]pac_rtsp://mid:100002:cid:3

RTSP MID

Audio only

pac_rtsp://audio:mid:<MID>[cid:<CID>]pac_rtsp://audio:mid:1001:cid:3

RTSP MID

Video only

pac_rtsp://video:mid:<MID>[cid:<CID>]pac_rtsp://video:mid:1001:cid:7

RTSP File

AVOD by file

pac_rtsp://file:<file_name>pac_rtsp://file:movie03.mpg
HDMI inputpac_aux://hdmi:<type>

pac_aux://hdmi:audio

pac_aux://hdmi:video

pax_aux://hdmi:audio_video

 

HLSpac_hls:// 

Unsupported Android Methods

The following Android MediaPlayer methods are explicitly not supported: