# 观看限制

## 功能介绍

new Vue({ el: '#player', data() { return { vodPlayerJs: 'https://player.polyv.net/script/player.js', vid: '1b448be323f16d2aebd4e7749d71a24d\_1', }; }, mounted(){ this.loadPlayerScript(this.loadPlayer); }, methods: { loadPlayerScript(callback) { if (!window.polyvPlayer) { const myScript = document.createElement('script'); myScript.setAttribute('src', this.vodPlayerJs); myScript.onload = callback; document.body.appendChild(myScript); } else { callback(); } }, loadPlayer() { const polyvPlayer = window.polyvPlayer; this.player = polyvPlayer({ wrap: '#player', vid: this.vid , autoplay:false }); } }, destroyed() { if (this.player) { this.player.destroy(); } } })

## 使用介绍

1、对于公开的直播，所有观众都可以进入观看；当直播内容（付费课程、内部培训）需要一定条件才可以观看时，观众需要通过对应的验证来观看；保利威直播间支持同时设置两种验证条件，观众通过其一即可。

2、观看条件介绍：

| 观看条件  | 功能介绍                                                                                            | 使用场景                       |
| ----- | ----------------------------------------------------------------------------------------------- | -------------------------- |
| 付费观看  | <p>观众需要付费成功才能进入直播观看页，同时也支持试看一段时间<br>付费有效期分为：<br>1、一次性付费永久有效<br>2、设置付费有效日期<br>3、设置付费有效时长<br></p> | 付费课程                       |
| 白名单观看 | 处于白名单里的用户输入正确的验证后，可以直接观看直播                                                                      | VIP会员用户观看                  |
| 登记观看  | 根据要求填写完相关的内容即可观看                                                                                | 有收集观众资料的需求时，作为营销的数据支持      |
| 验证码观看 | 输入正确的验证码即可观看                                                                                    | 观众可以通过扫二维码获取验证码，可以给公众号快速吸粉 |
| 企微观看  | 仅允许企业员工观看，非企业员工将无法观看直播                                                                          | 企业内部直播                     |

3、自定义授权、外部授权、独立授权：适合自有用户系统的机构，验证观众是否可观看直播的逻辑由客户第三方系统自行实现

| 授权类型  | 示例                                       | 说明文档                                                                                                                                    |
| ----- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| 独立授权  | http://demo.polyv.net/wfy/directAuth.php | [独立授权](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/direct_auth/README.md)              |
| 自定义授权 | http://live.polyv.cn/watch/104400        | [自定义授权](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/customauth_2/README.md)            |
| 外部授权  | http://demo.polyv.net/chenwb/open.php    | [外部授权](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/external_authorization_2/README.md) |

## 观众端效果

| 观看条件  | SaaS-Web                                                                                                                                                                                                                                                                       | SaaS-H5                                                                                                                                                                                                                                                                           |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 白名单观看 | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-86fca0ccfddb172482248f05640eaa0196e18757%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E7%99%BD%E5%90%8D%E5%8D%95%E8%A7%82%E7%9C%8B.png?alt=media) | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-3e5727005fc444b52588a36de67101691fcbe2af%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E7%99%BD%E5%90%8D%E5%8D%95%E8%A7%82%E7%9C%8B-h5.png?alt=media) |
| 付费观看  | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-ab014a827e515f382c8b045e7a40f68fa394aca3%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E4%BB%98%E8%B4%B9%E8%A7%82%E7%9C%8B.png?alt=media)          | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-09638308ee882bc3ea60ca423e106e347add6d1d%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E4%BB%98%E8%B4%B9%E8%A7%82%E7%9C%8B-h5.png?alt=media)          |
| 验证码观看 | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-e91f8c78c71880621995d6217bfab70781b8b2fc%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E9%AA%8C%E8%AF%81%E7%A0%81.png?alt=media)                   | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-0df9213d690af53cab0f48e58002ab76c3337391%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E9%AA%8C%E8%AF%81%E7%A0%81%E8%A7%82%E7%9C%8B-h5.png?alt=media) |
| 登记观看  | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-cbb856413678ce61cdf47826d52c899138a815a4%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E7%99%BB%E8%AE%B0%E8%A7%82%E7%9C%8B.png?alt=media)          | ![](https://6941759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmV4PIbrO79lRJl9HCeLg%2Fuploads%2Fgit-blob-769bf7853b77d30607865aee7f793519ea204b6b%2F%E8%A7%82%E7%9C%8B%E9%99%90%E5%88%B6-%E7%99%BB%E8%AE%B0%E8%A7%82%E7%9C%8B-h5.png?alt=media)          |

## 端侧支持情况

| 端侧              | 描述  |
| --------------- | --- |
| SaaS观看页         | 支持  |
| WEB-SDK（观看页SDK） | 支持  |
| 移动端-多场景SDK      | 不支持 |

## 相关API接口

相关API接口如下：

| 接口名称                                                                                                                                         | 描述             |
| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| [查询频道观看条件](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/get_watch_condition/README.md)       | 查询频道观看条件       |
| [修改频道观看条件](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/set_watch_condition/README.md)       | 修改频道或通用设置的观看条件 |
| [修改频道外部授权设置](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/set_externalauth/README.md)        | 设置频道外部授权       |
| [修改频道自定义授权设置](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/web/watch_condition/set_authorized_address/README.md) | 修改频道自定义授权设置    |
