Interactive video playing method, player, video platform, computer program product and storage medium

By constructing a video state machine and layering the core logic and presentation details of interactive videos, the problems of poor cross-platform compatibility and high development costs are solved, enabling flexible configuration and efficient cross-platform adaptation of interactive videos.

CN120916006APending Publication Date: 2025-11-07MUTUAL FILM & ENTERTAINMENT (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510996917.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing interactive video technologies lack a universal and flexibly configurable playback framework, resulting in poor cross-platform compatibility, insufficient support for diverse interactive scenarios, and high development and maintenance costs.

Method used

By loading the main configuration file and scene configuration file, a video state machine is built, and corresponding actions are executed in conjunction with the timeline, realizing cross-platform adaptation and flexible configuration of interactive videos. The video state machine is built to control the interactive logic by using a hierarchical parsing of video mapping, scene information, timeline, conditions, actions and variables.

Benefits of technology

It enhances cross-platform compatibility, reduces development and maintenance costs, supports diverse interactive scenarios, and ensures consistency in state transitions and stability in user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120916006A_ABST
    Figure CN120916006A_ABST
Patent Text Reader

Abstract

The invention provides an interactive video playing method, a player, a video platform, a computer program product and a storage medium, and the method comprises the steps: loading a main configuration file, and analyzing the main configuration file; loading a scene configuration file according to the scene configuration file information, and analyzing the scene configuration file; constructing a video state machine based on the video mapping, the scene information and the variables; starting a timeline, acquiring the progress of a currently played physical video by combining with a video state machine, and mapping the progress into a relative time point of the timeline; monitoring whether the playing progress is matched with a preset interaction control point in the timeline or not; during matching, executing a corresponding preset action based on the video state machine; or executing a corresponding preset action based on the video state machine when the time line time point triggering condition is matched and the time line time point triggering condition or the logic condition of the variable in the video state machine is met. By adopting the scheme provided by the invention, the cross-platform adaptation capability and the interaction flexibility are improved, and the customization development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of interactive video live streaming, in particular to a playing method, a player, a video platform, a computer program product and a storage medium of interactive video. BACKGROUND

[0002] With the richness of Internet video content, users are no longer satisfied with passive viewing, and the demand for video interactivity and personalization is increasing. Interactive video, as a new video form, allows users to influence the content direction by selection, greatly improving user engagement.

[0003] Currently, interactive video implementation relies heavily on platform-specific encoding formats and playing logic, lacking a general and flexible configuration playing framework, resulting in limited cross-platform applications.

[0004] Therefore, how to provide a general and flexible interactive video playing method to support cross-platform compatibility and diversified interactive scenarios, reduce development and maintenance costs, has become a technical problem to be solved at present. SUMMARY

[0005] Therefore, the embodiments of the present application provide a playing method, a player, a video platform, a computer program product and a storage medium of interactive video, which can solve the problems of poor cross-platform compatibility, insufficient support for diversified interactive scenarios, and high development and maintenance costs caused by the dependence of interactive video on platform-specific logic in the prior art, significantly improve cross-platform adaptation capability and interactive flexibility, and reduce customized development costs.

[0006] In a first aspect, the embodiments of the present application provide a playing method of interactive video, comprising: loading a main configuration file and parsing the main configuration file to obtain: video mapping, scene configuration file information, and metadata; wherein the video mapping is used to map a logical video identifier (Identifier, ID) to a physical video ID and a corresponding video segment; according to the scene configuration file information, loading a scene configuration file, parsing the scene configuration file to obtain: scene information, a timeline, conditions, actions and variables; based on the video mapping, the scene information and the variables, constructing a video state machine; starting the timeline, combining the video state machine to obtain the physical video progress of the current playing, and mapping it to the relative time point of the timeline; listening to whether the playing progress matches the preset interactive control point in the timeline; when matching the preset interactive control point, executing the corresponding preset action based on the video state machine; or, when matching the preset interactive control point and meeting the timeline time point trigger condition or the logic condition of the variable in the video state machine, executing the corresponding preset action based on the video state machine.

[0007] It can be understood that according to the scene configuration file information, after loading the scene configuration file, component, style or animation information can also be parsed.

[0008] With this scheme, by hierarchical parsing of the main configuration file and the scene configuration file, the core logic (such as video mapping and timeline control) of the interactive video is separated from the presentation layer details (such as components and styles), so that the interactive rules no longer depend on the underlying interface of a specific platform. Specifically, video mapping realizes the adaptation of the same interactive scenario on different video sources (such as video files of different resolutions and formats) through the correspondence between logical IDs and physical IDs; the timeline, conditions, actions and other elements parsed in the scene configuration file form a unified interactive control hub in combination with the video state, which can realize both timed triggering (such as popping up options at a certain time) through timeline listening and dynamic response (such as jumping to the scenario according to user selection) through variable logic, covering a variety of interactive scenarios. This scheme breaks the limitation of the strong binding of interactive logic and platform in the prior art, and a same set of configuration files can be reused in different environments such as browsers and native applications, without repeated development, improving the cross-platform adaptation capability; at the same time, the preset control points and the condition-action mechanism reduce the writing of customized code, reduce the development and maintenance cost, and make the creation and iteration of interactive videos more efficient and flexible.

[0009] It can be understood that in some possible implementation manners, when a preset interactive control point is not matched or a related condition is not met, the current playing state can be maintained and the playing progress can be continuously listened to.

[0010] In combination with the first aspect, in a first possible implementation manner of the first aspect, the video state machine is constructed by taking the physical video ID in the video mapping and the corresponding video segment as a state node, the variable as a state parameter, and the jump rule in the scene information as a state transition condition.

[0011] The above scheme clearly defines the construction logic of the video state machine, taking the physical video ID and the video segment as a state node, the variable as a state parameter, and the jump rule as a transition condition, forming a structured state management system. Compared with the scattered state control logic (such as independent storage of the playing state and user selection) in the prior art, this scheme realizes the coordinated management of video playing, user interaction and variable state through a finite state machine, ensuring the consistency and traceability of state transition. For example, when a user selects an option, variable updating will trigger node jumping of the state machine synchronously, avoiding playing abnormalities (such as misalignment of video jumping and User Interface (UI) display) caused by different states, and improving the stability and user experience of the interactive video.

[0012] In a second possible implementation form of the first aspect, the matching the preset interactive control point in the timeline comprises: after mapping the physical video progress to the relative time point of the timeline, matching the preset interactive control point in the timeline based on a timestamp; or matching the interactive control point based on a current value of the variable and a variable logical condition in the condition.

[0013] The above scheme refines the triggering logic of the interactive control point through two matching methods (timestamp matching and variable logic matching), covering two core interactive scenarios of "time sequence driving" and "state driving". The timestamp matching ensures accurate interaction at a specific time (such as a timed pop-up window), and the variable logic matching supports dynamic interaction based on user behavior (such as selection and input) (such as displaying different plot branches according to user selection), solving the problem of single interaction triggering method in the prior art, which cannot support complex scenarios. The flexible combination of the two matching methods enables the interactive video to meet the needs of timed interaction in linear narrative and adapt to the needs of branch selection in nonlinear narrative, improving the diversity and accuracy of interactive scenarios.

[0014] In a third possible implementation form of the first aspect, the preset action comprises at least one of the following operations: a video control operation of controlling video playing, pausing or jumping through the video state machine, a UI operation of updating a display state of an interface element, and a variable updating operation of modifying a variable value in the video state machine.

[0015] The above scheme clearly defines three types of core operations (video control, UI operation, and variable updating) and their "at least one" combination logic, providing a modular action execution mechanism for interactive videos. Compared with the design in the prior art in which actions are strongly coupled with specific functions (such as playing control and UI updating being bound in the same function), this scheme allows flexible selection of action types according to scene requirements: for example, simple interactive scenarios can only perform UI operations (such as displaying prompts), and complex scenarios can combine variable updating and video jumping (such as updating scores and jumping to the corresponding ending after user selection). This modular design reduces the reuse threshold of action logic, and developers do not need to repeatedly write basic operation code, but only need to configure action combinations to achieve diversified interaction, improving development efficiency and reducing code redundancy.

[0016] In a fourth possible implementation form of the first aspect, the UI operation of updating the display state of the interface element comprises: triggering a front-end rendering engine through the video state machine to update a display state, position, size, transparency or text content of an interface component.

[0017] The above scheme refines the specific implementation mode of the UI operation, triggers the front-end rendering engine to update the display state, style or content of the interface component through the video state machine, and realizes decoupling of the UI interaction and the video playback logic. Compared with the design of deep binding of the UI control and the video player in the prior art (such as the UI plug-in depending on a specific player), the scheme supports controlling interface elements of different front-end frameworks (such as React and Vue) through a unified interface, and ensures the cross-platform consistency of the UI interaction. For example, the same set of UI update instructions can be implemented through document object model (DOM) operation in a browser and through native control rendering in a native application, solving the problem of high UI adaptation cost on different platforms, and improving the fine control ability of the UI interaction by explicitly updating the dimensions (display state, position, size, transparency and the like).

[0018] With reference to the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes: in response to a user input event, updating a variable value in the video state machine, and triggering condition checking and action execution associated with the variable.

[0019] The above scheme explicitly defines the dual mechanism (memory modification + persistence / synchronization) of the variable update operation, ensures the real-time and continuity of the user interaction state. The variable update and action triggering are immediately responded by directly modifying the memory variable through the video state machine (such as immediately updating the value and displaying after the user selects). The local storage or remote synchronization mechanism solves the problem of easy loss of the variable state in the prior art (such as the disappearance of the user selection record after page refresh). For example, after the user pauses the video on a mobile terminal, the variable value can be synchronized to the cloud, and the state is automatically restored when the video is played on a PC, improving the coherence of the cross-device experience, and providing a data basis for subsequent data analysis (such as user behavior tracking).

[0020] In a second aspect, an embodiment of the present application provides a player of interactive video, comprising: a loading and parsing module, configured to load a main configuration file and parse the main configuration file to obtain a video mapping, scene configuration file information, and metadata; wherein the video mapping is configured to map a logical video ID to a physical video ID and a corresponding video segment; and the loading and parsing module is further configured to load a scene configuration file according to the scene configuration file information, and parse the scene configuration file to obtain scene information, a timeline, conditions, actions, and variables; a state machine engine, configured to construct a video state machine based on the video mapping, the scene information, and the variables; a timeline synchronization module, configured to start the timeline, and combine the video state machine to obtain a physical video progress of current playing, and map the physical video progress to a relative time point of the timeline; a listening module, configured to listen whether a playing progress matches a preset interactive control point in the timeline; and an interactive control module, configured to, when the preset interactive control point is matched and a timeline time point triggering condition or a logical condition of a variable in the video state machine is satisfied, execute a corresponding preset action based on the video state machine.

[0021] It can be understood that, according to the scene configuration file information, after loading the scene configuration file, component, style, or animation information can also be parsed and obtained.

[0022] In a third aspect, an embodiment of the present application provides an interactive video platform, comprising: the player of interactive video as described in the second aspect or any possible implementation manner of the second aspect; a content management system, configured to generate, store, and manage a main configuration file and a scene configuration file of the interactive video; and a data synchronization module, configured to synchronize user interaction data and a variable value in the video state machine.

[0023] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements steps of the playing method of the interactive video as described in the first aspect or any possible implementation manner of the first aspect.

[0024] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements steps of the playing method of the interactive video as described in the first aspect or any possible implementation manner of the first aspect.

[0025] It can be understood that the player of interactive video as described in the second aspect, the interactive video platform as described in the third aspect, the computer program product as described in the fourth aspect, and the computer readable storage medium as described in the fifth aspect obtain similar technical effects to the corresponding technical means in the playing method of the interactive video as described in the first aspect, and thus details are not repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0026] Figure 1 is a flowchart of a method for playing an interactive video according to an embodiment of the present application; Figure 2 is a structural diagram of a player for playing an interactive video according to an embodiment of the present application; Figure 3 is a flowchart of a design process of a player for playing an interactive video according to an embodiment of the present application; Figure 4 is a flowchart of an execution process of a method for playing an interactive video according to an embodiment of the present application; Figure 5 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to any or all possible combinations of one or more of the associated listed items.

