mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 01:56:16 -08:00
fix: add null check for target in Control and Setting classes
- Added a null check for the target parameter in the check method of the Control class to prevent potential errors when target is undefined. - Implemented a similar null check in the check method of the Setting class for consistency and error handling. - Updated FULLSCREEN_WEB_IN_BODY property in Artplayer to true for enabling fullscreen mode in web environments.
This commit is contained in:
1 parent
714c81e6c3
commit
12d6781bf5
5 files changed
+11
-3
No files matched your search
@@ -414,7 +414,7 @@ Artplayer.FLIP = [
|
||||
'horizontal',
|
||||
'vertical'
|
||||
];
|
||||
Artplayer.FULLSCREEN_WEB_IN_BODY = false;
|
||||
Artplayer.FULLSCREEN_WEB_IN_BODY = true;
|
||||
Artplayer.LOG_VERSION = true;
|
||||
Artplayer.USE_RAF = false;
|
||||
Artplayer.REMOVE_SRC_WHEN_DESTROY = true;
|
||||
@@ -1669,6 +1669,7 @@ class Control extends (0, _componentDefault.default) {
|
||||
super.add(option);
|
||||
}
|
||||
check(target) {
|
||||
if (!target) return;
|
||||
target.$control_value.innerHTML = target.html;
|
||||
for(let index = 0; index < target.$control_option.length; index++){
|
||||
const item = target.$control_option[index];
|
||||
@@ -4667,6 +4668,7 @@ class Setting extends (0, _componentDefault.default) {
|
||||
}
|
||||
}
|
||||
check(target) {
|
||||
if (!target) return;
|
||||
target.$parent.tooltip = target.html;
|
||||
this.traverse((item)=>{
|
||||
item.default = item === target;
|
||||
|
||||
Reference in new issue
Block a user