Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize code size for WebView & VideoPlayer and fix type issues. #18240

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

dumganhar
Copy link
Contributor

Re: #18222

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@dumganhar dumganhar requested review from minggo and removed request for minggo January 22, 2025 14:35
@dumganhar dumganhar marked this pull request as draft January 22, 2025 14:37
@dumganhar dumganhar requested a review from minggo January 22, 2025 14:50
@dumganhar dumganhar marked this pull request as ready for review January 22, 2025 14:50
Copy link

👍 Package size ⤵ -530 bytes, old: 5232321, new: 5231791

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -74701,9 +74701,9 @@
             protected _m04: number;
             protected _m05: number;
             protected _m12: number;
             protected _m13: number;
-            constructor(component: any);
+            constructor(component: VideoPlayer);
             abstract canPlay(): void;
             abstract canFullScreen(enabled: boolean): void;
             abstract pause(): void;
             abstract resume(): void;
@@ -74712,9 +74712,9 @@
             abstract createVideoPlayer(url: string): void;
             abstract removeVideoPlayer(): void;
             abstract enable(): void;
             abstract disable(noPause?: boolean): void;
-            abstract syncClip(clip: any): void;
+            abstract syncClip(clip: VideoClip | null): void;
             abstract syncURL(url: string): void;
             abstract syncStayOnBottom(enabled: boolean): void;
             abstract syncKeepAspectRatio(enabled: boolean): void;
             abstract syncPlaybackRate(val: number): void;
@@ -74743,25 +74743,26 @@
             play(): void;
             delayedPlay(): void;
             syncFullScreenOnAwake(enabled: boolean): void;
             delayedFullScreen(): void;
-            protected dispatchEvent(key: any): void;
-            protected syncUITransform(width: any, height: any): void;
+            protected dispatchEvent(key: string): void;
+            protected syncUITransform(width: number, height: number): void;
             protected syncCurrentTime(): void;
             destroy(): void;
         }
+        /** @mangle */
         export class _cocos_video_video_player_impl_web__VideoPlayerImplWeb extends _cocos_video_video_player_impl__VideoPlayerImpl {
             protected _eventList: Map<string, ((e: Event) => void)>;
             protected _clearColorA: number;
             protected _clearFlag: any;
-            constructor(component: any);
+            constructor(component: VideoPlayer);
             protected addListener(type: string, handler: (e: Event) => void): void;
             protected removeAllListeners(): void;
             canPlay(): void;
             pause(): void;
             resume(): void;
             stop(): void;
-            syncClip(clip: any): void;
+            syncClip(clip: VideoClip | null): void;
             syncURL(url: string): void;
             syncPlaybackRate(val: number): void;
             syncVolume(val: number): void;
             syncMute(enabled: boolean): void;

@minggo minggo merged commit 92d0ee1 into cocos:v3.8.6 Jan 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants