Skip to content

视频Video

HanSon edited this page Mar 16, 2017 · 1 revision

属性

属性 类型 含义
msg array 消息的原始数组

msg

Array
(
    [MsgId] => 7221216747647968794
    [FromUserName] => @2aefd23a286785769c6be1cd61d53efc
    [ToUserName] => @2aefd23a286785769c6be1cd61d53efc
    [MsgType] => 43
    [Content] => <?xml version="1.0"?>
<msg>
        <videomsg aeskey="6d5d051ce3af4a96b23337f8415d8317" cdnthumbaeskey="6d5d051ce3af4a96b23337f8415d8317" cdnvideourl="304b0201000444304202010002042cf5c13102032df98902041355d70e0204587d96ca04203132353638323630354063686174726f6f6d3733385f313438343632353631300201000201000400" cdnthumburl="304b0201000444304202010002042cf5c13102032df98902041355d70e0204587d96ca04203132353638323630354063686174726f6f6d3733385f313438343632353631300201000201000400" length="460543" playlength="6" cdnthumblength="11452" cdnthumbwidth="300" cdnthumbheight="225" fromusername="fasdsfsa" md5="8e0e241a6743d5f5ebb22b272d7ff79b" newmd5="a313fc7104c8b8e3c56ba2484e0b8f36" isad="0" />
</msg>

    [Status] => 3
    [ImgStatus] => 1
    [CreateTime] => 1484641175
    [VoiceLength] => 0
    [PlayLength] => 6
    [FileName] =>
    [FileSize] =>
    [MediaId] =>
    [Url] =>
    [AppMsgType] => 0
    [StatusNotifyCode] => 0
    [StatusNotifyUserName] =>
    [RecommendInfo] => Array
        (
            [UserName] =>
            [NickName] =>
            [QQNum] => 0
            [Province] =>
            [City] =>
            [Content] =>
            [Signature] =>
            [Alias] =>
            [Scene] => 0
            [VerifyFlag] => 0
            [AttrStatus] => 0
            [Sex] => 0
            [Ticket] =>
            [OpCode] => 0
        )

    [ForwardFlag] => 0
    [AppInfo] => Array
        (
            [AppID] =>
            [Type] => 0
        )

    [HasProductId] => 0
    [Ticket] =>
    [ImgHeight] => 225
    [ImgWidth] => 300
    [SubMsgType] => 0
    [NewMsgId] => 7221216747647968794
    [OriContent] =>
)

方法

Video::send($username, $video); 发送视频消息, $video为视频路径 Video::sendByMsgId($username, $msgId); 发送某消息id的视频

栗子

$robot->server->setMessageHandler(function ($message){
    // 视频信息 返回接收到的视频
    if ($message instanceof Video) {
        return $message;
    }
});
Clone this wiki locally