[0028] Hereinafter, the terms "first" and "second" are only used for the purpose of description and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.

[0029] With the development of Internet video content, interactive videos have become a new type of video form favored by users because they can enhance user engagement by allowing users to choose features that affect the direction of content. However, the current implementation of interactive videos relies heavily on platform-specific encoding formats and playback logic, and lacks a general and flexible playback framework, which results in serious limitations when interactive videos are applied across platforms, making it difficult to smoothly flow between different operating systems, terminal devices or application platforms. This platform dependency not only causes poor cross-platform compatibility, making it difficult for the same interactive video to maintain consistent playback effects and interactive experiences on multiple platforms, but also lacks support for diverse interactive scenarios, failing to meet the interactive needs in different scenarios. At the same time, customized development to adapt to different platforms and scenarios significantly increases the cost of development and maintenance, hindering the promotion and application of related technologies, and becoming a technical bottleneck restricting the further development of interactive videos. Therefore, the embodiment of the present application provides an interactive video playing method, which constructs a general and flexible playing system through loading and analyzing a master configuration file and a scene configuration file, combining a timeline to execute corresponding actions and the like. The scheme can effectively solve a series of problems caused by the dependence of the interactive video on platform-specific logic in the prior art, is beneficial to improving cross-platform adaptation capability and interactive flexibility, reducing customized development cost, and clearing technical obstacles for the wide application of the interactive video.

