player.wxml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <view class="plv-player">
  2. <!-- 直播播放器 -->
  3. <plv-live-player
  4. id="plv-live-player"
  5. wx:if="{{ mode === 'live' }}"
  6. skin="{{ skin }}"
  7. id="plvLivePlayerComp"
  8. videoOption="{{ videoOption }}"
  9. objectFit="{{ objectFit }}"
  10. menuType="{{ menuType }}"
  11. isSwitched="{{ isSwitched }}"
  12. usePlayerSkin="{{ usePlayerSkin }}"
  13. allowDanmu="{{ allowDanmu }}"
  14. skinAlwaysShow="{{ skinAlwaysShow }}"
  15. bind:onLiveStorageProgress="onLiveStorageProgress"
  16. bind:onLiveVodEnd="onLiveVodEnd"
  17. bind:onLiveStatusChange="onLiveStatusChange"
  18. bind:refreshStatus="onRefreshStatus"
  19. >
  20. <slot></slot>
  21. </plv-live-player>
  22. <!-- 点播播放器 -->
  23. <view class="plv-mp-vod-player-box" wx:else>
  24. <video
  25. class="plv-mp-vod-player-box-video"
  26. id="plvVodPlayer"
  27. src="{{ vodSrc }}"
  28. muted="{{ muted }}"
  29. autoplay
  30. custom-cache="{{false}}"
  31. picture-in-picture-mode="{{ pipMode }}"
  32. enable-danmu="{{ true }}"
  33. object-fit="contain"
  34. bindtap="showSetControl"
  35. bindtimeupdate="onVodTimeUpdate"
  36. bindplay="onVodPlay"
  37. bindpause="onVodPause"
  38. bindwaiting="onVodWaiting"
  39. bindended="onVodEnded"
  40. binderror="onVodError">
  41. <cover-image wx:if="{{ isCamClosed === 1 }}" src="https://playertest.polyv.net/player2/test/nong/nocamera_ppt.jpg"></cover-image>
  42. <cover-image bindtap="setting" wx:if="{{ usePlayerSkin && showSettingBtn }}" class="plv-control-setting-playback" src="../../assets/images/setting.png"></cover-image>
  43. <cover-view class="plv-control-setting-content" bindtap="hideSettingContent" wx:if="{{ settingShow }}">
  44. <cover-view class="plv-setting-head">
  45. <cover-view class="head-item" bindtap="danmuSwitch">
  46. <cover-image class="setting-content__image" src="../../assets/images/{{ danmuEnabled ? 'selected' : 'unselect' }}.png"></cover-image>
  47. <button class="setting-content__btn">弹幕</button>
  48. </cover-view>
  49. </cover-view>
  50. <cover-view class="plv-control-setting-detail control-rate">
  51. <cover-view class="setting-detail-item">倍速</cover-view>
  52. <cover-view
  53. wx:for="{{ ['0.5x', '1.0x', '1.25x', '1.5x', '2.0'] }}"
  54. wx:key="index"
  55. bindtap="changeRate"
  56. data-index="{{ index }}"
  57. class="setting-item-btn setting-btn-rate {{ currentRate === index ? 'btn-selected' : '' }}">{{ item }}</cover-view>
  58. </cover-view>
  59. </cover-view>
  60. <slot></slot>
  61. </video>
  62. </view>
  63. </view>