上传图文消息内的视频.

@param string $media_id    媒体Id
@param string $title       标题
@param string $description 描述

@return bool|array.  "type":"video","media_id":"IhdaAQXuvJtGzwwc0abfXnzeezfO0NgPK6AQYShD8RQYMTtfzbLdBIQkQziv2XJc","created_at":1398848981
777151
public function uploadvideo($media_id, $title, $description)
    {
        if (empty($media_id)) {
            $this->setError('参数缺失');

            return false;
        }

        $queryStr                = [];
        $queryStr['media_id']    = $media_id;
        $queryStr['title']       = $title;
        $queryStr['description'] = $description;

        $res = $this->_post('uploadvideo', $queryStr);

        return $res;
    }
749208
public function addItem($id, $content, $title = false)
    {
        $this->tooltips[$id] = $this->newItem($id, $content, $title);
    }
1223976
public function sendGraphTextByOpenid(array $toUsers, $media_id, $title = "", $description = "", $send_ignore_reprint = 1, $clientmsgid = '')
    {
        $ret = array();
        $ret['touser'] = $toUsers;
        $ret['msgtype'] = 'mpnews';
        $ret['mpnews']['media_id'] = $media_id;
        $ret['mpnews']['title'] = $title;
        $ret['mpnews']['description'] = $description;
        $ret['send_ignore_reprint'] = $send_ignore_reprint;
        $ret['clientmsgid'] = $clientmsgid;
        return $this->send($ret);
    }
637575
public function sendVideo($openId, $mediaId, $thumbMediaId, $title = null, $description = null)
    {
        return $this->sendCustomMessage([
            'touser' => $openId,
            'msgtype' => 'video',
            'video' => [
                'media_id' => $mediaId,
                'thumb_media_id' => $thumbMediaId,
                'title' => $title,
                'description' => $description
            ]
        ]);
    }
125208
public static function upload($filePath, $userid = 0,$title = '', $desc = '', $magicContext = '') {

        // $filePath = realpath($filePath);

		if (!file_exists($filePath)) {
			return array('httpcode' => 0, 'code' => self::VIDEO_FILE_NOT_EXISTS, 'message' => 'file '.$filePath.' not exists', 'data' => array());
		}

		$expired = time() + self::EXPIRED_SECONDS;
		$url = self::generateResUrl($userid);
		$sign = Auth::appSign($url, $expired);

		$data = array(
            'FileContent' => '@'.$filePath,
        );
        if ($title) {
        	$data['Title'] = $title;
        }
        if ($desc) {
        	$data['Desc'] = $desc;
        }
		if ($magicContext) {
        	$data['MagicContext'] = $magicContext;
        }

        $req = array(
            'url' => $url,
            'method' => 'post',
            'timeout' => 10,
            'data' => $data,
            'header' => array(
                'Authorization:'.$sign,
            ),
        );

		$rsp = Http::send($req);
		$info = Http::info();
		$ret = json_decode($rsp, true);

		if ($ret) {
			if (0 === $ret['code']) {
				return array(
						'httpcode' => $info['http_code'],
						'code' => $ret['code'],
						'message' => $ret['message'],
						'data' => array(
								'url' => $ret['data']['url'],
								'downloadUrl' => $ret['data']['download_url'], 'fileid' => $ret['data']['fileid'],
								'cover_url' => (isset($ret['data']['cover_url']) ? $ret['data']['cover_url'] : ""),
								)
							);
			} else {
				return array(
					'httpcode' => $info['http_code'],
					'code' => $ret['code'],
					'message' => $ret['message'],
					'data' => array()
				);
			}
		} else {
			return array(
					'httpcode' => $info['http_code'],
					'code' => self::VIDEO_NETWORK_ERROR,
					'message' => 'network error', 'data' => array()
				);
		}
	}
941768
public long video(int group, String mediaId, String title, String desc) {
		return video(new Filter(false, String.valueOf(group)), null, mediaId, title, desc);
	}
962850
public static function panel($title, $description)
    {
        $argCount = func_num_args();
        $args = func_get_args();

        $sections = array();
        for ($i = 2; $i < $argCount; ++$i) {
            $sections[$args[$i]['id']] = $args[$i];
        }

        return array(
            'title'       => $title,
            'description' => $description,
            'sections'    => $sections
        );
    }
321691
public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '')
    {
        $this->message = [
            'CreateTime'   => time(),
            'MsgType'      => 'music',
            'ToUserName'   => $this->getOpenid(),
            'FromUserName' => $this->getToOpenid(),
            'Music'        => [
                'Title'       => $title,
                'Description' => $desc,
                'MusicUrl'    => $musicurl,
                'HQMusicUrl'  => $hgmusicurl,
            ],
        ];
        if ($thumbmediaid) {
            $this->message['Music']['ThumbMediaId'] = $thumbmediaid;
        }
        return $this;
    }