[0030] Please refer to Figure 1 , Figure 1 is a flowchart of an interactive video playing method provided by an embodiment of the present application. The interactive video playing method can include the following steps: S101 to S106.

[0031] S101. Load a master configuration file and analyze the master configuration file to obtain a video mapping, scene configuration file information and metadata; wherein the video mapping is used to map a logical video ID into a physical video ID and a corresponding video segment.

[0032] It should be noted that the configuration file is used to describe the interactive logic of the interactive video. In order to describe the business logic as much as possible through the configuration and reduce code development, a complete set of description primitives need to be defined. At the same time, in order to be compatible with the configuration standards of various video platforms, the configuration description should become a superset of the standards of various platforms, so as to flexibly adapt to various platforms.

[0033] The media form of the interactive video is not limited to video, but can also include audio, computer graphics (CG), pictures, text, and even objects in the real physical world for augmented reality (AR). Each interaction of the user with the interactive video can be abstracted as an interactive scene (Scene), and the carrier can be video, CG, picture, etc. Each scene is a separate scene configuration file. The interactive video loads a master configuration file at the initial running, and the file contains description information of the entire interactive video.

[0034] The principle of designing the interactive logic description primitives is atomization and orthogonality. The atomization means that the description primitives cannot be further divided and are the basic operation units of the interaction. The orthogonality means that the description primitives are independent and non-overlapping. By combining these primitives, the description of the entire interactive logic can be completed.

[0035] It should be noted that the configuration file is divided into a master configuration file and a scene configuration file. The master configuration file (MC) is mainly composed of the following modules: Video Mapping, for mapping logical video IDs to actual stored physical video IDs and their corresponding video segments, establishing the mapping relationship between logical video IDs and physical video resources, wherein the physical video resources can be further described by a "Resource Configuration" file, and the resource configuration file can include: the types of audio / video, picture and other media assets (such as MP4, WebM, JPEG, etc.), multi-format links (such as 1080p / 720p / 4K versions) and quality parameters, for the Software Development Kit (SDK) to dynamically select the optimal version based on network bandwidth, device performance and other environmental factors.

[0036] Scene Info, for recording all scene configuration file information required by the entire project, including paths, identifiers, etc., for subsequent loading.

[0037] Metadata is the description data of the project, including global attributes of the interactive video (such as: title, author, version number, etc.), and project-level variables declared through "Var Configuration" (such as: user score, selection state, etc.), which serve as state parameters for the construction of the subsequent video state machine.

[0038] When the interactive video is played, the main configuration file (such as JSON or XML format) is loaded first, and then the configuration file is parsed to obtain: video mapping, scene configuration file information, and metadata; wherein the video mapping is used to map logical video IDs to physical video IDs and corresponding video segments.

[0039] Among them, the video mapping is used to establish the mapping relationship between the logical video ID and the physical video resource, for example, mapping "intro_scene" to the actually stored "video / intro_1080p.mp4". The scene configuration file information is used to record the path or identifier of the scene configuration file for subsequent loading. The metadata contains global attributes of the interactive video (such as title, author, version number, etc.).

[0040] For example, the main configuration file can include the following content: json { "videoMapping": { "intro": {"physicalId":"video_001","startTime": 0,"endTime": 60}, "choice_a": {"physicalId":"video_002","startTime": 0,"endTime": 30} }, "sceneConfig":"scenes / main_scene.json", "metadata": {"title":"Interactive Adventure Game","version":"1.0"} } This JSON is the main configuration file for an interactive video. After parsing, it reveals three core pieces of information: First, "videoMapping," which defines the mapping between logical video IDs and physical video resources. For example, "intro" (a logical identifier, which can be understood as the "opening clip") corresponds to the actually stored "video_001" (physical identifier), with a playback range of 0-60 seconds; "choice_a" (a logical identifier, which can be understood as "option A" of the storyline) corresponds to "video_002," with a playback range of 0-30 seconds. Second, "sceneConfig," which specifies the path to the scene configuration file "scenes / main_scene.json," used for loading more detailed interactive logic later. Third, "metadata," which records the video's metadata, such as the title "Interactive Adventure Game" and the version number "1.0." This structured configuration decouples the interactive video logic layer from the physical resource layer, providing a foundation for cross-platform reuse and flexible management.

