|
|
@@ -1,85 +1,93 @@
|
|
|
<template>
|
|
|
<div class="home-wrap">
|
|
|
- <div class="left">
|
|
|
- <div
|
|
|
- class="cover"
|
|
|
- :style="{ backgroundImage: `url(${currentLiveRoom?.coverImg})` }"
|
|
|
- ></div>
|
|
|
- <!-- x-webkit-airplay这个属性应该是使此视频支持ios的AirPlay功能 -->
|
|
|
- <!-- playsinline、 webkit-playsinline IOS微信浏览器支持小窗内播放 -->
|
|
|
- <!-- x5-video-player-type 启用H5播放器,是wechat安卓版特性 -->
|
|
|
- <!-- x5-video-player-fullscreen 全屏设置 -->
|
|
|
- <!-- x5-video-orientation 声明播放器支持的方向,可选值landscape横屏,portraint竖屏。默认值portraint。 -->
|
|
|
- <video
|
|
|
- v-if="currentLiveRoom?.flvurl"
|
|
|
- id="localVideo"
|
|
|
- ref="localVideoRef"
|
|
|
- autoplay
|
|
|
- playsinline
|
|
|
- webkit-playsinline="true"
|
|
|
- x-webkit-airplay="allow"
|
|
|
- x5-video-player-type="h5"
|
|
|
- x5-video-player-fullscreen="true"
|
|
|
- x5-video-orientation="portraint"
|
|
|
- :muted="appStore.muted"
|
|
|
- ></video>
|
|
|
- <template v-if="currentLiveRoom">
|
|
|
- <div class="controls">
|
|
|
- <VideoControls></VideoControls>
|
|
|
- </div>
|
|
|
- <div class="join-btn">
|
|
|
- <div
|
|
|
- v-if="currentLiveRoom.system === 2"
|
|
|
- class="btn webrtc"
|
|
|
- @click="joinRoom()"
|
|
|
- >
|
|
|
- 进入直播(webrtc)
|
|
|
+ <div class="banner"></div>
|
|
|
+ <div class="container">
|
|
|
+ <div class="left">
|
|
|
+ <div
|
|
|
+ class="cover"
|
|
|
+ :style="{ backgroundImage: `url(${currentLiveRoom?.coverImg})` }"
|
|
|
+ ></div>
|
|
|
+ <!-- x-webkit-airplay这个属性应该是使此视频支持ios的AirPlay功能 -->
|
|
|
+ <!-- playsinline、 webkit-playsinline IOS微信浏览器支持小窗内播放 -->
|
|
|
+ <!-- x5-video-player-type 启用H5播放器,是wechat安卓版特性 -->
|
|
|
+ <!-- x5-video-player-fullscreen 全屏设置 -->
|
|
|
+ <!-- x5-video-orientation 声明播放器支持的方向,可选值landscape横屏,portraint竖屏。默认值portraint。 -->
|
|
|
+ <video
|
|
|
+ v-if="currentLiveRoom?.flvurl"
|
|
|
+ id="localVideo"
|
|
|
+ ref="localVideoRef"
|
|
|
+ autoplay
|
|
|
+ playsinline
|
|
|
+ webkit-playsinline="true"
|
|
|
+ x-webkit-airplay="allow"
|
|
|
+ x5-video-player-type="h5"
|
|
|
+ x5-video-player-fullscreen="true"
|
|
|
+ x5-video-orientation="portraint"
|
|
|
+ :muted="appStore.muted"
|
|
|
+ ></video>
|
|
|
+ <template v-if="currentLiveRoom">
|
|
|
+ <div class="controls">
|
|
|
+ <VideoControls></VideoControls>
|
|
|
+ </div>
|
|
|
+ <div class="join-btn">
|
|
|
+ <div
|
|
|
+ v-if="currentLiveRoom.system === 2"
|
|
|
+ class="btn webrtc"
|
|
|
+ @click="joinRoom()"
|
|
|
+ >
|
|
|
+ 进入直播(webrtc)
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="currentLiveRoom?.flvurl"
|
|
|
+ class="btn flv"
|
|
|
+ @click="joinFlvRoom()"
|
|
|
+ >
|
|
|
+ 进入直播(flv)
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div
|
|
|
+ v-if="liveRoomList.length"
|
|
|
+ class="list"
|
|
|
+ >
|
|
|
<div
|
|
|
- v-if="currentLiveRoom?.flvurl"
|
|
|
- class="btn flv"
|
|
|
- @click="joinFlvRoom()"
|
|
|
+ v-for="(item, index) in liveRoomList"
|
|
|
+ :key="index"
|
|
|
+ :class="{
|
|
|
+ item: 1,
|
|
|
+ active: item.live_room_id === currentLiveRoom?.live_room_id,
|
|
|
+ }"
|
|
|
+ :style="{ backgroundImage: `url(${item.coverImg})` }"
|
|
|
+ @click="changeLiveRoom(item)"
|
|
|
>
|
|
|
- 进入直播(flv)
|
|
|
+ <div
|
|
|
+ class="border"
|
|
|
+ :style="{
|
|
|
+ opacity:
|
|
|
+ item.live_room_id === currentLiveRoom?.live_room_id ? 1 : 0,
|
|
|
+ }"
|
|
|
+ ></div>
|
|
|
+ <div
|
|
|
+ v-if="item.live_room_id === currentLiveRoom?.live_room_id"
|
|
|
+ class="triangle"
|
|
|
+ ></div>
|
|
|
+ <div class="txt">{{ item.live_room?.roomName }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <div
|
|
|
- v-if="liveRoomList.length"
|
|
|
- class="list"
|
|
|
- >
|
|
|
<div
|
|
|
- v-for="(item, index) in liveRoomList"
|
|
|
- :key="index"
|
|
|
- :class="{
|
|
|
- item: 1,
|
|
|
- active: item.live_room_id === currentLiveRoom?.live_room_id,
|
|
|
- }"
|
|
|
- :style="{ backgroundImage: `url(${item.coverImg})` }"
|
|
|
- @click="changeLiveRoom(item)"
|
|
|
+ v-else
|
|
|
+ class="none"
|
|
|
>
|
|
|
- <div
|
|
|
- class="border"
|
|
|
- :style="{
|
|
|
- opacity:
|
|
|
- item.live_room_id === currentLiveRoom?.live_room_id ? 1 : 0,
|
|
|
- }"
|
|
|
- ></div>
|
|
|
- <div
|
|
|
- v-if="item.live_room_id === currentLiveRoom?.live_room_id"
|
|
|
- class="triangle"
|
|
|
- ></div>
|
|
|
- <div class="txt">{{ item.live_room?.roomName }}</div>
|
|
|
+ 当前没有在线的直播间
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div
|
|
|
- v-else
|
|
|
- class="none"
|
|
|
- >
|
|
|
- 当前没有在线的直播间
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="foot">
|
|
|
+ <h1>billd-live当前是beta状态,欢迎测试~</h1>
|
|
|
+ <h2>billd-live目前只有作者一人维护,期待有志者参与~</h2>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -172,187 +180,191 @@ function joinFlvRoom() {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.home-wrap {
|
|
|
- padding: 20px 0;
|
|
|
- min-width: $large-width;
|
|
|
- height: 610px;
|
|
|
- background-color: papayawhip;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .left {
|
|
|
- position: relative;
|
|
|
- display: inline-block;
|
|
|
- overflow: hidden;
|
|
|
- box-sizing: border-box;
|
|
|
- width: $large-left-width;
|
|
|
- height: 610px;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
- vertical-align: top;
|
|
|
-
|
|
|
- @extend %coverBg;
|
|
|
+ .container {
|
|
|
+ padding: 20px 0;
|
|
|
+ min-width: $large-width;
|
|
|
+ background-color: papayawhip;
|
|
|
+ text-align: center;
|
|
|
+ .left {
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ overflow: hidden;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: $large-left-width;
|
|
|
+ height: 610px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
+ vertical-align: top;
|
|
|
|
|
|
- .cover {
|
|
|
- position: absolute;
|
|
|
- background-position: center center;
|
|
|
- background-size: cover;
|
|
|
- filter: blur(30px);
|
|
|
+ @extend %coverBg;
|
|
|
|
|
|
- inset: 0;
|
|
|
- }
|
|
|
+ .cover {
|
|
|
+ position: absolute;
|
|
|
+ background-position: center center;
|
|
|
+ background-size: cover;
|
|
|
+ filter: blur(30px);
|
|
|
|
|
|
- #localVideo {
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- .controls {
|
|
|
- display: none;
|
|
|
- }
|
|
|
+ inset: 0;
|
|
|
+ }
|
|
|
|
|
|
- &:hover {
|
|
|
- .join-btn {
|
|
|
- display: inline-flex;
|
|
|
+ #localVideo {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
.controls {
|
|
|
- display: block;
|
|
|
+ display: none;
|
|
|
}
|
|
|
- }
|
|
|
- .join-btn {
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- display: none;
|
|
|
- align-items: center;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
|
|
- .btn {
|
|
|
- padding: 14px 26px;
|
|
|
- border: 2px solid rgba($color: papayawhip, $alpha: 0.5);
|
|
|
- border-radius: 6px;
|
|
|
- background-color: rgba(0, 0, 0, 0.3);
|
|
|
- color: papayawhip;
|
|
|
- font-size: 16px;
|
|
|
- cursor: pointer;
|
|
|
- &:hover {
|
|
|
- background-color: rgba($color: papayawhip, $alpha: 0.5);
|
|
|
- color: white;
|
|
|
+ &:hover {
|
|
|
+ .join-btn {
|
|
|
+ display: inline-flex;
|
|
|
}
|
|
|
- &.webrtc {
|
|
|
- margin-right: 10px;
|
|
|
+ .controls {
|
|
|
+ display: block;
|
|
|
}
|
|
|
- &.flv {
|
|
|
+ }
|
|
|
+ .join-btn {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ display: none;
|
|
|
+ align-items: center;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ padding: 14px 26px;
|
|
|
+ border: 2px solid rgba($color: papayawhip, $alpha: 0.5);
|
|
|
+ border-radius: 6px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.3);
|
|
|
+ color: papayawhip;
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ background-color: rgba($color: papayawhip, $alpha: 0.5);
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ &.webrtc {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ &.flv {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .right {
|
|
|
- display: inline-block;
|
|
|
- overflow: scroll;
|
|
|
- box-sizing: border-box;
|
|
|
- margin-left: 10px;
|
|
|
- padding: 12px;
|
|
|
- height: 610px;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
- vertical-align: top;
|
|
|
+ .right {
|
|
|
+ display: inline-block;
|
|
|
+ overflow: scroll;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-left: 10px;
|
|
|
+ padding: 12px;
|
|
|
+ height: 610px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
+ vertical-align: top;
|
|
|
|
|
|
- .list {
|
|
|
- .item {
|
|
|
- position: relative;
|
|
|
- box-sizing: border-box;
|
|
|
- margin-bottom: 10px;
|
|
|
- width: 200px;
|
|
|
- height: 110px;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
- cursor: pointer;
|
|
|
+ .list {
|
|
|
+ .item {
|
|
|
+ position: relative;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ width: 200px;
|
|
|
+ height: 110px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: rgba($color: #000000, $alpha: 0.3);
|
|
|
+ cursor: pointer;
|
|
|
|
|
|
- @extend %coverBg;
|
|
|
+ @extend %coverBg;
|
|
|
|
|
|
- &:last-child {
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- .border {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- z-index: 1;
|
|
|
- border: 2px solid papayawhip;
|
|
|
- border-radius: 4px;
|
|
|
- }
|
|
|
- .triangle {
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 0;
|
|
|
- display: inline-block;
|
|
|
- border: 5px solid transparent;
|
|
|
- border-right-color: papayawhip;
|
|
|
- transform: translate(-100%, -50%);
|
|
|
- }
|
|
|
- &.active {
|
|
|
- &::before {
|
|
|
- background-color: transparent;
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .border {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ border: 2px solid papayawhip;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .triangle {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 0;
|
|
|
+ display: inline-block;
|
|
|
+ border: 5px solid transparent;
|
|
|
+ border-right-color: papayawhip;
|
|
|
+ transform: translate(-100%, -50%);
|
|
|
+ }
|
|
|
+ &.active {
|
|
|
+ &::before {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:hover {
|
|
|
+ &::before {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- &:hover {
|
|
|
&::before {
|
|
|
- background-color: transparent;
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
|
+ content: '';
|
|
|
+ transition: all cubic-bezier(0.22, 0.58, 0.12, 0.98) 0.4s;
|
|
|
+ }
|
|
|
+ .txt {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 4px 8px;
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 0 0 4px 4px;
|
|
|
+ background-image: linear-gradient(
|
|
|
+ -180deg,
|
|
|
+ rgba(0, 0, 0, 0),
|
|
|
+ rgba(0, 0, 0, 0.6)
|
|
|
+ );
|
|
|
+ color: white;
|
|
|
+ text-align: initial;
|
|
|
+ font-size: 13px;
|
|
|
}
|
|
|
- }
|
|
|
- &::before {
|
|
|
- position: absolute;
|
|
|
- display: block;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: rgba(0, 0, 0, 0.4);
|
|
|
- content: '';
|
|
|
- transition: all cubic-bezier(0.22, 0.58, 0.12, 0.98) 0.4s;
|
|
|
- }
|
|
|
- .txt {
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 4px 8px;
|
|
|
- width: 100%;
|
|
|
- border-radius: 0 0 4px 4px;
|
|
|
- background-image: linear-gradient(
|
|
|
- -180deg,
|
|
|
- rgba(0, 0, 0, 0),
|
|
|
- rgba(0, 0, 0, 0.6)
|
|
|
- );
|
|
|
- color: white;
|
|
|
- text-align: initial;
|
|
|
- font-size: 13px;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .none {
|
|
|
- width: 200px;
|
|
|
- color: white;
|
|
|
- font-size: 14px;
|
|
|
+ .none {
|
|
|
+ width: 200px;
|
|
|
+ color: white;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ .foot {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 屏幕宽度小于$large-width的时候
|
|
|
@media screen and (max-width: $large-width) {
|
|
|
.home-wrap {
|
|
|
- height: 460px;
|
|
|
- .left {
|
|
|
- width: $medium-left-width;
|
|
|
- height: 460px;
|
|
|
- }
|
|
|
- .right {
|
|
|
- height: 460px;
|
|
|
+ .container {
|
|
|
+ .left {
|
|
|
+ width: $medium-left-width;
|
|
|
+ height: 460px;
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ height: 460px;
|
|
|
|
|
|
- .list {
|
|
|
- .item {
|
|
|
- width: 150px;
|
|
|
- height: 80px;
|
|
|
+ .list {
|
|
|
+ .item {
|
|
|
+ width: 150px;
|
|
|
+ height: 80px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|