鍍金池/ 問答/HTML/ VideoCapture permission has been blocked

VideoCapture permission has been blocked ...

VideoCapture permission has been blockedbecause of a Feature Policy applied to the current document.
<template>
<div class="weiyi-classroom-container">
    <div class="weiyi-classroom-outer">
        <iframe id="classroom-iframe" 
        frameborder=0 
        name="showHere" 
        scrolling=auto 
        :src="classroomUrl"></iframe>
    </div>
</div>
</template>

iframe下的src鏈接是我的直播鏈接,用qq,搜狗,360都能打開攝相頭,唯獨chrome打不開,而且報了上面的警告,請問哪位知道如何解決不,在線等

回答
編輯回答
深記你

問題解決了,iframe設(shè)置允許就可以了

To continue to use permissions from iframes on your website...
This deprecation is expected to ship in Chrome M64 (around January 2018). At that time, if a cross-origin iframe attempts to use permission without the feature being explicitly allowed, a console warning will be logged and the feature will fail in a similar way as it would if a user had denied a permission prompt.

If you are a developer of a website which uses cross-origin iframes and you want those iframes to continue to be able to request/use one of the above features, the page that embeds the iframe will need to be changed. The simplest way to do that is to modify the <iframe> tag to include an allow attribute which specifies the name of the permission. For example, to enable geolocation and mic/camera for an iframe, the following would be specified:

<iframe src="https://example.com" allow="geolocation; microphone; camera"></iframe>

Valid values for allow include:
geolocation
microphone
camera
midi
encrypted-media
Note that if the iframe which is using the permission has the same origin as the top level page, then no changes have to be made.

參考:https://sites.google.com/a/ch...

2017年1月10日 05:48