# SubWindowFloatingWindow **Repository Path**: macenv/sub-window-floating-window ## Basic Information - **Project Name**: SubWindowFloatingWindow - **Description**: 本示例通过子窗口实现悬浮窗以及画中画功能实现视频小窗,介绍子窗口相关操作以及画中画功能。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 17 - **Created**: 2025-03-30 - **Last Updated**: 2025-03-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Subwindow-based Floating Window ### Overview This sample shows how to use a subwindow to implement a floating window and use the PiP feature to implement a small video window. ### Preview | Home page | |:----------------------------------------------------------:| | | ### How to Use 1. Touch the **Subwindow - floating window** button to go to the subwindow functional page. 2. Touch the four buttons to view the four different operations in the subwindow. 3. Touch the **PiP - small video window** to go to the PiP functional page. 4. Touch **enable PiP** to create a small video window. ### Project Directory ``` ├──entry/src/main/ets/ │ ├──constants │ │ └──CommonConstants.ets // Common constants │ ├──entryability │ │ └──EntryAbility.ets // Entry ability │ ├──pages │ │ ├──Index.ets // Home page │ │ ├──MiniWindowPage.ets // Page for showing or hiding the subwindow ││ │ ├──NavigationRedirectPage.ets // Page for redirection from the subwindow to the PiP window through the Navigation component │ │ ├──ResizeWindowPage.ets // Page for resizing the subwindow │ │ ├──RouterRedirect.ets // Page for redirection from the subwindow to the home page through the router │ │ └──RouterRedirectPage.ets // Redirection back to the home page through the router │ ├──utils │ │ └──Logger.ets // Log utility │ ├──view │ │ ├──MiniWindowComponent.ets // Custom components used to create, show, and hide the subwindow │ │ ├──NavigationRedirectComponent.ets // Custom components used to redirect from the subwindow to the PiP window through the Navigation component │ │ ├──PipWindowComponent.ets // Custom components for implementing the PiP feature │ │ ├──ResizeWindowComponent.ets // Custom components used to resize the subwindow │ │ └──SubWindowComponentRouter.ets // Custom components used to display routes in the floating window │ └──viewmodel │ ├──AVPlayerDemo.ets // Video playback control class │ └──WindowPosition.ets // Subwindow position └──entry/src/main/resources // Static resources ``` ### Required Permissions N/A ### Dependencies N/A ### Constraints 1. The sample app is supported only on Huawei phones running the standard system. 2. The HarmonyOS version must be HarmonyOS NEXT Developer Beta1 or later. 3. The DevEco Studio version must be DevEco Studio NEXT Developer Beta1 or later. 4. The HarmonyOS SDK version must be HarmonyOS NEXT Developer Beta1 or later.