[0041] S102. Based on the scene configuration file information, load the scene configuration file, parse the scene configuration file, and obtain: scene information, timeline, conditions, actions, and variables.

[0042] Understandably, after loading the scene configuration file based on the scene configuration file information, information such as components, styles, or animations can also be parsed.

[0043] It should be noted that parsing the scene configuration file yields information that is not limited to scene information, timeline, conditions, actions, and variables. It can also include: scene information, timeline, conditions, actions, components, variables, styles, and animations. The parsed information can be more or less than these types of data. When it is less than these types of data, the parsed values ​​for the missing information can be preset values, such as null values.

[0044] In practice, the scene configuration file can be loaded and the interactive logic elements within it can be parsed based on the path information in the main configuration file. The relevant information in the configuration file mainly includes the following information.

[0045] Scene is used to describe the resource ID, video mapping relationship and time length required by the current scene, and defines the organization structure of the video segment (such as chapters, branch relationships, etc.). Combined with the pre-defined material processing rules (such as video splicing order, transcoding parameters) in the Build Configuration, it helps to realize seamless connection of multiple video segments.

[0046] For example, a scene configuration file is defined as follows.

[0047] json { "scenes": [ {"id":"scene_1","videoId":"intro","nextScenes": ["scene_2","scene_3"]} ], "timeline": [ {"timePoint": 10,"controlPoint":"show_question_1"}, {"timePoint": 30,"controlPoint":"check_answer"} ], "variables": {"score": 0,"choice": null}, "actions": [ {"id":"show_question_1","type":"show_ui","target":"question_component"}, {"id":"check_answer","type":"jump","condition":"choice ==='A'","targetScene":"scene_2"} ] } After parsing, it can be known that the example corresponds to an interactive video in which the scene configuration file defines the video playback process and the interactive logic. It contains four core parts: (1) scene structure: the current scene "scene_1" is associated with the video "intro" (corresponding to the physical video in the main configuration), and two possible subsequent scenes "scene_2" and "scene_3" are set, implying that there is a branch plot. (2) Timeline: trigger the "show_question_1" control point (such as displaying a multiple-choice question) when the video plays to the 10th second, and trigger the "check_answer" control point (such as checking the answer and deciding to jump) at the 30th second. (3) Variable system, maintain dynamic data, initial score is 0, and user selection is null. (4) Action rules: the "show_question_1" action displays the user interface (UI) component "question_component"; the "check_answer" action jumps to "scene_2" when the variable "choice" is equal to "A", otherwise it may enter "scene_3" by default. The whole interactive logic is realized through time triggering and conditional judgment, such as entering scene 2 if the user selects A, otherwise entering scene 3, providing support for nonlinear narrative.

[0048] The timeline records the timestamps of the interactive control points, which is a set of time points (such as 10 seconds, 30 seconds, etc.). Time points are used to describe operations to be performed at a specific time, such as displaying hidden UI, jumping to video, etc. Specifically, the timeline can take the starting point of the current scene as 0, use seconds to describe, and the format is a floating-point number.

[0049] In some possible implementation manners, a user uploads segmented videos through an Altstory Creative Engine (ACE) system, and connects the interactive videos by specifying the logical relationship between each segment of video. However, due to the limitations of devices and systems, multiple segments of video cannot be preloaded at the same time during preloading, so it is necessary to merge several segments of video into one segment of video. At this time, the positions of each segment of video in the merged video need to be specified. On the other hand, different devices in different network environments need to be provided with appropriate audio and video encoding, and there are multiple encoding formats and packaging formats for the same segment of video. The above two cases need to map a segment of video (logical video) to an actual physical video.

[0050] For example, the mapping profile of a certain interactive video is as follows, where VVID is a logical video identifier (Logical Video ID, VVID), PVID is an actual physical video identifier (Physical Video ID, PVID), and the "begin" and "end" key-value pairs correspond to the start and end time positions of a logical video on a physical video.

[0051] { "videoMapping": { "vvid001": { "pvid":"pvid001", "begin":"0.000", "end":"15.500" }, "vvid002": { "pvid":"pvid001", "begin":"15.500", "end":"31.750" }, "vvid003": { "pvid":"pvid002", "begin":"0.000", "end":"22.220" }, "vvid004": { "pvid":"pvid002", "begin":"22.220", "end":"33.000" }, "vvid005": { "pvid":"pvid001", "begin":"31.750", "end":"40.000" } } } It can be known that, by the corresponding relationship between the logical video ID (VVID) and the physical video ID (PVID), the problems of segmented video merging and multi-format adaptation can be solved. Specifically: first, the logical concatenation of segmented videos is realized. For example, "vvid001" and "vvid002" are two logical videos, but they are mapped to different intervals (0-15.5 seconds, 15.5-31.75 seconds) of the same physical video "pvid001". The player can seamlessly splice and play them according to this configuration. Second, multi-version encoding adaptation is supported. For example, "vvid003" and "vvid004" are mapped to "pvid002", which may represent different encoding formats (such as H.264 / H.265) of the same content, for the SDK to select according to the network and device environment. Third, cross-mapping is allowed. For example, "vvid005" returns to the subsequent interval (31.75-40 seconds) of "pvid001", which embodies the flexible correspondence between logical videos and physical storage. This mapping mechanism not only meets the logical needs of interactive video nonlinear narrative, but also solves the problems of device compatibility and network adaptability, ensuring that the same set of interactive logic can adapt to various playback environments.

[0052] In one example, the scene information contains the ID of the current scene, the required resource ID set, the corresponding VVID, the effective duration, and other information, as follows.

