Commit b4f487cd authored by zhangyanni's avatar zhangyanni

页面被挂起

parent ef061fe0
......@@ -372,10 +372,22 @@
//获取专题项目详情id
getArticleDetail(flag){
var that = this;
api.getArticleDetailById(this.$route.query.id,this.isAddBrowse).then((res)=>{
if(res.code==0){
this.articleInfo = res.result;
this.playerOptions.poster = res.result.videoUrl;
document.addEventListener("visibilitychange", () => {
if(document.hidden) {
// 页面被挂起,暂停播放
if(that.articleInfo.videoAudioType==1) document.getElementsByTagName("video")[0].pause();
else if(that.articleInfo.videoAudioType==0) document.getElementsByTagName("audio")[0].pause();
}else {
// 页面呼出
}
});
this.isHasPraise = res.result.isHasHot;
this.isHasCollection = res.result.isHasCollection;
if(res.result.baseContentSetting){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment