2017-01-01 60 views
0

我使用PlusThis進行視頻跟蹤,下面的代碼在查看站點的桌面版本時工作正常,但是,當我使用移動設備時,視頻顯然沒有響應。在iframe響應中製作iframe和視頻

爲了使用PlusThis功能,我需要使用下面的代碼,我無法弄清楚如何使它響應:

<iframe id="vimeo_187396498" src="https://player.vimeo.com/video/187388888" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
<script type="text/javascript"> 
    PTFeatureBase.setContactId('[memb_contact fields="Id"]'); 
    PTFeatureBase.setContactEmail('[memb_contact fields="Email"]'); 
    PTVideoTriggers.listen({ 
     type: "vimeo", 
     playerId: "vimeo_187399998", 
     feature: "1545-MHe1qQxtRTKCd4cTdB5aDcedYjgJORyfcidK6gv1", 
     triggerType: "cue", 
     times: [660] 
    }); 
</script> 

可能有人請告訴我如何使這個代碼響應同時仍然保持我需要使用PlusThis功能的完整JavaScript?

回答

0

PTFeatureBase.setContactId('[memb_contact fields="Id"]'); 
 
    PTFeatureBase.setContactEmail('[memb_contact fields="Email"]'); 
 
    PTVideoTriggers.listen({ 
 
    type: "vimeo", 
 
    playerId: "vimeo_187399998", 
 
    feature: "1545-MHe1qQxtRTKCd4cTdB5aDcedYjgJORyfcidK6gv1", 
 
    triggerType: "cue", 
 
    times: [660] 
 
    });
iframe{ 
 
    width:100%; 
 
    height:auto; 
 
}
<iframe id="vimeo_187396498" src="https://player.vimeo.com/video/187388888" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

0
<iframe id="vimeo_187396498" src="https://player.vimeo.com/video/187388888" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 

您使用iframe標籤內的寬度和高度。所以,請將該iframe標記放在div區域中,並將css iframe作爲div子項。請按照下面的例子: HTML代碼:

<div class="videoiframe"> 
<iframe id="vimeo_187396498" src="https://player.vimeo.com/video/187388888" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 
</div> 

CSS代碼:

.videoiframe iframe {width:100%; height: auto} 

我希望,你猜對了。