[0053] { "sceneID":"scene002", "resID": [ "res006", "res007", "res008" ], "vvid": [ { "id":"vvid002", "baseTime":"10.000" } ], "duration":"16.250" } In this scenario example, the configuration rule of the scene information in the interactive video is defined. The scene information contains the unique identification of the scene "sceneID" (such as "scene002"), the required resource set of the scene (such as "res006", "res007", "res008", which are used to specify the loaded audio and video, picture and other resources), the associated logical video ID (VVID) and the corresponding base time (baseTime), and the effective duration of the scene (such as "16.250" seconds). Among them, "baseTime" in vvid represents the starting time point of the current scene in the associated logical video (such as "10.000" seconds, that is, the scene starts from the 10th second of the logical video), and if the scene starts from the beginning of the logical video, baseTime is "0.000" seconds. This configuration clearly defines the time association of the scene and the logical video and the resource dependency, providing a basis for accurate triggering of timeline operation and on-demand loading of resources.

[0054] The timeline configuration and time point mapping rule of the interactive video is as follows: { "timeline": { "0.000": [ { "type":"action", "id":"act001" }, { "type":"condition", "id":"cond001" }, { "type":"condition", "id":"cond002" } ], "16.250": [ { "type":"action", "id":"act002" } ] } } It can be seen that, since the timeline takes the current scene starting point as 0 point, records the time point by the floating-point number format of seconds, and each time point is associated with the operation to be performed (such as action, condition judgment), it can be known from the previous example that the configuration executes the action "act001" and the condition judgment "cond001", "cond002" at "0.000" seconds, and executes the action "act002" at "16.250" seconds. The mapping logic of the time point is: taking the starting point of the logical video (vvid) associated with the current scene as the reference, the timeline time point needs to be superimposed with the starting reference time (baseTime) of the logical video to obtain the corresponding vvid time point, and then superimposed with the starting time (begin) of the vvid in the physical video (pvid), and finally mapped to the actual playing time point of the physical video (for example, the action act002 corresponds to the baseTime of vvid002 + 16.250, that is, 10.000 + 16.250 = 26.250 seconds, and the corresponding pvid001 time point is vvid002.begin + baseTime + 16.250, that is, 15.500 + 10.000 + 16.250 =41.750 seconds), so as to realize the accurate association of the timeline operation and the physical video playing progress, and ensure that the interactive event is triggered at the correct time.

[0055] It should be noted that the interactive video system can also realize rich interactive experience through the cooperative configuration of components, variables, styles and animations. Components are basic elements of the interface, including buttons, text boxes, pictures and other visual controls, which are used for direct interaction with users (such as multiple-choice button, progress bar). Variables are used to store and track system state (such as user score, selection result), support dynamic logic judgment (such as "if score > 80, display reward interface"). Style uses a syntax similar to CSS to define the visual appearance of components (such as color, font, position), which can realize the unified style or responsive adjustment of the interface (such as adapting to mobile phone / tablet layout). Animation adds dynamic effects to components (such as fade-in and fade-out, sliding switch), which improves the smoothness of interaction (such as the gradual appearance animation of options).

[0056] For example, in an educational interactive video: when the video plays to the 15th second, the system judges whether the user has completed the pre-test through the variable (variable value: isTestCompleted = true), if yes, a "continue learning" button (component) is displayed, the button style is set to green round corner (style), and a sliding-in animation from the bottom is added; if not, a red prompt text box (component) is displayed, prompting "please complete the test" (variable driven content). This combination mechanism enables the interactive video to adjust the interface presentation in real time according to user behavior, realizing personalized viewing experience.

[0057] S103. Construct a video state machine based on the video mapping, scene information, and variables.

[0058] The construction of the video state machine is the core step to realize the logic control of interactive video. It integrates video mapping, scene information, and variable system to abstract interactive video into a state transition model that can be precisely controlled. The basic unit of the state machine is the state node, which is defined by the physical video ID and its time interval (e.g., "video_001 (0-60 seconds)"). Each node represents a specific playback segment. The state parameters are dynamic data in the variable system (e.g., user selection, score, etc.), which are used for conditional judgment during state transition. The state transition conditions are based on the jump rules in the scene configuration (e.g., "user selects A → jump to scene_2"), which define the trigger logic of state migration. This model decouples video playback, user interaction, and state management, enabling the system to dynamically adjust the playback process based on user behavior.

[0059] For example, in an interactive video with a branching plot, when the user watches the "intro" video (corresponding to the physical video "video_001" for 0-60 seconds), the system listens for changes in the variable "choice". If the user selects option A during video playback (i.e., the variable "choice" is assigned the value "A"), the state machine will trigger the transition logic to jump from the current state to the "video_002" corresponding to "scene_2" (0-30 seconds). This mechanism enables interactive video to flexibly switch between multiple video segments based on real-time user selection, achieving a non-linear narrative interactive experience while ensuring that all state transitions are traceable and predictable, improving the stability and maintainability of the system.

[0060] S104. Start the timeline and map the current playback progress of the physical video to the relative time point on the timeline based on the video state machine.

[0061] The core of this step is to start the timeline module and establish the mapping relationship between the physical video playback progress and the relative time point on the timeline. The timeline takes the starting point of the current scene as the reference point (i.e., 0). When the physical video is playing, the system will convert the actual playback progress (e.g., 15 seconds) into a relative time point on the timeline in real time, ensuring that the pre-set interactive control points on the timeline can be triggered accurately. This process needs to handle the splicing logic of video segments, such as when switching from one physical video segment to another, the time offset needs to be calculated through the video mapping relationship to ensure the continuity of the timeline during cross-segment playback.

[0062] For example, if a control point of "show prompt text" is set at the 10th second in the timeline, when the physical video plays to the corresponding moment (which may need to be superimposed with a start offset due to segment splicing), the system maps this progress to the 10th second of the timeline, thereby triggering the text display action; if the video plays to the 30th second, and the timeline defines a control point of "hide button" at this point, the same mapping logic activates the operation. This real-time mapping mechanism ensures the synchronization of interactive events and video content, and is a key link to achieve precise interaction.

