Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
张桐
/
xdykt-build
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张桐
2017-03-09 10:34:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a18b3e6bbb39eb2b0988e4c565d3d451042c823c
a18b3e6b
1 parent
b7be7d7a
在音视频之间切换多次 ok
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
103 行增加
和
142 行删除
src/videoWithFlash.js
src/videoWithFlash.js
查看文件 @
a18b3e6
...
...
@@ -483,7 +483,6 @@ function _audioUpdate(callbackDate){
achieveStuPlayAudioStream
(
callbackDate
);
$
(
".stuPlay"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
}
...
...
@@ -543,7 +542,7 @@ function achieveStuPushStream() {
//code为0,代表成功
if
(
pubStuResult
.
code
==
0
){
if
(
!
window
.
publishStuflash
)
{
flashvideo
(
'stuPublish'
,
'100%'
,
...
...
@@ -580,16 +579,11 @@ function achieveStuPushStream() {
}
else
{
console
.
error
(
'stuPublish error'
);
}
}
)
}
else
{
publishStuURL
(
pubStuResult
.
publishUrl
);
}
}
else
if
(
pubStuResult
.
code
==
1
){
...
...
@@ -626,7 +620,7 @@ function achieveStuPlayStream(_pubResultObj) {
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
// $(".teacherVideoBg").css("display","block");
if
(
!
window
.
playflashStu
)
{
flashvideo
(
'stuPlay'
,
'100%'
,
...
...
@@ -647,12 +641,6 @@ function achieveStuPlayStream(_pubResultObj) {
}
}
)
}
else
{
playStuURL
(
streamInfo
.
playUrl
);
}
}
function
playStuURL
(
rtmpURL
){
...
...
@@ -678,7 +666,7 @@ function achieveStuVoice() {
//code为0,代表成功
if
(
pubStuAudioResult
.
code
==
0
){
if
(
!
window
.
publishflashStuVoice
)
{
flashvideo
(
'stuPublish'
,
'100%'
,
...
...
@@ -713,16 +701,11 @@ function achieveStuVoice() {
console
.
log
(
"5,flash把学生音频流关闭成功"
);
}
else
{
console
.
error
(
'publish error'
);
}
}
)
}
else
{
publishStuVoiceURL
(
pubStuAudioResult
.
publishUrl
);
}
}
else
if
(
pubStuAudioResult
.
code
==
1
){
...
...
@@ -761,7 +744,7 @@ function achieveStuPlayAudioStream(_pubResultObj){
// $(".teacherVideo").css("background", "#CCCCCC");
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
!
window
.
playflashStuAudio
)
{
flashvideo
(
'stuPlay'
,
'100%'
,
...
...
@@ -779,10 +762,7 @@ function achieveStuPlayAudioStream(_pubResultObj){
console
.
log
(
' [play] native 2 js'
,
msg
);
}
)
}
else
{
stuPlayAudioURL
(
streamInfo
.
playUrl
);
}
}
...
...
@@ -800,6 +780,8 @@ function stuPlayAudioURL(rtmpURL){
}
//获取老师只推音频
function
achieveTeaAudioStream
()
{
$
(
".publish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
...
...
@@ -812,7 +794,7 @@ function achieveTeaAudioStream() {
//code为0,代表成功
if
(
pushTeaAudioResult
.
code
==
0
){
if
(
!
window
.
publishflashAudio
)
{
flashvideo
(
'publish'
,
'100%'
,
...
...
@@ -846,16 +828,11 @@ function achieveTeaAudioStream() {
console
.
log
(
"5,flash把推老师音频流关闭"
);
}
else
{
console
.
error
(
'publish error'
);
}
}
)
}
else
{
publishTeaAudioURL
(
pushTeaAudioResult
.
publishUrl
);
}
}
else
if
(
pushTeaAudioResult
.
code
==
1
){
...
...
@@ -876,11 +853,76 @@ function publishTeaAudioURL(rtmpURL) {
});
console
.
log
(
publishflashAudio
.
_js2native
(
msg
));
}
//获取老师播放音频流地址
function
achievePlayAudioStream
(
_pubResultObj
){
//获取老师推音视频流地址
function
achieveTeaVideoStream
(){
console
.
log
(
"_pubResultObj==========>"
,
_pubResultObj
)
var
_paramInfo
=
{
"type"
:
"rtmp"
,
"channelId"
:
_pubResultObj
.
channelId
,
//频道号
"classId"
:
_pubResultObj
.
classId
,
//课堂号
"siteId"
:
_pubResultObj
.
siteId
,
//站点号
"timestamp"
:
_pubResultObj
.
timestamp
,
//时间戳
"userId"
:
_pubResultObj
.
userId
,
//userId
};
var
streamInfo
=
client
.
getAudioPlayPath
(
_paramInfo
);
console
.
log
(
"result是=============>"
,
streamInfo
);
$
(
".play"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".publish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
// $(".teacherVideo").css("background", "#CCCCCC");
// $(".teacherVideo-voice").css("bottom","4px");
flashvideo
(
'play'
,
'100%'
,
'100%'
,
function
createPlayReady
(
error
,
playflash
)
{
if
(
error
)
{
return
console
.
error
(
error
);
}
window
.
playflashAudio
=
playflash
;
window
.
playflashAudioId
=
teaTimeStamp
();
playAudioURL
(
streamInfo
.
playUrl
);
},
function
(
msg
)
{
console
.
log
(
' [playAudio] native 2 js'
,
msg
);
var
_msg
=
JSON
.
parse
(
msg
);
console
.
log
(
"playAudio_msg===========>"
,
_msg
);
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
2
)){
console
.
log
(
"2,老师播音频流"
);
}
else
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把老师的播音频流关闭"
);
}
}
)
}
function
playAudioURL
(
rtmpURL
){
const
msg
=
JSON
.
stringify
({
type
:
2
,
videoId
:
playflashAudioId
,
data
:
{
url
:
rtmpURL
// url:'rtmp://123.56.205.116:1935/live/alexwang'
}
});
console
.
log
(
playflashAudio
.
_js2native
(
msg
));
}
//获取老师推音视频流地址
function
achieveTeaVideoStream
(){
var
paramInfo
=
{
"type"
:
"flash"
};
...
...
@@ -889,7 +931,6 @@ function achieveTeaVideoStream(){
//code为0,代表成功
if
(
pushTeaResult
.
code
==
0
){
if
(
!
window
.
publishflash
)
{
flashvideo
(
'publish'
,
'100%'
,
...
...
@@ -923,16 +964,10 @@ function achieveTeaVideoStream(){
else
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把老师的推音视频流关闭"
);
}
else
{
console
.
error
(
'publish error'
);
}
}
)
}
else
{
publishURL
(
pushTeaResult
.
publishUrl
);
}
}
else
if
(
pushTeaResult
.
code
==
1
){
...
...
@@ -956,11 +991,8 @@ function publishURL(rtmpURL) {
}
//获取老师播放音频流地址
function
achievePlayAudioStream
(
_pubResultObj
){
//获取老师播音视频流地址
function
achievePlayStream
(
_pubResultObj
){
console
.
log
(
"_pubResultObj==========>"
,
_pubResultObj
)
var
_paramInfo
=
{
"type"
:
"rtmp"
,
...
...
@@ -970,17 +1002,14 @@ function achievePlayAudioStream(_pubResultObj){
"timestamp"
:
_pubResultObj
.
timestamp
,
//时间戳
"userId"
:
_pubResultObj
.
userId
,
//userId
};
var
streamInfo
=
client
.
get
Audi
oPlayPath
(
_paramInfo
);
var
streamInfo
=
client
.
get
Vide
oPlayPath
(
_paramInfo
);
console
.
log
(
"result是=============>"
,
streamInfo
);
$
(
".play"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".publish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
// $(".teacherVideo").css("background", "#CCCCCC");
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
!
window
.
playflashAudio
)
{
flashvideo
(
'play'
,
'100%'
,
...
...
@@ -989,112 +1018,44 @@ function achievePlayAudioStream(_pubResultObj){
if
(
error
)
{
return
console
.
error
(
error
);
}
window
.
playflashAudio
=
playflash
;
window
.
playflashAudioId
=
teaTimeStamp
();
window
.
playflash
=
playflash
;
window
.
playflashVideoId
=
teaTimeStamp
();
play
Audio
URL
(
streamInfo
.
playUrl
);
playURL
(
streamInfo
.
playUrl
);
},
function
(
msg
)
{
console
.
log
(
' [play
Audio
] native 2 js'
,
msg
);
console
.
log
(
' [play] native 2 js'
,
msg
);
var
_msg
=
JSON
.
parse
(
msg
);
console
.
log
(
"play
Audio
_msg===========>"
,
_msg
);
console
.
log
(
"play_msg===========>"
,
_msg
);
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
2
)){
console
.
log
(
"
2,老师播音频流
"
);
console
.
log
(
"
老师播流成功
"
);
}
else
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把老师的播音频流关闭"
);
}
else
{
console
.
error
(
'playAudio error'
);
console
.
log
(
"5,flash把老师的播音视频流关闭"
);
}
}
)
}
else
{
playAudioURL
(
streamInfo
.
playUrl
);
}
}
function
play
AudioURL
(
rtmpURL
)
{
function
play
URL
(
rtmpURL
)
{
const
msg
=
JSON
.
stringify
({
type
:
2
,
videoId
:
playflash
Audi
oId
,
videoId
:
playflash
Vide
oId
,
data
:
{
url
:
rtmpURL
// url:'rtmp://123.56.205.116:1935/live/alexwang'
}
});
console
.
log
(
playflashAudio
.
_js2native
(
msg
));
console
.
log
(
playflash
.
_js2native
(
msg
));
}
//获取老师播音视频流地址
function
achievePlayStream
(
_pubResultObj
){
console
.
log
(
"_pubResultObj==========>"
,
_pubResultObj
)
var
_paramInfo
=
{
"type"
:
"rtmp"
,
"channelId"
:
_pubResultObj
.
channelId
,
//频道号
"classId"
:
_pubResultObj
.
classId
,
//课堂号
"siteId"
:
_pubResultObj
.
siteId
,
//站点号
"timestamp"
:
_pubResultObj
.
timestamp
,
//时间戳
"userId"
:
_pubResultObj
.
userId
,
//userId
};
var
streamInfo
=
client
.
getVideoPlayPath
(
_paramInfo
);
console
.
log
(
"result是=============>"
,
streamInfo
);
$
(
".play"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".publish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
!
window
.
playflash
)
{
flashvideo
(
'play'
,
'100%'
,
'100%'
,
function
createPlayReady
(
error
,
playflash
)
{
if
(
error
)
{
return
console
.
error
(
error
);
}
window
.
playflash
=
playflash
;
window
.
playflashVideoId
=
teaTimeStamp
();
playURL
(
streamInfo
.
playUrl
);
},
function
(
msg
)
{
console
.
log
(
' [play] native 2 js'
,
msg
);
var
_msg
=
JSON
.
parse
(
msg
);
console
.
log
(
"play_msg===========>"
,
_msg
);
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
2
)){
console
.
log
(
"老师播流成功"
);
}
else
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把老师的播音视频流关闭"
);
}
else
{
console
.
error
(
'play error'
);
}
}
)
}
else
{
playURL
(
streamInfo
.
playUrl
);
}
}
function
playURL
(
rtmpURL
)
{
const
msg
=
JSON
.
stringify
({
type
:
2
,
videoId
:
playflashVideoId
,
data
:
{
url
:
rtmpURL
// url:'rtmp://123.56.205.116:1935/live/alexwang'
}
});
console
.
log
(
playflash
.
_js2native
(
msg
));
}
...
...
请
注册
或
登录
后发表评论