...
|
...
|
@@ -26,26 +26,58 @@ |
|
|
<?php endif;?>
|
|
|
<div class="detail-article">
|
|
|
<?php
|
|
|
$temps = $videoMatches = array();
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches1);
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches2);
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches3);
|
|
|
$temps[] = $videoMatches1;
|
|
|
$temps[] = $videoMatches2;
|
|
|
$temps[] = $videoMatches3;
|
|
|
foreach($temps as $temp)
|
|
|
preg_match_all('@<(object.*?)>(.*?)<(\/object.*?)>@si', $this->view->info['content'], $videosHtml);
|
|
|
if(!empty($videosHtml[0]))
|
|
|
{
|
|
|
if(!empty($temp[2]))
|
|
|
{
|
|
|
$videoMatches = $temp;
|
|
|
}
|
|
|
}
|
|
|
if(!empty($videoMatches[2]))
|
|
|
{
|
|
|
$video = current($videoMatches[2]);
|
|
|
$videoHtml = '<video controls="controls" preload="auto" poster="'.Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop').'" width="300" height="300" style="width:300px;height:300px;display:block;margin:auto;"><source src="'.$video.'" type="video/mp4" /></video>';
|
|
|
$this->view->info['content'] = preg_replace('@<(object.*?)>(.*?)<(\/object.*?)>@si',$videoHtml, $this->view->info['content']);
|
|
|
$this->view->info['content'] = preg_replace('@<(embed.*?)>@si', $videoHtml, $this->view->info['content']);
|
|
|
foreach($videosHtml[0] as $videoHtml)
|
|
|
{
|
|
|
$temps = array();
|
|
|
$cover = Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop');
|
|
|
$video = '';
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches1);
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches2);
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches3);
|
|
|
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohoboys\.com\/res\/www\/swf\/util\/VideoPlayerNew\.swf\?url=(.+\.mp4|.+)&title1=*&shareurl=*&coverpic=(.+)\"@i", $videoHtml, $boysVideoMatches);
|
|
|
$videoMatches1 = array_filter($videoMatches1);
|
|
|
$videoMatches2 = array_filter($videoMatches2);
|
|
|
$videoMatches3 = array_filter($videoMatches3);
|
|
|
if(!empty($videoMatches1))
|
|
|
{
|
|
|
$temps = $videoMatches1;
|
|
|
}
|
|
|
else if(!empty($videoMatches2))
|
|
|
{
|
|
|
$temps = $videoMatches2;
|
|
|
}
|
|
|
else if(!empty($videoMatches3))
|
|
|
{
|
|
|
$temps = $videoMatches3;
|
|
|
}
|
|
|
if(!empty($temps))
|
|
|
{
|
|
|
if(!empty($temps[2][0]))
|
|
|
{
|
|
|
$video = $temps[2][0];
|
|
|
}
|
|
|
}
|
|
|
else if(!empty($boysVideoMatches))
|
|
|
{
|
|
|
$temps = $boysVideoMatches;
|
|
|
if(!empty($temps[2][0]))
|
|
|
{
|
|
|
$video = $temps[2][0];
|
|
|
}
|
|
|
if(!empty($temps[3][0]))
|
|
|
{
|
|
|
$cover = $temps[3][0];
|
|
|
}
|
|
|
}
|
|
|
if(!empty($video))
|
|
|
{
|
|
|
$html = '<video controls="controls" preload="auto" poster="'.$cover.'" width="300" height="300" style="width:300px;height:300px;display:block;margin:auto;"><source src="'.$video.'" type="video/mp4" /></video>';
|
|
|
$this->view->info['content'] = str_replace($videoHtml, $html, $this->view->info['content']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
echo $this->view->info['content'];
|
|
|
?>
|
...
|
...
|
@@ -71,7 +103,8 @@ |
|
|
$thumb = empty($this->view->info['client_thumb']) ? $this->view->info['thumb'] : $this->view->info['client_thumb'];
|
|
|
echo Lib_Images::getImageUrl($thumb, 'source','fragmentimg');?>"
|
|
|
desc="<?php echo Lib_Utils_StringHelper::substr_full_en(Lib_Utils_StringHelper::stripTags($this->view->info['content']), 200);?>"
|
|
|
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>">
|
|
|
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>"
|
|
|
style="<?php echo $this->view->client ? 'display:none':'';?>">
|
|
|
<ul class="clearfix">
|
|
|
<li class="yohoo-share-button-sina"><a href="javascript:;"></a></li>
|
|
|
<li class="yohoo-share-button-qq"><a href="javascript:;"></a></li>
|
...
|
...
|
@@ -137,6 +170,7 @@ |
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//构造分享信息
|
|
|
var shareTitle = $('.title').text();
|
|
|
var shareImg = $(".share").attr("cover-url");
|
...
|
...
|
@@ -165,8 +199,13 @@ |
|
|
// wx.error(function (res) {
|
|
|
// alert(res.errMsg);
|
|
|
// });
|
|
|
seajs.use('mobile',function(mobile) {
|
|
|
|
|
|
seajs.use(['mobile','lib/util/json'],function(mobile, json) {
|
|
|
mobile.detail();
|
|
|
window.json = json;
|
|
|
});
|
|
|
function getClientShare() {
|
|
|
return window.json.stringify({title: shareTitle,desc: shareDesc,imgUrl: shareImg, link: shareLink});
|
|
|
}
|
|
|
</script>
|
|
|
<?php $this->_endblock();?> |
...
|
...
|
|