[0063] S105. Listen to whether the playing progress matches the preset interactive control point in the timeline.

[0064] This step realizes the precise matching of interactive control points by continuously listening to the video playing progress, ensuring the synchronous triggering of interactive logic and video content. This process includes two matching methods: timestamp matching directly compares the current playing time with the preset control point time (such as the 10th second, the 30th second) in the timeline, and triggers the corresponding operation when they are consistent; variable logic matching combines the variable system to check whether the current variable value meets a specific condition (such as "score ≥ 60", "selection result is B"), which serves as an additional basis for triggering interaction. It can also be a combination of the two methods, ensuring both the determinacy of time-driven operations and the dynamic logic judgment based on user behavior.

[0065] For example, in a question-answering interactive video: when playing to the 15th second (timestamp matching), the system triggers the control point of "show question", and a multiple-choice interface pops up; after the user selects option B, the variable "choice" is assigned the value "B", and when playing to the 30th second (timestamp matching), the system triggers the operation of "jump to the analysis video corresponding to option B" through variable logic matching "choice='B'". This matching mechanism not only ensures that interactive events occur at the correct time point, but also dynamically adjusts the subsequent process according to the user's real-time selection, realizing flexible interactive experience.

[0066] S106. When matching the preset interactive control point, execute the corresponding preset action based on the video state machine; or when matching the preset interactive control point and meeting the time point triggering condition or the logic condition of the variable in the video state machine, execute the corresponding preset action based on the video state machine.

[0067] The core of this step is to perform preset actions based on the video state machine when matching the interactive control point and meeting the trigger condition, which covers three types of key operations: video control (such as pause, play, jump to a specified timestamp, or switch video segments), UI operation (such as displaying / hiding buttons, updating text content, or adjusting component styles), and variable update (such as recording user choices or increasing / decreasing scores). These three types of operations can also work together to respond to user interactions and drive dynamic changes in the video flow, ensuring the complete execution of the interactive logic.

[0068] For example, when the user clicks the "accept task" button at a plot branch point, the system first performs variable update, setting "taskAccepted" to "true"; then performs UI operation, hiding the option button group and displaying the task detail panel (style: semi-transparent floating window); and then when the video plays to the 45th second, the state machine triggers the video control operation according to the preset rule "taskAccepted==='true'", jumping to the physical video segment corresponding to the task execution (12.300-58.750 seconds interval of pvid005). This action execution mechanism ensures seamless integration of interactive logic and video content through precise judgment of variable state by the state machine, while keeping consistent interactive experience whether it is a web interface updated through DOM or a native application calling native controls, significantly improving cross-platform adaptation efficiency.

[0069] By adopting the scheme provided in the embodiment, a complete set of configuration description primitives (specifically embodied as atomized and orthogonalized definitions of core elements of interactive logic, including video mapping, scene information, timeline, variable, action, component, style and animation, etc., which are independent of each other and cannot be further divided, and can cover all interactive logic scenes through combination) are constructed, decoupling of interactive logic and video playing is achieved, and cross-platform adaptation cost and development complexity are significantly reduced. The core advantages are as follows: through hierarchical design of the main configuration file and the scene configuration file, combined with the cooperative work of the above primitives and the video state machine, flexible splicing of segmented videos and multi-format coding adaptation (to meet the needs of different devices and network environments) are supported, and nonlinear narration and personalized interaction (such as user selection driving plot branching) are realized based on time triggering and condition judgment; at the same time, since the interactive logic is defined by the configuration file instead of the code, and the configuration is compatible with the standards of various platforms, the same set of interactive logic can be reused on multiple platforms such as Web and mobile terminal, and only the underlying rendering method needs to be adjusted, effectively avoiding customized development for different video platforms, greatly reducing the development cost of cross-platform applications, and breaking through the platform limitation of interactive videos; in addition, based on the complete primitive system, the scheme supports diversified media forms such as audio, CG, picture, text and AR, and can flexibly cope with rich interactive scenes, providing efficient and flexible technical support for diversified interactive experiences (such as education, entertainment, games, etc.).

[0070] In some possible implementation ways, constructing the video state machine includes: taking a physical video ID in the video mapping and a corresponding video segment as a state node, taking a variable as a state parameter, and taking a jump rule in the scene information as a state transition condition, to construct the video state machine. The scheme clearly defines the core elements of the video state machine construction: the state node is composed of a physical video ID and a time interval thereof (for example, "0-15.5 seconds of pvid001"), representing a specific playing segment; the state parameter is dynamic data in the variable system (for example, "score=80" and "choice='A'"); and the state transition condition is based on the jump rule in the scene configuration (for example, "if choice='A', jump to scene_2"). The three together form a closed-loop logic of "node-parameter-condition", so that the state machine can dynamically switch the playing segment according to the real-time variable value.

[0071] For example, in a knowledge contest interactive video, the state node includes "20-40 seconds of pvid003" (corresponding to the first question answering segment), the state parameter is "answer=null", and the transition condition is "if answer='correct', jump to 0-30 seconds of pvid004 (reward segment)". When the user selects the correct answer, the variable "answer" is updated to "correct", the state machine triggers the transition, and the reward segment is played.

[0072] The scheme ensures the predictability and logic of state transition by specifying the components of the state machine, so that complex branching plots can be precisely controlled. At the same time, the physical video segments are bound with variables and jump rules, realizing the deep cooperation between video playback and interactive logic, and providing stable technical support for non-linear narrative.

[0073] In some possible implementations, the UI operation for updating the display state of the interface element includes triggering the front-end rendering engine through the video state machine to update the display state, position, size, transparency, or text content of the interface component. The scheme refines the specific content of the UI operation, and specifies that the UI update needs to trigger the front-end rendering engine through the video state machine to adjust the visual properties (such as adjusting the button transparency from 0 to 1 to achieve the fade-in effect), layout parameters (such as moving the text box position from the left side of the screen to the center), or content (such as updating "remaining time: 10 seconds" to "remaining time: 5 seconds") of the component.

