com.foxinmy.weixin4j.type
Enum MediaType

java.lang.Object
  extended by java.lang.Enum<MediaType>
      extended by com.foxinmy.weixin4j.type.MediaType
All Implemented Interfaces:
Serializable, Comparable<MediaType>

public enum MediaType
extends Enum<MediaType>

上传的媒体类型

公众平台上传限制:
图片(image): 2MB,支持bmp/png/jpeg/jpg/gif格式
语音(voice):2MB,播放长度不超过60s,支持mp3/wma/wav/amr格式
视频(video):10MB,支持rm/rmvb/wmv/avi/mpg/mpeg/mp4格式
缩略图(thumb):64KB,支持JPG格式

企业号上传限制:
图片(image):1MB,支持bmp/png/jpeg/jpg/gif格式
语音(voice):2MB,播放长度不超过60s,支持mp3/wma/wav/amr格式
视频(video):10MB,支持rm/rmvb/wmv/avi/mpg/mpeg/mp4格式
普通文件(file):20MB

临时媒体文件在后台保存时间为3天,即3天后media_id失效

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)

Enum Constant Summary
file
           
image
           
news
           
thumb
           
video
           
voice
           
 
Method Summary
 MimeType getMimeType()
           
static MediaType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MediaType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

image

public static final MediaType image

voice

public static final MediaType voice

video

public static final MediaType video

thumb

public static final MediaType thumb

file

public static final MediaType file

news

public static final MediaType news
Method Detail

values

public static MediaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MediaType c : MediaType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MediaType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getMimeType

public MimeType getMimeType()


Copyright © 2014–2017. All rights reserved.