1 package com.foxinmy.weixin4j.type;
2
3 import com.foxinmy.weixin4j.http.MimeType;
4
5 /**
6 * 上传的媒体类型</br>
7 * <p>
8 * 公众平台上传限制:</br>
9 * 图片(image): 2MB,支持bmp/png/jpeg/jpg/gif格式</br>
10 * 语音(voice):2MB,播放长度不超过60s,支持mp3/wma/wav/amr格式</br>
11 * 视频(video):10MB,支持rm/rmvb/wmv/avi/mpg/mpeg/mp4格式</br>
12 * 缩略图(thumb):64KB,支持JPG格式</br>
13 * </p>
14 * <p>
15 * 企业号上传限制:</br>
16 * 图片(image):1MB,支持bmp/png/jpeg/jpg/gif格式</br>
17 * 语音(voice):2MB,播放长度不超过60s,支持mp3/wma/wav/amr格式</br>
18 * 视频(video):10MB,支持rm/rmvb/wmv/avi/mpg/mpeg/mp4格式</br>
19 * 普通文件(file):20MB</br>
20 * </p>
21 * <p>
22 * <font color='red'>临时媒体文件在后台保存时间为3天,即3天后media_id失效</font>
23 * </p>
24 *
25 * @author jinyu(foxinmy@gmail.com)
26 * @date 2014年4月2日
27 * @since JDK 1.6
28 */
29 public enum MediaType {
30 image(MimeType.IMAGE_JPG), voice(MimeType.AUDIO_MP3), video(MimeType.VIDEO_MPEG4), thumb(MimeType.IMAGE_JPG), file(
31 MimeType.MULTIPART_FORM_DATA), news(MimeType.MULTIPART_FORM_DATA);
32
33 MediaType(MimeType mimeType) {
34 this.mimeType = mimeType;
35 }
36
37 private MimeType mimeType;
38
39 public MimeType getMimeType() {
40 return mimeType;
41 }
42 }