Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-component
提交
fbd87416
U
uni-component
项目概览
DCloud
/
uni-component
通知
261
Star
6
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-component
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fbd87416
编写于
11月 21, 2024
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
同步代码@HBuilderX4.29
上级
642eff89
变更
18
展开全部
隐藏空白更改
内联
并排
Showing
18 changed file
with
4182 addition
and
3866 deletion
+4182
-3866
uni_modules/uni-video/utssdk/app-android/index.vue
uni_modules/uni-video/utssdk/app-android/index.vue
+138
-69
uni_modules/uni-video/utssdk/app-android/libs/videoplayer.aar
...modules/uni-video/utssdk/app-android/libs/videoplayer.aar
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/Info.plist
...ssdk/app-ios/frameworks/DCUniVideo.xcframework/Info.plist
+5
-5
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/DCUniVideo
...deo.xcframework/ios-arm64/DCUniVideo.framework/DCUniVideo
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Info.plist
...deo.xcframework/ios-arm64/DCUniVideo.framework/Info.plist
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
...Video.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/arm64-apple-ios.abi.json
...k/Modules/DCUniVideo.swiftmodule/arm64-apple-ios.abi.json
+1294
-1252
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/DCUniVideo
...os-arm64_x86_64-simulator/DCUniVideo.framework/DCUniVideo
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Info.plist
...os-arm64_x86_64-simulator/DCUniVideo.framework/Info.plist
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo
...tmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo
...module/Project/x86_64-apple-ios-simulator.swiftsourceinfo
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.abi.json
...DCUniVideo.swiftmodule/arm64-apple-ios-simulator.abi.json
+1294
-1252
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.abi.json
...CUniVideo.swiftmodule/x86_64-apple-ios-simulator.abi.json
+1294
-1252
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeDirectory
...mulator/DCUniVideo.framework/_CodeSignature/CodeDirectory
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeRequirements-1
...or/DCUniVideo.framework/_CodeSignature/CodeRequirements-1
+0
-0
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeResources
...mulator/DCUniVideo.framework/_CodeSignature/CodeResources
+19
-19
uni_modules/uni-video/utssdk/app-ios/index.vue
uni_modules/uni-video/utssdk/app-ios/index.vue
+6
-2
uni_modules/uni-video/utssdk/interface.uts
uni_modules/uni-video/utssdk/interface.uts
+132
-15
未找到文件。
uni_modules/uni-video/utssdk/app-android/index.vue
浏览文件 @
fbd87416
...
...
@@ -18,13 +18,17 @@
import
FrameLayout
from
'
android.widget.FrameLayout
'
;
import
ViewGroup
from
'
android.view.ViewGroup
'
;
import
OnHierarchyChangeListener
from
'
android.view.ViewGroup.OnHierarchyChangeListener
'
;
import
View
from
'
android.view.View
'
;
import
WindowManager
from
'
android.view.WindowManager
'
;
import
TextUtils
from
'
android.text.TextUtils
'
;
import
JSONObject
from
'
org.json.JSONObject
'
;
import
MediaPlayer
from
"
android.media.MediaPlayer
"
;
import
Bitmap
from
'
android.graphics.Bitmap
'
;
import
Handler
from
'
android.os.Handler
'
;
import
Looper
from
'
android.os.Looper
'
;
import
DisplayMetrics
from
'
android.util.DisplayMetrics
'
;
import
Context
from
'
android.content.Context
'
;
import
Glide
from
'
com.bumptech.glide.Glide
'
;
...
...
@@ -37,11 +41,18 @@
name
:
"
video
"
,
data
()
{
return
{
rootView
:
null
as
FrameLayout
|
null
,
playerView
:
null
as
IjkPlayerView
|
null
,
currentPos
:
0
,
currentFrame
:
null
as
Bitmap
|
null
,
handler
:
new
Handler
(
Looper
.
getMainLooper
())
handler
:
new
Handler
(
Looper
.
getMainLooper
()),
isEnded
:
false
,
isFirstLayoutFinished
:
false
,
isFullScreenChanged
:
false
,
screenWidth
:
0
,
screenHeight
:
0
,
layoutWidth
:
0
,
layoutHeight
:
0
,
videoBox
:
null
as
FrameLayout
|
null
};
},
emits
:
[
"
play
"
,
"
pause
"
,
"
ended
"
,
"
timeupdate
"
,
"
fullscreenchange
"
,
"
waiting
"
,
"
error
"
,
"
progress
"
,
"
fullscreenclick
"
,
"
controlstoggle
"
],
...
...
@@ -92,7 +103,7 @@
},
"
direction
"
:
{
// 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针90度)
type
:
Number
,
default
:
-
90
default
:
-
1
},
"
showProgress
"
:
{
// 是否展示进度条,若不设置,宽度大于240时才会显示
type
:
Boolean
,
...
...
@@ -170,7 +181,7 @@
if
(
newValue
!=
oldValue
)
{
// 切换资源
this
.
playerView
?.
setCenterPlayBntVisibility
(
this
.
showCenterPlayBtn
);
this
.
playerView
?.
switchVideoPath
(
path
);
this
.
reload
();
this
.
reload
(
true
);
}
else
{
// 初始化资源
this
.
playerView
?.
setVideoPath
(
path
);
}
...
...
@@ -204,13 +215,13 @@
},
"
initialTime
"
:
{
handler
(
value
:
number
)
{
if
(
value
>
0
)
this
.
playerView
?.
seekTo
(
value
as
Int
*
1000
);
if
(
value
>
0
)
this
.
playerView
?.
seekTo
(
value
.
toInt
()
*
1000
);
},
immediate
:
false
},
"
duration
"
:
{
handler
(
value
:
number
)
{
if
(
value
>
0
)
this
.
playerView
?.
setDuration
(
value
as
Int
*
1000
);
if
(
value
>
0
)
this
.
playerView
?.
setDuration
(
value
.
toInt
()
*
1000
);
},
immediate
:
false
},
...
...
@@ -246,7 +257,7 @@
},
"
direction
"
:
{
handler
(
value
:
number
)
{
this
.
playerView
?.
setDirection
(
value
as
Int
);
this
.
playerView
?.
setDirection
(
value
.
toInt
()
);
},
immediate
:
false
},
...
...
@@ -373,26 +384,50 @@
if
(
newHeader
!=
oldHeader
)
{
// 切换header
this
.
playerView
?.
setCenterPlayBntVisibility
(
this
.
showCenterPlayBtn
);
this
.
playerView
?.
switchVideoPath
(
this
.
getSrcPath
(
this
.
src
));
// 需要重新加载
this
.
reload
();
this
.
reload
(
true
);
}
},
immediate
:
false
}
},
NVLoad
()
:
FrameLayout
{
this
.
rootView
=
new
FrameLayout
(
this
.
$androidContext
!
);
this
.
playerView
=
new
IjkPlayerView
(
this
.
$androidContext
);
this
.
rootView
?.
addView
(
this
.
playerView
,
new
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
));
return
this
.
rootView
!
;
NVLoad
()
:
IjkPlayerView
{
return
new
IjkPlayerView
(
this
.
$androidContext
!
);
},
NVLoaded
()
{
this
.
playerView
=
this
.
$el
;
this
.
playerView
?.
init
();
this
.
playerView
?.
setPlayerRootView
(
this
.
$el
);
this
.
playerView
?.
setOnPlayerChangedListener
(
new
OnPlayerChangedListenerImpl
(
this
));
this
.
playerView
?.
setOnInfoListener
(
new
OnInfoListenerImpl
(
this
,
this
.
playerView
!
));
this
.
playerView
?.
setOnInfoListener
(
new
OnInfoListenerImpl
(
this
));
this
.
playerView
?.
setOnBufferingUpdateListener
(
new
OnBufferingUpdateListenerImpl
(
this
));
this
.
playerView
?.
setOnErrorListener
(
new
OnErrorListenerImpl
(
this
));
this
.
playerView
?.
setOnTextureRenderViewListener
(
new
OnTextureRenderViewListenerImpl
(
this
,
this
.
playerView
!
));
this
.
playerView
?.
setOnTextureRenderViewListener
(
new
OnTextureRenderViewListenerImpl
(
this
));
this
.
playerView
?.
setOnHierarchyChangeListener
(
new
OnHierarchyChangeListenerImpl
(
this
));
},
NVLayouted
()
{
if
(
!
this
.
isFirstLayoutFinished
)
{
this
.
isFirstLayoutFinished
=
true
;
this
.
playerView
?.
setPlayerRootView
(
this
.
$el
!
.
getParent
()
as
ViewGroup
);
this
.
layoutWidth
=
this
.
getLayoutWidth
();
this
.
layoutHeight
=
this
.
getLayoutHeight
();
const
metrics
=
new
DisplayMetrics
();
(
this
.
$androidContext
!
.
getSystemService
(
Context
.
WINDOW_SERVICE
)
as
WindowManager
).
getDefaultDisplay
().
getRealMetrics
(
metrics
);
this
.
screenWidth
=
metrics
.
widthPixels
;
this
.
screenHeight
=
metrics
.
heightPixels
;
// 调整子组件视图层级
this
.
videoBox
=
this
.
playerView
?.
findViewWithTag
<
FrameLayout
>
(
"
fl_video_box
"
);
(
this
.
playerView
as
IjkPlayerView
).
removeView
(
this
.
videoBox
);
(
this
.
playerView
as
IjkPlayerView
).
addView
(
this
.
videoBox
,
0
);
}
if
(
isFullScreenChanged
)
{
isFullScreenChanged
=
false
;
if
(
this
.
playerView
!
.
isFullscreen
())
{
if
(
this
.
getLayoutWidth
()
!=
this
.
screenHeight
)
this
.
setStyleWidth
(
this
.
screenHeight
.
toFloat
());
if
(
this
.
getLayoutHeight
()
!=
this
.
screenWidth
)
this
.
setStyleHeight
(
this
.
screenWidth
.
toFloat
());
}
else
{
if
(
this
.
getLayoutWidth
()
!=
this
.
layoutWidth
)
this
.
setStyleWidth
(
this
.
layoutWidth
.
toFloat
());
if
(
this
.
getLayoutHeight
()
!=
this
.
layoutHeight
)
this
.
setStyleHeight
(
this
.
layoutHeight
.
toFloat
());
}
}
},
NVUnloaded
()
{
// 资源回收
if
(
this
.
$el
!=
null
)
{
// 如果组件绑定了视图则需要在组件销毁时释放视图相关资源
...
...
@@ -401,18 +436,18 @@
}
},
NVRecycler
()
{
this
.
playerView
=
this
.
$el
?.
getChildAt
(
0
)
as
IjkPlayerView
;
this
.
playerView
=
this
.
$el
;
this
.
playerView
?.
reset
();
this
.
resetListener
();
if
(
this
.
currentPos
>
0
)
{
this
.
runDelayed
(()
=>
{
this
.
playerView
?.
hidePoster
();
this
.
playerView
?.
showLastFrame
(
this
.
currentFrame
);
this
.
playerView
?.
seekTo
(
this
.
currentPos
as
Int
);
this
.
playerView
?.
seekTo
(
this
.
currentPos
.
toInt
()
);
},
100
);
}
},
expose
:
[
'
play
'
,
'
pause
'
,
'
seek
'
,
'
requestFullScreen
'
,
'
exitFullScreen
'
,
'
stop
'
,
'
hide
'
,
'
show
'
,
'
close
'
,
'
sendDanmu
'
,
'
playbackRate
'
,
'
currentPos
'
,
'
currentFrame
'
],
expose
:
[
'
play
'
,
'
pause
'
,
'
seek
'
,
'
requestFullScreen
'
,
'
exitFullScreen
'
,
'
stop
'
,
'
hide
'
,
'
show
'
,
'
close
'
,
'
sendDanmu
'
,
'
playbackRate
'
,
'
currentPos
'
,
'
currentFrame
'
,
'
isEnded
'
,
'
isFirstLayoutFinished
'
,
'
isFullScreenChanged
'
,
'
videoBox
'
],
methods
:
{
/**
* 播放视频
...
...
@@ -435,7 +470,7 @@
* @param pos 跳转到的位置,单位:秒(s)
*/
seek
:
function
(
pos
:
number
)
{
this
.
playerView
?.
seekTo
(
(
pos
as
Int
)
*
1000
);
this
.
playerView
?.
seekTo
(
pos
.
toInt
(
)
*
1000
);
},
/**
* 切换到全屏
...
...
@@ -443,11 +478,11 @@
*/
requestFullScreen
:
function
(
options
:
RequestFullScreenOptions
|
null
)
{
this
.
runOnMain
(
function
()
{
let
direction
=
-
90
;
let
direction
=
-
1
;
if
(
options
!=
null
)
{
direction
=
options
.
direction
as
Int
;
direction
=
options
.
direction
??
-
1
;
}
this
.
playerView
?.
fullScreen
(
direction
as
Int
);
this
.
playerView
?.
fullScreen
(
direction
.
toInt
()
);
});
},
/**
...
...
@@ -463,7 +498,9 @@
*/
stop
:
function
()
{
this
.
runOnMain
(()
=>
{
this
.
playerView
?.
stop
();
this
.
playerView
?.
reset
();
this
.
playerView
?.
setCenterPlayBntVisibility
(
this
.
showCenterPlayBtn
);
this
.
reload
(
false
);
this
.
currentPos
=
0
;
this
.
currentFrame
=
null
;
});
...
...
@@ -500,6 +537,10 @@
*/
sendDanmu
:
function
(
danmu
:
Danmu
)
{
this
.
runOnMain
(
function
()
{
if
(
!
this
.
enableDanmu
)
{
console
.
error
(
'
sendDanmu is disabled, set enable-danmu true first!
'
);
return
;
}
const
data
=
new
JSONObject
();
data
.
put
(
'
text
'
,
danmu
.
text
);
data
.
put
(
'
color
'
,
danmu
.
color
);
...
...
@@ -515,16 +556,17 @@
},
/**
* 内部函数
* 切换src、header后重新加载
* 重新加载
* @param autoplay autoplay属性是否生效 切换src、header生效 stop不生效
*/
reload
:
function
()
{
reload
:
function
(
autoplay
:
boolean
)
{
this
.
runOnMain
(
function
()
{
this
.
playerView
?.
setDuration
(
this
.
duration
as
Int
*
1000
);
this
.
playerView
?.
seekTo
(
this
.
initialTime
as
Int
*
1000
);
this
.
playerView
?.
setDuration
(
this
.
duration
.
toInt
()
*
1000
);
this
.
playerView
?.
seekTo
(
this
.
initialTime
.
toInt
()
*
1000
);
this
.
playerView
?.
setMutePlayer
(
this
.
playerView
?.
isMutePlayer
()
==
true
);
this
.
playerView
?.
clearDanma
();
this
.
playerView
?.
enableDanmaku
(
this
.
enableDanmu
)
if
(
this
.
autoplay
)
this
.
playerView
?.
start
();
this
.
playerView
?.
enableDanmaku
(
this
.
enableDanmu
)
;
if
(
autoplay
&&
this
.
autoplay
)
this
.
playerView
?.
start
();
});
},
/**
...
...
@@ -556,12 +598,12 @@
* 内部函数
* 重置监听,复用时调用
*/
resetListener
()
{
resetListener
:
function
()
{
this
.
playerView
?.
setOnPlayerChangedListener
(
new
OnPlayerChangedListenerImpl
(
this
));
this
.
playerView
?.
setOnInfoListener
(
new
OnInfoListenerImpl
(
this
,
this
.
playerView
!
));
this
.
playerView
?.
setOnInfoListener
(
new
OnInfoListenerImpl
(
this
));
this
.
playerView
?.
setOnBufferingUpdateListener
(
new
OnBufferingUpdateListenerImpl
(
this
));
this
.
playerView
?.
setOnErrorListener
(
new
OnErrorListenerImpl
(
this
));
this
.
playerView
?.
setOnTextureRenderViewListener
(
new
OnTextureRenderViewListenerImpl
(
this
,
this
.
playerView
!
));
this
.
playerView
?.
setOnTextureRenderViewListener
(
new
OnTextureRenderViewListenerImpl
(
this
));
}
}
}
...
...
@@ -581,11 +623,13 @@
class
OnPlayerChangedListenerImpl
implements
OnPlayerChangedListener
{
private
comp
:
UTSContainer
<
FrameLayout
>
;
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
private
playerView
:
IjkPlayerView
;
constructor
(
comp
:
UTSContainer
<
FrameLayout
>
)
{
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
this
.
playerView
=
comp
.
$el
!
;
}
override
onChanged
(
type
:
String
,
msg
:
String
)
:
void
{
...
...
@@ -594,7 +638,16 @@
this
.
comp
.
$emit
(
"
timeupdate
"
,
new
UniVideoTimeUpdateEventImpl
(
JSON
.
parse
<
UniVideoTimeUpdateEventDetail
>
(
msg
)
!
));
break
;
case
"
fullscreenchange
"
:
this
.
comp
.
$emit
(
"
fullscreenchange
"
,
new
UniVideoFullScreenChangeEventImpl
(
JSON
.
parse
<
UniVideoFullScreenChangeEventDetail
>
(
msg
)
!
));
(
this
.
comp
as
VideoComponent
).
isFullScreenChanged
=
true
;
const
detail
=
JSON
.
parse
<
UniVideoFullScreenChangeEventDetail
>
(
msg
)
!
;
if
(
detail
.
fullScreen
)
{
// 进入全屏时取消监听,避免触发暂停逻辑
this
.
playerView
.
setOnTextureRenderViewListener
(
null
);
}
else
{
// 退出全屏时重新监听
setTimeout
(()
=>
{
this
.
playerView
.
setOnTextureRenderViewListener
(
new
OnTextureRenderViewListenerImpl
(
this
.
comp
));
},
100
);
}
this
.
comp
.
$emit
(
"
fullscreenchange
"
,
new
UniVideoFullScreenChangeEventImpl
(
detail
));
break
;
case
"
fullscreenclick
"
:
this
.
comp
.
$emit
(
"
fullscreenclick
"
,
new
UniVideoFullScreenClickEventImpl
(
JSON
.
parse
<
UniVideoFullScreenClickEventDetail
>
(
msg
)
!
));
...
...
@@ -606,51 +659,41 @@
this
.
comp
.
$emit
(
"
error
"
,
new
UniVideoErrorEventImpl
(
new
VideoErrorImpl
(
100001
)));
break
;
}
// if (type == "fullscreenchange") {
// if (playerView?.isFullscreen() == true) {
// let container = rootView?.getChildAt(1);
// if (container == null) return;
// setTimeout(() => {
// rootView?.removeView(container);
// playerView?.addView(container);
// container?.bringToFront();
// }, 100);
// } else {
// let container = playerView?.getChildAt(1);
// if (container == null) return;
// setTimeout(() => {
// playerView?.removeView(container);
// rootView?.addView(container);
// container?.bringToFront();
// }, 100);
// }
// }
}
}
class
OnInfoListenerImpl
implements
OnInfoListener
{
private
comp
:
UTSContainer
<
FrameLayout
>
;
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
private
playerView
:
IjkPlayerView
;
constructor
(
comp
:
UTSContainer
<
FrameLayout
>
,
playerView
:
IjkPlayerView
)
{
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
this
.
playerView
=
playerView
;
this
.
playerView
=
comp
.
$el
!
;
}
override
onInfo
(
iMediaPlayer
:
IMediaPlayer
|
null
,
status
:
Int
,
extra
:
Int
)
:
boolean
{
switch
(
status
)
{
case
MediaPlayerParams
.
STATE_COMPLETED
:
this
.
comp
.
$emit
(
"
ended
"
,
new
UniEvent
(
"
ended
"
));
(
this
.
comp
as
VideoComponent
).
isEnded
=
true
;
if
((
this
.
comp
as
VideoComponent
).
loop
)
{
let
initialTime
=
(
this
.
comp
as
VideoComponent
).
initialTime
as
Int
;
if
(
initialTime
>
0
)
this
.
playerView
.
seekTo
(
initialTime
*
1000
);
let
initialTime
=
(
this
.
comp
as
VideoComponent
).
initialTime
;
if
(
initialTime
>
0
)
this
.
playerView
.
seekTo
(
initialTime
.
toInt
()
*
1000
);
this
.
playerView
.
start
();
(
this
.
comp
as
VideoComponent
).
isEnded
=
false
;
}
break
;
case
MediaPlayerParams
.
STATE_PLAYING
:
this
.
comp
.
$emit
(
"
play
"
,
new
UniEvent
(
"
play
"
));
setTimeout
(()
=>
{
if
((
this
.
comp
as
VideoComponent
).
isEnded
)
{
let
initialTime
=
(
this
.
comp
as
VideoComponent
).
initialTime
;
if
(
initialTime
>
0
)
this
.
playerView
.
seekTo
(
initialTime
.
toInt
()
*
1000
);
(
this
.
comp
as
VideoComponent
).
isEnded
=
false
;
}
},
100
);
break
;
case
MediaPlayerParams
.
STATE_PAUSED
:
this
.
comp
.
$emit
(
"
pause
"
,
new
UniEvent
(
"
pause
"
));
...
...
@@ -669,14 +712,14 @@
class
OnBufferingUpdateListenerImpl
implements
OnBufferingUpdateListener
{
private
comp
:
UTSContainer
<
FrameLayout
>
;
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
constructor
(
comp
:
UTSContainer
<
FrameLayout
>
)
{
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
}
override
onBufferingUpdate
(
iMediaPlayer
:
IMediaPlayer
,
i
:
Int
)
:
void
{
override
onBufferingUpdate
(
iMediaPlayer
:
IMediaPlayer
|
null
,
i
:
Int
)
:
void
{
const
detail
:
UniVideoProgressEventDetail
=
{
buffered
:
i
};
...
...
@@ -686,14 +729,14 @@
class
OnErrorListenerImpl
implements
OnErrorListener
{
private
comp
:
UTSContainer
<
FrameLayout
>
;
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
constructor
(
comp
:
UTSContainer
<
FrameLayout
>
)
{
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
}
override
onError
(
iMediaPlayer
:
IMediaPlayer
,
what
:
Int
,
extra
:
Int
)
:
Boolean
{
override
onError
(
iMediaPlayer
:
IMediaPlayer
|
null
,
what
:
Int
,
extra
:
Int
)
:
Boolean
{
if
(
what
==
MediaPlayer
.
MEDIA_ERROR_UNKNOWN
)
{
this
.
comp
.
$emit
(
"
error
"
,
new
UniVideoErrorEventImpl
(
new
VideoErrorImpl
(
200001
)));
}
else
{
...
...
@@ -705,13 +748,13 @@
class
OnTextureRenderViewListenerImpl
implements
OnTextureRenderViewListener
{
private
comp
:
UTSContainer
<
FrameLayout
>
;
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
private
playerView
:
IjkPlayerView
;
constructor
(
comp
:
UTSContainer
<
FrameLayout
>
,
playerView
:
IjkPlayerView
)
{
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
this
.
playerView
=
playerView
;
this
.
playerView
=
comp
.
$el
!
;
}
override
onDetachedFromWindow
()
:
void
{
...
...
@@ -724,4 +767,30 @@
}
}
}
class
OnHierarchyChangeListenerImpl
implements
OnHierarchyChangeListener
{
private
comp
:
UTSContainer
<
IjkPlayerView
>
;
private
playerView
:
IjkPlayerView
;
constructor
(
comp
:
UTSContainer
<
IjkPlayerView
>
)
{
super
();
this
.
comp
=
comp
;
this
.
playerView
=
comp
.
$el
!
;
}
override
onChildViewAdded
(
parent
:
View
,
child
:
View
)
:
void
{
// 处理子组件动态添加的情况
if
((
this
.
comp
as
VideoComponent
).
isFirstLayoutFinished
)
{
if
(
this
.
playerView
.
indexOfChild
((
this
.
comp
as
VideoComponent
).
videoBox
)
!=
0
)
{
this
.
playerView
.
removeView
((
this
.
comp
as
VideoComponent
).
videoBox
);
this
.
playerView
.
addView
((
this
.
comp
as
VideoComponent
).
videoBox
,
0
);
}
}
}
override
onChildViewRemoved
(
parent
:
View
,
child
:
View
)
:
void
{
}
}
</
script
>
\ No newline at end of file
uni_modules/uni-video/utssdk/app-android/libs/videoplayer.aar
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/Info.plist
浏览文件 @
fbd87416
...
...
@@ -8,32 +8,32 @@
<key>
BinaryPath
</key>
<string>
DCUniVideo.framework/DCUniVideo
</string>
<key>
LibraryIdentifier
</key>
<string>
ios-arm64
_x86_64-simulator
</string>
<string>
ios-arm64
</string>
<key>
LibraryPath
</key>
<string>
DCUniVideo.framework
</string>
<key>
SupportedArchitectures
</key>
<array>
<string>
arm64
</string>
<string>
x86_64
</string>
</array>
<key>
SupportedPlatform
</key>
<string>
ios
</string>
<key>
SupportedPlatformVariant
</key>
<string>
simulator
</string>
</dict>
<dict>
<key>
BinaryPath
</key>
<string>
DCUniVideo.framework/DCUniVideo
</string>
<key>
LibraryIdentifier
</key>
<string>
ios-arm64
</string>
<string>
ios-arm64
_x86_64-simulator
</string>
<key>
LibraryPath
</key>
<string>
DCUniVideo.framework
</string>
<key>
SupportedArchitectures
</key>
<array>
<string>
arm64
</string>
<string>
x86_64
</string>
</array>
<key>
SupportedPlatform
</key>
<string>
ios
</string>
<key>
SupportedPlatformVariant
</key>
<string>
simulator
</string>
</dict>
</array>
<key>
CFBundlePackageType
</key>
...
...
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/DCUniVideo
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Info.plist
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/arm64-apple-ios.abi.json
浏览文件 @
fbd87416
此差异已折叠。
点击以展开。
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/DCUniVideo
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Info.plist
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.abi.json
浏览文件 @
fbd87416
此差异已折叠。
点击以展开。
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.abi.json
浏览文件 @
fbd87416
此差异已折叠。
点击以展开。
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeDirectory
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeRequirements-1
浏览文件 @
fbd87416
无法预览此类型文件
uni_modules/uni-video/utssdk/app-ios/frameworks/DCUniVideo.xcframework/ios-arm64_x86_64-simulator/DCUniVideo.framework/_CodeSignature/CodeResources
浏览文件 @
fbd87416
...
...
@@ -18,19 +18,19 @@
</data>
<key>
Info.plist
</key>
<data>
+NZDAJrn2ZKj6NUU94Wm3aicXP
8=
ZJfU/z0myJ2FJ6v4FI5s1po6+1
8=
</data>
<key>
Modules/DCUniVideo.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo
</key>
<data>
wH96k18jg3jOJ0CBUeQ99PdzLsQ
=
LMw61NwrRpA08JKfgcEYaj3bC4s
=
</data>
<key>
Modules/DCUniVideo.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo
</key>
<data>
DzfHQeHEbBPxv0gDE2CptwGEoe
g=
7RwLqhAfiKvxA+Cxv6/N962PpO
g=
</data>
<key>
Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.abi.json
</key>
<data>
TNIhofEShaWVL6VsYJTOMJenPUU
=
nk9o0CXiQ/GZWFtpqNFQSf56Aq4
=
</data>
<key>
Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface
</key>
<data>
...
...
@@ -46,11 +46,11 @@
</data>
<key>
Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.swiftmodule
</key>
<data>
FUnGIQdpZixh23mBO5tB9H0ZyRw
=
gR2m/jlpxNCVmIfuV+qVvd6FVoE
=
</data>
<key>
Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.abi.json
</key>
<data>
TNIhofEShaWVL6VsYJTOMJenPUU
=
nk9o0CXiQ/GZWFtpqNFQSf56Aq4
=
</data>
<key>
Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface
</key>
<data>
...
...
@@ -66,7 +66,7 @@
</data>
<key>
Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
</key>
<data>
oZEtO6qUyXEyXPWs5r2TQKKIShA
=
p+SyNnDNf1lc0DyiX5aiSin5puk
=
</data>
<key>
Modules/module.modulemap
</key>
<data>
...
...
@@ -112,33 +112,33 @@
<dict>
<key>
hash
</key>
<data>
wH96k18jg3jOJ0CBUeQ99PdzLsQ
=
LMw61NwrRpA08JKfgcEYaj3bC4s
=
</data>
<key>
hash2
</key>
<data>
8dg9SbAWnvNRYhf3kEcUsbREi/NrSBbMu2OBPwUg/tQ
=
rQ6ecTyNYorIWSPYIIIvMKXzPCj9nGj+LNKMEIJBP5U
=
</data>
</dict>
<key>
Modules/DCUniVideo.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo
</key>
<dict>
<key>
hash
</key>
<data>
DzfHQeHEbBPxv0gDE2CptwGEoe
g=
7RwLqhAfiKvxA+Cxv6/N962PpO
g=
</data>
<key>
hash2
</key>
<data>
ImNUy2ptIezqnDnrk56PkC/F65nxtYaJKEJbqZ94d4I
=
Un6dHCBddlRbwPe/xkfXUJUkqJfmlwC9uhfZwcpAHos
=
</data>
</dict>
<key>
Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.abi.json
</key>
<dict>
<key>
hash
</key>
<data>
TNIhofEShaWVL6VsYJTOMJenPUU
=
nk9o0CXiQ/GZWFtpqNFQSf56Aq4
=
</data>
<key>
hash2
</key>
<data>
DLgYsDlGfr5R2G8eyNRl4j+o77Jmm7yke6AQ+F5MNkU
=
G6BCmgVzUh+8PT4Vb2Mo2M57OK54006L7d81dNPspfY
=
</data>
</dict>
<key>
Modules/DCUniVideo.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface
</key>
...
...
@@ -178,22 +178,22 @@
<dict>
<key>
hash
</key>
<data>
FUnGIQdpZixh23mBO5tB9H0ZyRw
=
gR2m/jlpxNCVmIfuV+qVvd6FVoE
=
</data>
<key>
hash2
</key>
<data>
953P4i0Cpy8DSltzstY7CnqXzPlOK40BCzRlluW5IOM
=
kSBWEAVrVxWfOnEsU4ryWR+gx8eY6RmX8ppIpJlBx9A
=
</data>
</dict>
<key>
Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.abi.json
</key>
<dict>
<key>
hash
</key>
<data>
TNIhofEShaWVL6VsYJTOMJenPUU
=
nk9o0CXiQ/GZWFtpqNFQSf56Aq4
=
</data>
<key>
hash2
</key>
<data>
DLgYsDlGfr5R2G8eyNRl4j+o77Jmm7yke6AQ+F5MNkU
=
G6BCmgVzUh+8PT4Vb2Mo2M57OK54006L7d81dNPspfY
=
</data>
</dict>
<key>
Modules/DCUniVideo.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface
</key>
...
...
@@ -233,11 +233,11 @@
<dict>
<key>
hash
</key>
<data>
oZEtO6qUyXEyXPWs5r2TQKKIShA
=
p+SyNnDNf1lc0DyiX5aiSin5puk
=
</data>
<key>
hash2
</key>
<data>
+5DOS3AmpPwonbQHeJ6DFG8qUMfSc+IPkfTF3zn40ys
=
AYg5nbZM23N1eAD0JL/9x+MWHN0Lplo1fiDhPwHVPtc
=
</data>
</dict>
<key>
Modules/module.modulemap
</key>
...
...
uni_modules/uni-video/utssdk/app-ios/index.vue
浏览文件 @
fbd87416
...
...
@@ -444,7 +444,7 @@
this
.
present
?.
palybackRate
(
rate
);
},
updateProp
:
function
(
key
:
string
,
value
:
any
)
{
updateProp
:
function
(
key
:
string
,
value
:
any
|
null
)
{
DispatchQueue
.
main
.
async
(
execute
=
():
void
=>
{
this
.
present
?.
setControlValue
(
value
,
key
)
})
...
...
@@ -492,7 +492,11 @@
}
loadImage
(
url
:
string
,
complete
:
(
image
:
UIImage
)
=>
void
)
{
UTSiOS
.
loadImage
(
url
,
complete
);
UTSiOS
.
loadImage
(
url
,(
image
,
data
)
=>
{
if
(
image
!=
null
){
complete
(
image
!
);
}
});
}
lockScreen
()
{
...
...
uni_modules/uni-video/utssdk/interface.uts
浏览文件 @
fbd87416
...
...
@@ -58,7 +58,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -81,7 +86,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -105,7 +115,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -128,7 +143,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -152,7 +172,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -176,7 +201,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -200,7 +230,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -224,7 +259,12 @@ export interface VideoContext {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
...
...
@@ -239,7 +279,6 @@ export interface VideoContext {
export interface Uni {
/**
* 创建并返回 video 上下文 videoContext 对象
* @description 创建并返回 video 上下文 videoContext 对象
* @uniPlatform {
* "app": {
* "android": {
...
...
@@ -251,17 +290,66 @@ export interface Uni {
* "osVer": "12.0",
* "uniVer": "√",
* "unixVer": "4.11"
* }
* },
* "harmony": {
* "osVer": "3.0",
* "uniVer": "4.23",
* "unixVer": "x"
* }
* },
* "web": {
* "uniVer": "√",
* "unixVer": "4.0"
* }
* },
* "mp": {
* "weixin": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "alipay": {
* "hostVer": "1.10.0",
* "uniVer": "√",
* "unixVer": "x"
* },
* "baidu": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "toutiao": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "lark": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "qq": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "kuaishou": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* },
* "jd": {
* "hostVer": "√",
* "uniVer": "√",
* "unixVer": "x"
* }
* }
* }
* @uniVueVersion 2,3
* @return {VideoContext} video组件上下文对象
*
* @tutorial http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext
* @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video-context.html#createvideocontext
* @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/create-video-context.html#createvideocontext
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/create-video-context.html#createvideocontext
*
*/
createVideoContext : CreateVideoContext
...
...
@@ -269,12 +357,41 @@ export interface Uni {
/**
* 通用事件
* 临时方案,规避组件Event接口无法直接继承UniEvent的问题
*/
interface UniVideoEvent {
/**
* 是否冒泡
*/
bubbles : boolean
/**
* 是否可以取消
*/
cancelable : boolean
/**
* 事件类型
*/
type : string
target : Element | null
currentTarget : Element | null
/**
* 触发事件的组件
*/
target ?: UniElement | null
/**
* 当前组件
*/
currentTarget ?: UniElement | null
/**
* 事件发生时的时间戳
*/
timeStamp : Long
/**
* 阻止当前事件的进一步传播
*/
stopPropagation() : void
/**
* 阻止当前事件的默认行为
*/
preventDefault() : void
}
/**
...
...
@@ -402,4 +519,4 @@ export type VideoProgressEventDetail = UniVideoProgressEventDetail
export type VideoFullScreenClickEvent = UniVideoFullScreenClickEvent
export type VideoFullScreenClickEventDetail = UniVideoFullScreenClickEventDetail
export type VideoControlsToggleEvent = UniVideoControlsToggleEvent
export type VideoControlsToggleEventDetail = UniVideoControlsToggleEventDetail
\ No newline at end of file
export type VideoControlsToggleEventDetail = UniVideoControlsToggleEventDetail
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录