[0074] For example, in a live interactive scene, when the variable "viewerCount" exceeds 1000, the state machine triggers the rendering engine to perform the UI operation: enlarge the size of the "popularity badge" component to 1.2 times the original size, move the position to the upper right corner of the screen, update the text content to "popularity is surging!", and set the transparency to 0.9 to highlight the display.

[0075] The scheme specifies the triggering method and adjustment dimensions of the UI operation, ensures the synchronization of interface update and video state machine logic, avoids interactive confusion caused by the disconnection of UI and state, and supports fine visual adjustment to improve the smoothness and aesthetics of user experience.

[0076] Reference Figure 2 , Figure 2This is a schematic diagram of the structure of an interactive video player provided in an embodiment of the present invention. In this embodiment, the interactive video player includes: a loading and parsing module, used to load and parse the main configuration file to obtain: video mapping, scene configuration file information, and metadata; wherein, the video mapping is used to map logical video IDs to physical video IDs and corresponding video segments; and is used to load and parse the scene configuration file according to the scene configuration file information to obtain: scene information, timeline, conditions, actions, and variables; a state machine engine, used to construct a video state machine based on the video mapping, scene information, and variables; a timeline synchronization module, used to start the timeline, combine the video state machine to obtain the current playback progress of the physical video, and map it to a relative time point on the timeline; a listening module, used to listen to whether the playback progress matches a preset interactive control point in the timeline; and an interactive control module, used to execute a corresponding preset action based on the video state machine when a preset interactive control point is matched; or, used to execute a corresponding preset action based on the video state machine when a preset interactive control point is matched and the timeline time point trigger condition or the logical condition of the variables in the video state machine is met.

[0077] It is understandable that, based on the scene configuration file information, after loading the scene configuration file, information such as components, styles, or animations can also be parsed and obtained.

[0078] In some possible implementations, the state machine engine is specifically used to construct a video state machine by taking the physical video ID and corresponding video segment in the video mapping as state nodes, variables as state parameters, and transition rules in the scene information as state transition conditions.

[0079] In some possible implementations, regarding matching preset interactive control points in the timeline, the interactive control module is specifically used to: map the physical video progress to a relative time point in the timeline, and then match the preset interactive control points in the timeline based on the timestamp; or, match the interactive control points based on the current value of the variable and the logical conditions of the variable in the condition.

[0080] In some possible implementations, the preset actions include at least one of the following operations: video control operations that control video playback, pause, or jump via the video state machine, UI operations that update the display state of interface elements, and variable update operations that modify the values ​​of variables in the video state machine.

[0081] In some possible implementations, in terms of UI operations that update the display state of interface elements, the interactive control module is specifically used to trigger the front-end rendering engine through the video state machine to update the display state, position, size, transparency, or text content of interface components.

[0082] In some possible implementations, the interaction control module is further configured to update a variable value in the video state machine and trigger a condition check and action execution associated with the variable in response to a user input event.

[0083] It should be noted that the details of the operation of each module can be referred to the corresponding description in the foregoing method embodiments, which will not be described here.

[0084] The embodiment of the application further provides an interactive video platform, comprising the interactive video player in any of the foregoing embodiments, a content management system configured to generate, store and manage a main configuration file and a scene configuration file of the interactive video, and a data synchronization module configured to synchronize user interaction data with a variable value in the video state machine.

[0085] In a specific implementation, the modules in the interactive video platform can be further refined, as shown in the following figure. Figure 3 The flow of the interactive video player will be described in combination with the modules in the foregoing figure, which can be roughly divided into three stages. Figure 3

[0086] (1) Resource acquisition and configuration analysis stage In this stage, the Content Delivery Network (CDN) file module is responsible for providing configuration files and static files, which are processed by the configuration acquisition and verification module to ensure the accuracy and integrity of the files, and then analyzed by the configuration analysis module. The configuration files obtained in this process contain key information, such as the correspondence between the logical video ID (VVID) and the actual physical video ID (PVID) in the video mapping module, and the jump rules in the scene information module. At the same time, the Content Delivery Network (CDN) streaming module pulls the media asset, including videos and configuration files, and these resources will enter the resource preloading (video, configuration file) module for preloading. The video resources in the module correspond to the state node materials required for building the video state machine later, that is, the video segments corresponding to the specific physical video ID.

[0087] (2) Logic construction and running stage ​Based on the parsed configuration, construction is performed by the "build video state machine" module, taking the actual physical video ID and corresponding video segment in the "video mapping" module as a state node, the variable in the "variable" module as a state parameter, and the jump rule in the "scene information" module as a state transition condition. The "start timeline, listen to Video timeupdate, and time point matching strategy" module starts to work and matches the preset interactive control points in the timeline. There are two matching methods: one is to map the physical video progress to the relative time point in the timeline, and then perform matching based on the timestamp in the "time point matching strategy" module; the other is to use the "variable" module to match the variable current value with the set variable logic condition. After matching the interactive control point, the "action execution" module executes the preset action, including the video play, pause, or jump operation implemented by the "video control operation" module; the update interface element display state operation completed by the "UI operation" module, such as triggering the front-end rendering engine to change the display state, position, size, etc. of the interface component; and the variable value modification operation executed by the "variable update operation" module. When the "user input event" occurs, the "variable" module updates the variable value, then triggers the associated condition verification, and executes the corresponding action in the "action execution" module.

[0088] (3) Scene management and resource release phase When it is necessary to exit the scene, the "log out scene (exit scene, destroy the current sub-scene, and release resources)" module is used for operation, the current sub-scene is destroyed, and the resources are released. During the interactive video playback process, with scene switching, the state nodes in the "video state machine" module, the variables in the "variable" module, and other information will change. Reasonable release of resources can guarantee the smoothness of interactive video playback and ensure the smooth execution of interactive logic, for example, the correct update of variables in the new scene and the normal performance of condition judgment, without logic errors caused by resource occupation problems.

