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:
Harvey Zack committed 2025-09-11 09:59:29 +08:00
1 parent 714c81e6c3
commit 12d6781bf5
5 files changed
+11 -3

No files matched your search

+3
View File
@@ -220,6 +220,9 @@ export default class Control extends Component {
}
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]
+1 -1
View File
@@ -244,7 +244,7 @@ Artplayer.SEEK_STEP = 5
Artplayer.PLAYBACK_RATE = [0.5, 0.75, 1, 1.25, 1.5, 2]
Artplayer.ASPECT_RATIO = ['default', '4:3', '16:9']
Artplayer.FLIP = ['normal', '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
+3
View File
@@ -95,6 +95,9 @@ export default class Setting extends Component {
}
check(target) {
if (!target) {
return
}
target.$parent.tooltip = target.html
this.traverse((item) => {
item.default = item === target