247722
public function setAll($title, $description, $image = null)
    {
        $this->setTitle($title);
        $this->setDescription($description);
        if (!is_null($image)) {
            $this->setImage($image);
        }
    }
962829
public function vimeo($link, $width=480, $height=360, $portrait=true, $title=true, $byline=true) {
		$matches = array();
		$regexp = '/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*(?\'video_id\'[0-9]{6,11})[?]?.*/';
		if (preg_match_all($regexp, $link, $matches)) {
			if (array_key_exists('video_id', $matches)) {
				$embed = "//player.vimeo.com/video/" . $matches['video_id'][0];

				$opts = array();
				if (!$this->isTrue($portrait)) { $opts[] = "portrait=0"; }
				if (!$this->isTrue($title))    { $opts[] = "title=0"; }
				if (!$this->isTrue($byline))   { $opts[] = "byline=0"; }
				if (count($opts)>0) {
					$embed .="?" . implode("&amp;", $opts);
				}

				return "<iframe width=\"$width\" height=\"$height\" src=\"$embed\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
			}
		}
	}
966640
public function setDescription($id, $description)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/desc', array('value' => $description));
    }
58309
public function sendMusic($openId, $thumbMediaId, $musicUrl, $hqMusicUrl, $title = null, $description = null)
    {
        return $this->sendCustomMessage([
            'touser' => $openId,
            'msgtype' => 'music',
            'music' => [
                'thumb_media_id' => $thumbMediaId,
                'musicurl' => $musicUrl,
                'hqMusicUrl' => $hqMusicUrl,
                'title' => $title,
                'description' => $description
            ]
        ]);
    }
1318668
public function getVideoTitle()
    {
        $url = trim($this->value);
        return VideoLink::create()->setValue($url)->Title;
    }
880826
public function sendTextByGroup($group_id, $content, $title = "", $description = "")
    {
        $ret = array();
        $ret['filter']['group_id'] = $group_id;
        if (! empty($this->is_to_all)) {
            $ret['filter']['is_to_all'] = $this->is_to_all;
        }
        $ret['msgtype'] = 'text';
        $ret['text']['content'] = $content;
        $ret['text']['title'] = $title;
        $ret['text']['description'] = $description;
        return $this->sendAll($ret);
    }
117707
public function getForeverMedia($media_id, $is_video = false)
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $data = array('media_id' => $media_id);
        $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data));
        if ($result) {
            if (is_string($result) && ($json = json_decode($result, true))) {
                if (isset($json['errcode'])) {
                    $this->errCode = $json['errcode'];
                    $this->errMsg = $json['errmsg'];
                    return $this->checkRetry(__FUNCTION__, func_get_args());
                }
                return $json;
            }
            return $result;
        }
        return false;
    }
1279200
public function build($id = '', $class = '', $content = null, $title = 'Window Frame')
    {
        // Set basic properties
        $this->type(Popup::TP_PERSISTENT, false);
        $this->binding('on');

        // Create wFrame
        $id = 'wf_' . (empty($id) ? mt_rand() : $id);
        $this->wFrame = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', $id, 'window-frame');
        $this->wFrame->addClass($class);

        // Build parent element and append content to frame
        parent::build($id, $this->wFrame);

        // Create header
        $frameHeader = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'frame-header');
        $this->appendToFrame($frameHeader);

        // Header Title
        $frameTitle = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('span', $title, '', 'frame-title');
        $frameHeader->append($frameTitle);

        // Close button
        $closeBtn = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('span', '', '', 'button-close');
        $frameHeader->append($closeBtn);

        // Create body
        $this->body = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'frame-body');
        $this->appendToFrame($this->body);

        // Append given content to frame body, if any
        $this->appendToBody($content);

        return $this;
    }
532700
public function initializeMediaFromUploadedFile(UploadedFile $uploadedFile, $folderId, $siteId, $title = null)
    {
        /** @var MediaInterface $media */
        $media = new $this->mediaClass();
        $media->setSiteId($siteId);
        $media->setFile($uploadedFile);
        $media->setFilesystemName($uploadedFile->getFilename());
        $media->setMediaFolder($this->folderRepository->find($folderId));
        $media->setName($uploadedFile->getClientOriginalName());
        $media->setMimeType($uploadedFile->getMimeType());
        if (null === $title) {
            $title = $uploadedFile->getFilename();
        }
        foreach ($this->frontLanguages as $language) {
            $media->addTitle($language, $title);
        }

        return $media;
    }