[0089] Figure 4 is a schematic diagram of the execution process of the interactive video playback method provided by an embodiment of the present application; the "scene" interacts with the "Execution" module through the "exports API" (export application program interface). In the "Execution" module, the "ExecManager" has the function of initializing the scene (through init(Array <scene>) method, and the ability to perform operations related to a specific scene ID and events (through the exec(sceneid, events) method). This is similar to the initialization settings for different scenes and the operation execution in response to various events within the scene during the interactive video playback process.

[0090] The "conditionsManager" is responsible for managing conditions, and it can add conditions (addCond(scene) method), process condition mappings (condMap(type) method), and the like, which is similar to setting and managing various condition judgment rules in the interactive video logic to ensure that the video playback can be logically transferred according to the set conditions. The "ActionsManager" is focused on managing actions, such as adding actions (addAction(scene) method), processing action mappings (actionMap(actionKey) method), and corresponding to the actual operation execution in the interactive video, the video playback control, the display and hiding of interface elements, and the like. Through the collaborative work of these parts, the complete logic flow of condition judgment and action execution in the interactive video is realized.

[0091] Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device 500 includes a memory 501 and a processor 502, the processor 502 is configured to execute computer executable instructions, and the memory 501 stores one or more computer executable instructions, which, when executed by the processor 502, implement the steps of any of the interactive video playback methods described in the foregoing method embodiments.

[0092] The embodiment of the present application further provides a computer storage medium, which stores a computer program, and the computer program is executed by a processor to implement any of the foregoing embodiments of the interactive video playback method.

[0093] The embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement any of the foregoing embodiments of the interactive video playback method.

[0094] The embodiment of the present application further provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute any of the foregoing embodiments of the interactive video playback method.

[0095] It can be understood that the beneficial effects that can be achieved by the interactive video player, the interactive video platform, the electronic device, the computer storage medium, the computer program product, and the chip system provided above can refer to the beneficial effects described in the method embodiments, which will not be repeated here.

[0096] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, such as the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as digital versatile disc (DVD)) or semiconductor media (such as solid state disk (SSD)) and the like.

[0097] The above is an optional embodiment provided by the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. within the technical scope disclosed by the present application should be included in the protection scope of the present application.< / scene>

Claims

1. A method for playing an interactive video, characterized by, The method comprises: loading a main configuration file and parsing the main configuration file to obtain video mapping, scene configuration file information, and metadata; wherein the video mapping is used to map a logical video ID to a physical video ID and a corresponding video segment; according to the scene configuration file information, a scene configuration file is loaded, the scene configuration file is parsed, and scene information, a timeline, conditions, actions, and variables are obtained; and a video state machine is constructed based on the video mapping, the scene information, and the variables; starting the timeline and combining the video state machine to obtain a physical video progress of current playing, which is mapped to a relative time point of the timeline; listening to whether a playing progress matches a preset interactive control point in the timeline; when the preset interactive control point is matched, performing a corresponding preset action based on the video state machine; or when the preset interactive control point is matched and a timeline time point triggering condition or a logical condition of a variable in the video state machine is met, performing a corresponding preset action based on the video state machine.

2. The method of claim 1, wherein, The construction of the video state machine comprises: taking the physical video ID and the corresponding video segment in the video mapping as a state node, taking the variables as a state parameter, and taking a jump rule in the scene information as a state transition condition to construct the video state machine.

3. The method of claim 1, wherein, The matching of the preset interactive control point in the timeline comprises: after the physical video progress is mapped to the relative time point of the timeline, matching the preset interactive control point in the timeline based on a timestamp; or matching the interactive control point based on a current value of the variable and a variable logical condition in the condition.

4. The method of claim 1, wherein, The preset action comprises at least one of the following operations: a video control operation of controlling video playing, pausing, or jumping through the video state machine, a UI operation of updating a display state of an interface element, and a variable updating operation of modifying a variable value in the video state machine.

5. The method of claim 4, wherein, The UI operation of updating the display state of the interface element comprises: triggering a front-end rendering engine through the video state machine to update a display state, a position, a size, a transparency, or text content of an interface component.

6. The method of claim 1 to 5, wherein, The method further comprises: in response to a user input event, updating a variable value in the video state machine and triggering condition verification and action execution associated with the variable.

7. A player of an interactive video, characterized in that The method comprises: a loading and parsing module configured to load a main configuration file and parse the main configuration file to obtain video mapping, scene configuration file information, and metadata; wherein the video mapping is used to map a logical video ID to a physical video ID and a corresponding video segment; and the scene configuration file information is used to load a scene configuration file, parse the scene configuration file, and obtain scene information, a timeline, conditions, actions, and variables; a state machine engine configured to construct a video state machine based on the video mapping, the scene information, and the variables; a timeline synchronization module configured to start the timeline and combine the video state machine to obtain a physical video progress of current playing, which is mapped to a relative time point of the timeline; and a listening module configured to listen to whether a playing progress matches a preset interactive control point in the timeline. The listening module is configured to listen to whether the playing progress matches the preset interactive control point in the timeline. The interactive control module is configured to perform a preset action corresponding to the video state machine when the preset interactive control point is matched, or perform a preset action corresponding to the video state machine when the preset interactive control point is matched and a timeline time point trigger condition or a logic condition of a variable in the video state machine is satisfied.

8. An interactive video platform characterized by, The interactive video player comprises: The interactive video player according to claim 7; The content management system is configured to generate, store and manage a main configuration file and a scene configuration file of the interactive video. The data synchronization module is configured to synchronize user interaction data with a variable value in the video state machine.

9. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the steps of the interactive video playing method in any one of claims 1 to 6.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the steps of the interactive video playing method in any one of claims 1 to 6.