java实战——简单的媒体播放器

这个是用jmf来做的,但是由于jmf对视频资源支持的问题所以能用的类型没有那么多,它支持的格式有下面这些。

· D indicates the format can be decoded and presented.

· E indicates the media stream can be encoded in the format.

· read indicates the media type can be used as input (read from a file)

· write indicates the media type can be generated as output (written to a file)

Media Type

JMF 2.1.1
Cross Platform Version

JMF 2.1.1
Solaris/Linux Performance Pack

JMF 2.1.1
Windows Performance Pack

AIFF (.aiff)

read/write

read/write

read/write

8-bit mono/stereo linear 

D,E

D,E

D,E

16-bit mono/stereo linear 

D,E

D,E

D,E

G.711 (U-law) 

D,E

D,E

D,E

A-law 

D

D

D

IMA4 ADPCM

D,E

D,E

D,E

AVI (.avi)

read/write

read/write

read/write

Audio: 8-bit mono/stereo linear 

D,E

D,E

D,E

Audio: 16-bit mono/stereo linear 

D,E

D,E

D,E

Audio: DVI ADPCM compressed 

D,E

D,E

D,E

Audio: G.711 (U-law) 

D,E

D,E

D,E

Audio: A-law 

D

D

D

Audio: GSM mono

D,E

D,E

D,E

Audio: ACM**

-

-

D,E

Video: Cinepak 

D

D,E

D

Video: MJPEG (422)

D

D,E

D,E 

Video: RGB

D,E

D,E

D,E 

Video: YUV

D,E

D,E

D,E 

Video: VCM**

-

-

D,E

GSM (.gsm)

read/write

read/write

read/write

GSM mono audio

D,E

D,E

D,E

HotMedia (.mvr)

read only

read only

read only

IBM HotMedia

D

D

D

MIDI (.mid)

read only

read only

read only

Type 1 & 2 MIDI

-

D

D

MPEG-1 Video (.mpg)

-

read only

read only

Multiplexed System stream 

-

D

D

Video-only stream 

-

D

D

MPEG Layer II Audio (.mp2)

read only

read/write

read/write

MPEG layer 1, 2 audio 

D

D,E

D,E

QuickTime (.mov)

read/write

read/write

read/write

Audio: 8 bits mono/stereo linear 

D,E

D,E

D,E

Audio: 16 bits mono/stereo linear

D,E

D,E

D,E

Audio: G.711 (U-law) 

D,E

D,E

D,E

Audio: A-law 

D

D

D

Audio: GSM mono 

D,E

D,E

D,E

Audio: IMA4 ADPCM 

D,E

D,E

D,E

Video: Cinepak 

D

D,E

D

Video: H.261

-

D

D

Video: H.263 

D

D,E

D,E

Video: JPEG (420, 422, 444) 

D

D,E

D,E

Video: RGB

D,E

D,E

D,E

Sun Audio (.au)

read/write

read/write

read/write

8 bits mono/stereo linear 

D,E

D,E

D,E

16 bits mono/stereo linear 

D,E

D,E

D,E

G.711 (U-law)

D,E

D,E

D,E

A-law 

D

D

D

Wave (.wav)

read/write

read/write

read/write

8-bit mono/stereo linear 

D,E

D,E

D,E

16-bit mono/stereo linear 

D,E

D,E

D,E

G.711 (U-law)

D,E

D,E

D,E

A-law 

D

D

D

GSM mono 

D,E

D,E

D,E

DVI ADPCM

D,E

D,E 

D,E

MS ADPCM

D

D

ACM**

-

-

D,E

资料来源:Atitit. 软件---多媒体区---- jmf 2.1.1 Java Media Framework 支持的格式_attilax的专栏-CSDN博客

另外如果要播放MP3等音乐类型的话需要去官网上下载jmf mp3 plugin,这样才能用,不然就会像我想播放MP4格式的时候一样报错...

 因为这个东西实在太low,所以就不多做介绍了,让大家看看效果图吧。

 这个是刚进入时的页面。

这里可以看到打开后播放的信息。

这是打开wav文件后的样子,可以控制它的播放停止等等,也可以看到详细信息如下图。 

获取方式:

1、扫描小程序直接获取; 

 2、扫描关注公众号,发送  媒体播放器  获取。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值