Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49753565
authored
Aug 29, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
删除直播代码
1 parent
d2738178
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
221 deletions
src/views/crowdfunding/components/LiveBox.vue
src/views/crowdfunding/components/index.js
src/views/crowdfunding/index.vue
src/views/crowdfunding/components/LiveBox.vue
deleted
100644 → 0
View file @
d273817
<
template
>
<div
:class=
"['live-box',
{ videoFullscreen: videoFullscreen }]" :style="videoStyle" id="live-box">
<div
class=
"mask"
@
click=
"openFullscreen"
>
<div
class=
"sprite-icon icon-live-close"
></div>
<div
class=
"status flex"
>
<div
class=
"live-line"
>
<div
class=
"side"
></div>
<div
class=
"center side"
></div>
<div
class=
"side"
></div>
</div>
<div
class=
"text"
>
正在直播
</div>
</div>
<template
v-if=
"!IsIOS"
>
<img
src=
"https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif"
alt=
""
/>
</
template
>
</div>
<div
class=
"fullscreen-btn"
@
click=
"openFullscreen(false)"
>
<img
src=
"https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/fullscreen.png"
/>
</div>
<div
class=
"poster-btn"
@
click=
"showKf = true"
>
<img
src=
"https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/gift.gif"
/>
</div>
<video
id=
"player-container-id"
preload=
"auto"
playsinline
webkit-playsinline
></video>
<kf-modal
v-model=
"showKf"
:detail=
"detail"
/>
</div>
</template>
<
script
type=
"text/ecmascript-6"
>
import
{
KfModal
}
from
'./index'
import
{
wxConfig
}
from
'@/api'
export
default
{
components
:
{
KfModal
},
name
:
'LiveBox'
,
data
()
{
return
{
player
:
null
,
videoFullscreen
:
false
,
showKf
:
false
,
detail
:
{
customerServiceQrImg
:
'https://img02.glsx.com.cn/weapp/resource/h5/images/123.png'
},
videoStyle
:
''
}
},
mounted
()
{
let
_this
=
this
wxConfig
.
ready
(()
=>
{
if
(
Hls
.
isSupported
())
{
_this
.
video
=
document
.
getElementById
(
'player-container-id'
);
_this
.
hls
=
new
Hls
();
// bind them together
_this
.
hls
.
attachMedia
(
_this
.
video
);
}
_this
.
player
=
TCPlayer
(
'player-container-id'
,
{
// fileID: '387702305074716718', //点播ID
// appID: '1311227058', //点播APPID
autoplay
:
true
,
// 自动播放
loop
:
true
,
// 循环播放
muted
:
true
,
//是否静音
controlBar
:
{
//控制条配置
fullscreenToggle
:
false
//隐藏全屏按钮
},
webrtcConfig
:
{
//webrtcConfig 参数列表
showLog
:
true
// 打印webrtc日志
}
})
// _this.player.src('http://play.glsx.com.cn/live/live.m3u8') //直播地址
_this
.
player
.
src
(
'webrtc://play.glsx.com.cn/live/live_normal'
)
wx
.
getNetworkType
({
success
:
(
result
)
=>
{
_this
.
player
.
ready
(
function
()
{
//设置播放器初始化完成后的回调
console
.
log
(
'-------------------------'
,
_this
.
player
.
poster
())
_this
.
player
.
play
()
//播放视频
_this
.
draggable
(
document
.
getElementById
(
'live-box'
),
_this
.
openFullscreen
)
})
}
})
_this
.
player
.
on
(
'webrtcevent'
,
function
(
event
)
{
//监听webrtc
console
.
log
(
event
)
})
_this
.
hls
.
on
(
Hls
.
Events
.
ERROR
,
function
(
event
,
data
)
{
if
(
data
.
fatal
)
{
switch
(
data
.
type
)
{
case
Hls
.
ErrorTypes
.
NETWORK_ERROR
:
// try to recover network error
console
.
log
(
'fatal network error encountered, try to recover'
);
_this
.
hls
.
startLoad
()
break
case
Hls
.
ErrorTypes
.
MEDIA_ERROR
:
console
.
log
(
'fatal media error encountered, try to recover'
);
_this
.
hls
.
recoverMediaError
();
break
;
default
:
// cannot recover
_this
.
hls
.
destroy
();
break
;
}
}
});
})
},
methods
:
{
openFullscreen
(
status
=
true
)
{
//打开关闭全屏
let
[
live
]
=
document
.
getElementsByClassName
(
'live-box'
)
let
[
volumePanel
]
=
document
.
getElementsByClassName
(
'vjs-volume-panel '
)
let
[
volume
]
=
volumePanel
.
getElementsByClassName
(
'vjs-mute-control'
)
volume
.
click
()
this
.
player
.
play
()
this
.
videoFullscreen
=
status
live
.
id
=
status
?
''
:
'live-box'
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.live-box
{
position
:
fixed
;
top
:
23%
;
left
:
calc
(
98%
-
86px
);
z-index
:
7
;
width
:
86px
;
height
:
148px
;
border-radius
:
4px
;
overflow
:
hidden
;
-webkit-user-select
:
auto
;
.mask
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
2
;
border
:
2px
solid
#f95d35
;
border-radius
:
4px
;
box-sizing
:
border-box
;
.icon-live-close
{
position
:
absolute
;
top
:
0
;
right
:
0
;
}
img
{
object-fit
:
contain
;
height
:
126px
;
}
.status
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
width
:
100%
;
height
:
18px
;
background
:
linear-gradient
(
291deg
,
#f6542b
0%
,
#ff6c47
100%
),
linear-gradient
(
270deg
,
rgba
(
255
,
57
,
0
,
0
)
0%
,
#ff3900
33%
,
#fd466f
100%
);
font-size
:
12px
;
font-weight
:
500
;
color
:
#ffffff
;
box-sizing
:
border-box
;
padding
:
0
9px
;
.text
{
margin-left
:
auto
;
}
}
}
#player-container-id
{
width
:
100%
;
height
:
100%
;
video
{
object-fit
:
cover
!important
;
}
}
.fullscreen-btn
{
display
:
none
;
position
:
absolute
;
right
:
8px
;
top
:
14px
;
width
:
32px
;
height
:
32px
;
z-index
:
2
;
}
.poster-btn
{
display
:
none
;
position
:
absolute
;
left
:
17px
;
top
:
17px
;
width
:
76px
;
height
:
115px
;
z-index
:
2
;
}
/
deep
/
.vjs-control-bar
{
opacity
:
0
;
}
}
.videoFullscreen
{
width
:
100vw
!important
;
height
:
100vh
!important
;
left
:
0
!important
;
top
:
0
!important
;
right
:
0
!important
;
bottom
:
0
!important
;
border
:
none
!important
;
.mask
{
display
:
none
;
}
.fullscreen-btn
,
.poster-btn
{
display
:
block
;
}
/
deep
/
.vjs-control-bar
{
opacity
:
1
!important
;
}
}
</
style
>
src/views/crowdfunding/components/index.js
View file @
4975356
...
...
@@ -3,12 +3,10 @@ import CountDown from './CountDown.vue'
import
Action
from
'./Action.vue'
import
KfModal
from
'./KfModal.vue'
import
createOrderImg
from
'./createOrderImg.vue'
import
LiveBox
from
'./LiveBox.vue'
export
{
MoveGroup
,
CountDown
,
Action
,
KfModal
,
createOrderImg
,
LiveBox
createOrderImg
}
\ No newline at end of file
src/views/crowdfunding/index.vue
View file @
4975356
<
template
>
<div
class=
"layout"
>
<!--
<live-box></live-box>
-->
<div
class=
"to-top"
v-show=
"scrollY > 300"
...
...
@@ -254,10 +253,10 @@
<
script
type=
"text/ecmascript-6"
>
import
{
shopmallApi
,
wxConfig
,
mapApi
,
bigdatautilApi
}
from
'@/api'
import
{
MoveGroup
,
CountDown
,
KfModal
,
Action
,
LiveBox
}
from
'./components/index'
import
{
MoveGroup
,
CountDown
,
KfModal
,
Action
}
from
'./components/index'
import
{
Audio
}
from
'@/utils/audio'
export
default
{
components
:
{
MoveGroup
,
CountDown
,
KfModal
,
Action
,
LiveBox
},
components
:
{
MoveGroup
,
CountDown
,
KfModal
,
Action
},
name
:
'index'
,
data
()
{
return
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment