CN110611844B - Control method and device of player in application and video playing device - Google Patents

Control method and device of player in application and video playing device Download PDF

Info

Publication number
CN110611844B
CN110611844B CN201910995321.2A CN201910995321A CN110611844B CN 110611844 B CN110611844 B CN 110611844B CN 201910995321 A CN201910995321 A CN 201910995321A CN 110611844 B CN110611844 B CN 110611844B
Authority
CN
China
Prior art keywords
video
page
playing
player
singleton
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910995321.2A
Other languages
Chinese (zh)
Other versions
CN110611844A (en
Inventor
刘彦明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201910995321.2A priority Critical patent/CN110611844B/en
Publication of CN110611844A publication Critical patent/CN110611844A/en
Application granted granted Critical
Publication of CN110611844B publication Critical patent/CN110611844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/482End-user interface for program selection
    • H04N21/4826End-user interface for program selection using recommendation lists, e.g. of programs or channels sorted out according to their score

Abstract

The application provides a control method and device of a player in application and a video playing device, wherein the method comprises the following steps: creating a singleton player; acquiring a first video information entity of a target video in a first page, and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises first video basic information and first video playing configuration; and responding to the switching from the first page to a second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises second video basic information and second video playing configuration. According to the embodiment of the application, when the same player is used for playing the video content on different pages, the video playing under different video scenes can be realized.

Description

Control method and device of player in application and video playing device
Technical Field
The present application relates to the field of video processing technologies, and in particular, to a method and an apparatus for controlling a player in an application, and a video playing apparatus.
Background
Multimedia applications are generally run in the mobile terminal, and information flow detail pages, video recommendation pages and the like exist in the multimedia applications, and the pages all involve the playing of videos.
The multimedia application may use the same player to play video content on different pages, but at this time, different pages can only support the same video playing scene, for example, when playing a video on a small page window, if the page supports a mute playing scene, the switched page can only play the video in a mute manner, and the playing requirement of the user cannot be met.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for controlling a player in an application, and a video playing apparatus, which implement video playing in different video scenes when playing video content on different pages by using the same player.
In a first aspect, an embodiment of the present application provides a method for controlling a player in an application, including:
creating a singleton player;
acquiring a first video information entity of a target video in a first page, and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises first video basic information and first video playing configuration;
and responding to the switching from the first page to a second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises second video basic information and second video playing configuration.
In one embodiment, the first video base information is different from the second video base information, and/or the first video playback configuration is different from the second video playback configuration.
In one embodiment, the first video information entity further comprises a first abstract view callback layer, and the second video information entity further comprises a second abstract view callback layer;
the playing, by the singleton player, the target video based on the first video information entity includes:
calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration;
the playing, by the singleton player, the target video based on the second video information entity includes:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
In one embodiment, the method further comprises:
and responding to the switching from the first page to a second page, and caching the first video information entity.
Invoking the second abstract view callback layer to install the singleton player for the second page, comprising:
and when the second abstract view callback layer is called to install the singleton player, calling the first abstract view callback layer to uninstall the singleton player for the first page, and calling the second abstract view callback layer to install the singleton player for the second page.
In one embodiment, the method further comprises:
and responding to the second page to be switched back to the first page, acquiring a third video information entity of the target video in the first page, and playing the target video based on the third video information entity through the singleton player.
In a second aspect, an embodiment of the present application provides a control apparatus for a player in an application, where the apparatus includes:
the creating module is used for creating the singleton player;
the first processing module is used for acquiring a first video information entity of a target video in a first page and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises first video basic information and first video playing configuration;
and the second processing module is used for responding to the switching from the first page to the second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises second video basic information and second video playing configuration.
In a third aspect, an embodiment of the present application provides a video playing apparatus, which is applied to a terminal device, where a target application runs in the terminal device, and the target application supports different video playing functions on a first page and a second page, and includes:
the video information entity building module is used for responding to the switching of the target application from a first page for playing a target video to a second page and building a second video information entity of the target video in the second page; the second video information entity is different from a first video information entity of the target video played by the first page, and comprises second video basic information, second video playing configuration and a second abstract view callback layer;
and the global play management module is used for responding to a first video play instruction aiming at the target video, loading the second video information entity, calling an installation interface of the second abstract view callback layer, installing a singleton player for the second page, loading the second video basic information and the second video play configuration of the second video information entity to the singleton player, rendering the video by the singleton player based on the second video basic information and the second video play configuration, and responding to a user play control instruction by calling the callback interface of the second abstract view callback layer to refresh the video.
In one embodiment, the global play management module is further configured to:
responding to the switching of the target application from a first page for playing a target video to a second page, and caching a first video information entity of the target video in the first page; the first video information entity includes first video base information, a first playback configuration, and a first abstract view callback layer.
In an embodiment, when the installation interface of the second abstract view callback layer is called, and a singleton player is installed for the second page, the global play management module is configured to:
when the installation interface of the second abstract view callback layer is called to install the singleton player, if the singleton player is found to be occupied, the uninstallation interface of the first abstract view callback layer is called to uninstall the singleton player for the first page, and then the installation interface of the second abstract view callback layer is called to install the singleton player for the second page.
In an embodiment, the global playback management module is further configured to update the first playback configuration after unloading the singleton player for the first page.
In an embodiment, the callback interface includes a playback control interface, and the global playback management module, when responding to a user playback control instruction by calling the callback interface of the second abstract view callback layer to perform video refresh, is configured to:
and responding to a user playing control instruction of a playing control button acting on a user interaction interface UI layer, controlling the singleton player to execute a playing control action corresponding to the user playing control instruction in the target video rendering process, and driving the playing control button of the UI layer to present a playing control style corresponding to the user playing control instruction by calling a playing control interface of the second abstract view callback layer.
In one embodiment, the video information entity construction module is further configured to:
responding to the target application to return to the first page from a second page for playing the target video, acquiring the second video playing configuration from a second video information entity cached by the global playing management module, constructing a third playing configuration based on the second video playing configuration, and constructing a third video information entity of the target video in the first page; the third video information entity further comprises third video basic information and a third abstract view callback layer;
the global play management module is further configured to:
in response to the target application returning to the first page from a second page on which a target video is played, caching a second video information entity of the target video in the second page, and,
responding to a second video playing instruction aiming at the target video, loading the third video information entity, calling an installation interface of a third abstract view callback layer, installing a singleton player for the first page, loading third video basic information and third playing configuration of the third video information entity to the singleton player, performing video rendering by the singleton player based on the third video basic information and the third playing configuration, and responding to a user playing control instruction by calling the callback interface of the third abstract view callback layer to perform video refreshing.
In one embodiment, the second page is a video recommendation page in the target application; the video recommendation page displays a plurality of pieces of video information to be played;
the video information entity building module is further used for building a fourth video information entity of the first video in the video recommendation page when the fact that the current watching video recommended by the video recommendation page is switched from the target video to the first video is determined; the fourth video information entity comprises fourth video basic information, fourth playing configuration and a fourth abstract view callback layer;
the global play management module is further configured to, in response to a video play instruction for the first video, load a fourth video information entity, invoke an installation interface of the fourth abstract view callback layer, install a singleton player for the video recommendation page, load fourth video basic information and a fourth play configuration of the fourth video information entity to the singleton player, perform video rendering by the singleton player based on the fourth video basic information and the fourth play configuration, and respond to a user play control instruction by invoking a callback interface of the fourth abstract view callback layer to perform video refreshing.
In one embodiment, the global play management module is further configured to:
when it is determined that the current watching video recommended by the video recommendation page is switched from the target video to the first video, storing card information of the target video in a memory of the terminal equipment; the card information of the target video comprises video basic information and playing configuration of the target video.
In an embodiment, the video information entity constructing module is further configured to, when it is determined that the currently-viewed video recommended by the video recommendation page is switched from the first video to the target video, acquire video basic information of the target video from card information of the target video, use the acquired video basic information of the target video as fifth video basic information, acquire a playing configuration of the target video from the card information of the target video, use the acquired playing configuration of the target video as a fifth playing configuration, and construct a fifth video information entity, where the fifth video information entity further includes a fifth abstract view callback layer;
the global play management module is further configured to, in response to a third video play instruction for the target video, load a fifth video information entity, invoke an installation interface of the fifth abstract view callback layer, install a singleton player for the video recommendation page, load fifth video basic information and a fifth play configuration of the fifth video information entity to the singleton player, perform video rendering by the singleton player based on the fifth video basic information and the fifth play configuration, and respond to a user play control instruction by invoking a callback interface of the fifth abstract view callback layer to perform video refreshing.
In a fourth aspect, an embodiment of the present application provides a terminal device, including: the player control system comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the terminal device runs, the processor and the storage medium are communicated through the bus, and the processor executes the machine-readable instructions to execute the steps of the control method of the player in application.
In a fifth aspect, a computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method for controlling a player in an application as described above.
The control method for the player in application provided by the embodiment of the application comprises the steps of creating a single-case player, obtaining a first video information entity of a target video in a first page, playing the target video based on the first video information entity through the single-case player, responding to the switching from the first page to a second page, obtaining a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the single-case player, so that when the same player is used for playing video contents in different pages, the playing of videos in different video scenes is realized.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 shows a flow chart of a control method of a player in an application according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a user interaction interface layer implementing interaction provided by an embodiment of the present application;
FIG. 3a is a diagram illustrating a first operation of switching from a first page to a second page according to an embodiment of the present application;
FIG. 3b is a diagram illustrating a second operation of switching from a first page to a second page according to an embodiment of the present application;
FIG. 3c is a diagram illustrating a third operation of switching from the first page to the second page according to the embodiment of the present application;
fig. 4 shows a schematic structural diagram of a video playing apparatus provided in an embodiment of the present application;
fig. 5a shows a first schematic diagram of target video playing in a second page according to the embodiment of the present application;
fig. 5b is a second schematic diagram illustrating a target video playing in a second page according to the embodiment of the present application;
fig. 6 shows a schematic structural diagram of a control device of a player in an application according to an embodiment of the present application;
fig. 7 shows a schematic structural diagram of a terminal device provided in an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In the related art, if the same video is played on different pages, when the pages are switched, the same video can be played through different players of different pages, and when different pages use different players to play the video, the different players can increase the use of the memory in the application.
In order to reduce the occupation of the memory by the video playing, when the same video is played on different pages, a player is used for playing the video, in the related technology, generally, a container is used for bearing the player, when the pages are switched, the container in the previous page is temporarily moved out and stored, after the pages are switched to the next page, the container is embedded into the switched page, and the player is embedded into the container, so that a user cannot sense the change of the player and occupy a lot of memory, the video playing is smooth, however, the mode of moving out and embedding the container to play the same video on different pages has great limitation, namely, the page before switching does not support the progress dragging and volume setting, but the page after switching supports the progress dragging and volume setting, namely, the two pages before and after switching are different in the container layers of the video, then, at this time, the switched page cannot be played using the removed container in the previous page.
According to the control method of the player in the application, when the same player is used for playing the video content on different pages, the video playing under different video scenes is achieved, and meanwhile, the occupation of the video playing on the memory is reduced. Based on the purpose, the control method of the player in application provided by the application comprises the steps of creating a single-case player, obtaining a first video information entity of a target video in a first page, playing the target video based on the first video information entity through the single-case player, responding to the switching from the first page to a second page, obtaining a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the single-case player, so that when the same player is used for playing video contents in different pages, the playing of the videos in different video scenes is realized, and meanwhile, the occupation of the video playing on a memory is reduced.
The video playing device of the embodiment of the application can be applied to terminal equipment and can also be applied to any other computing equipment with a processing function. In some embodiments, the server or computing device may include a processor. The processor may process information and/or data related to the service request to perform one or more of the functions described herein. The idea of an embodiment of the present application is described in detail below.
An embodiment of the present application provides a method for controlling a player in an application, as shown in fig. 1, the method for controlling a player in an application is applied to a terminal Device, where the terminal Device may be, but is not limited to, any terminal Device capable of implementing the idea of the present application, such as a mobile terminal, a Personal Computer (PC), a tablet computer (PAD), and the like, and the method includes:
s101, creating a singleton player.
S102, a first video information entity of a target video in a first page is obtained, the target video is played through the singleton player based on the first video information entity, and the first video information entity comprises first video basic information and first video playing configuration.
S103, responding to the switching from the first page to a second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises second video basic information and second video playing configuration.
In S101, the singleton player may be stored in the terminal device in the form of a video playing plug-in, and when playing a video using the singleton player, the video playing plug-in needs to be installed on a different page (detailed below).
In S102, the first video basic information is generally attribute information of the target video in the first page, for example, the attribute information includes an identifier of the target video, a source link of the target video, cover information of the target video on the first page, a total duration of the target video, a width of the target video on the first page, and the like.
The configuration information of the first video playing configuration is configured to the configuration information of the target video played on the first page, the configuration information is set according to the preset video playing requirement in the first page, and the configuration information includes the update time of the target video, whether the target video is played in a mute mode or not, the playing progress of the last playing of the target video on the first page, the state of the video of the last playing of the target video on the first page, the cache state of the target video on the first page, whether the target video in the first page is played circularly or not, whether the target video in the first page is played seamlessly or not, and the like, wherein the playing progress of the last playing of the target video is the playing duration of the last playing of the target video, if the target video is played for the first time, the playing duration is 0, and the state of the video of the last playing of the video includes playing states (such as normal playing, double-speed playing, and the like), Pause state, etc., if the target video is played for the first time, the playing state is the normal playing state.
In S103, the second video basic information is generally attribute information of the target video in the second page, for example, the attribute information includes an identifier of the target video, a source link of the target video, cover information of the target video on the second page, a total duration of the target video, a width of the target video on the second page, and the like.
The second video playing configuration is configuration information for playing the target video on the second page, the configuration information is set according to the requirement for playing the video preset in the second page, and the configuration information comprises the update time of the target video, whether the target video is played in a mute mode or not, the playing progress when the target video is played in the first page, the state of the video when the target video is played in the first page, the cache state of the target video in the first page, whether the target video is played circularly in the second page, whether the target video is played seamlessly in the second page or not, and the like.
The first video information entity is different from the second video information entity, i.e. the first video base information is different from the second video base information, or the first video playing configuration is different from the second video playing configuration, or the first video base information is different from the second video base information, and the first video playing configuration is different from the second video playing configuration.
The first video information entity further comprises a first abstract view callback layer, the second video information entity further comprises a second abstract view callback layer, and the first abstract view callback layer and the second abstract view callback layer are located on different pages, and different pages need to call different interfaces to realize the playing of the video, so that the abstract view callback layers in different pages are different, namely the first abstract view callback layer is different from the second abstract view callback layer.
The first abstract view callback layer is a view layer constructed in the first page, the view layer defines various callback interfaces in the first page, the callback interfaces may include interfaces bound by singleton players, interfaces unbound by singleton players, interfaces for loading and unloading singleton players, interfaces for video playing states, current buffer information callback interfaces, and the like, and the callback interfaces may be opened according to actual conditions.
The following describes the interfaces included in the first abstract view callback layer in the first page:
the interface bound by the singleton player is an interface called after the singleton player is successfully installed in the abstract view callback layer; the interface for unbinding the singleton player is called after the singleton player is successfully uninstalled by the abstract view callback layer; the interface of the loading and unloading singleton player is used for installing and unloading the interface of the singleton player; the interface of the video playing state is used for informing the abstract view callback layer to adjust the page according to different states of the single-case player; the current buffer information callback interface is used for UI display of progress to inform the abstract view of how long the callback layer has been currently buffered, e.g., when viewing a video, the buffering will generally be faster than the current progress, and the view will appear as a gray bar.
The method includes the steps that a target video is played on a first page, a first video information entity of the target video is obtained, and the target video is played on the basis of the first video information entity through the singleton player, and the method specifically includes the following steps:
and calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration.
Referring to fig. 2, a global play manager acquires a video information entity in a current page through a unique entry, and for convenience of description, the video information entity in the current page is used as a target video information entity, and the target video information entity includes target video basic information, target video play configuration, and a target abstract view callback layer.
And defining a behavior interface of the singleton player and realizing a default singleton player, wherein the global play manager realizes the call of the interface of the abstract view callback layer through the behavior state of the singleton player.
When a global play manager calls an interface of a target abstract view callback layer, installs a singleton player for a current page, and finds that the singleton player is bound with an abstract view callback layer (the abstract view callback layer can be an abstract view callback layer of other videos in a first page or an abstract view callback layer in a last page), the global play manager takes the abstract view callback layer out of a cache and calls an uninstalling interface of the abstract view callback layer, triggers an unbounding interface of the abstract view callback layer to uninstall the singleton player, then calls an installing interface of the target abstract view callback layer of the current page, and triggers the binding interface of the target abstract view callback layer to install the singleton player.
When the target abstract view callback layer is called, if the singleton player is not bound with any abstract view callback layer, the installation interface of the target abstract view callback layer is directly called, and meanwhile, the binding interface of the target abstract view callback layer is triggered to complete installation of the singleton player. After installing the singleton player on the current page, the singleton player reads the target video basic information and the target video playing configuration from the target video information entity through default, refreshes the video based on the target video basic information and the target video playing configuration, and further, a global playing manager calls a callback interface of a target abstract view callback layer in the target video information entity to realize interaction through a UI layer in the page (the page is a page in the target application). The only entry is an interface for the global play management module to develop only one entity for loading video information, and is a virtual logic interface of a software layer.
When the target video is played on the first page, after a first video information entity of the target video in the first page is obtained, an installation interface of a first abstract view callback layer in the first video information entity is called, a singleton player is installed on the first page, and the installed singleton player realizes playing of the target video in the first page according to the first video basic information and the first video playing configuration.
And when the first page is switched to the second page, responding to the switching of the first page to the second page, and caching the first video information entity.
The following describes a process of playing a target video by switching a first page to a second page.
First, the switching of pages will be described by taking a target application as a multimedia application as an example.
As shown in fig. 3a to 3c, when the user views the target video at the first page, the user may click on a play area of the target video (refer to fig. 3a), switch from the first page to the second page, or click on a message display area in the message content containing the target video (refer to fig. 3b), switch from the first page to the second page, or click on a blank area in the area to which the message content containing the target video belongs (refer to fig. 3c), and switch from the first page to the second page.
When the first page is switched to the second page, caching a first video information entity of a target video in the first page, namely, responding to the switching from the first page to the second page, caching the first video information entity, and storing card information of the target video in a memory of the terminal equipment, wherein the card information of the target video comprises first video basic information and first video playing configuration of the target video.
For example, before the target application is switched from page 1 to page 2, where the target video a is played in page 1 for 10s, the global play management module caches a first video information entity of the video a in page 1, and the video play progress in the second video play configuration in the first video information entity is 10 s.
It should be noted here that, no matter the same video is played on different pages or different videos are played on the same page, when the global play manager plays the next video through a single-case player, only the video information entity of the last video that is played is cached, for example, when the video a is being played on the page 1, the video a continues to be played after the page 1 is switched to the page 2, when the page 1 is switched to the page 2, the video information entity of the video a in the page 1 is cached by the global play manager, when the video that is currently played is switched on the same page, the video information entity cached by the global play manager is the same as the situation of switching on different pages, and the following description does not take examples.
After switching to a second page, playing the target video based on the second video information entity through the singleton player, specifically including the following steps:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
Installing the singleton player for the second page after calling the second abstract view callback layer specifically comprises the following steps:
and when the second abstract view callback layer is called to install the singleton player, calling the first abstract view callback layer to uninstall the singleton player for the first page, and calling the second abstract view callback layer to install the singleton player for the second page.
When a target application is switched from a first page for playing a target video to a second page, firstly, a second video information entity is built for the target video in the second page, when the second video information entity is built, first video basic information is obtained from the cached first video information entity, second video basic information is generated based on the obtained first video basic information and the playing requirements (such as cover size, video size and the like) of the second page on the target video, further, first video playing configuration is obtained from the cached first video information entity, second video playing configuration in the second page is generated based on the first video playing configuration, a second abstract view callback layer is generated, and then the construction of the second video information entity is completed.
When the second video basic information and the second video playing configuration are generated, the video basic information of the target video may also be acquired from the card information of the target video stored in the memory, the second video basic information is generated based on the acquired frequency attribute information, further, the first video playing configuration is acquired from the card information of the target video stored in the memory, and the second video playing configuration in the second page is generated based on the first video playing configuration.
The second abstract view callback layer is a view layer constructed in the second page, the view layer defines various callback interfaces in the second page, the callback interfaces comprise an interface for binding a singleton player, an interface for unbinding the singleton player, an interface for loading and unloading the singleton player, an interface for playing a video, a click pause interface, a play interface, a first frame drawing callback interface, a current buffer information callback interface and the like, and the callback interfaces can be opened according to actual conditions.
The following describes the interfaces included in the second abstract view callback layer in the second page:
the functions of the interface bound by the singleton player, the interface unbound by the singleton player, the interface for loading and unloading the singleton player and the interface for the video playing state can refer to the interface in the first abstract view callback layer, and the click pause interface is used for responding to a click pause instruction to control the video to stop rendering; the playing interface responds to a click playing instruction to control the singleton player to continue video loading; the first frame drawing callback interface is used for informing the abstract view callback layer to inform the singleton player of finishing rendering the video, wherein the time is equivalent to the time when the video starts to be loaded and outputs contents and is commonly used for displaying some initialization information of the page, for example, the total time of the video needs to be displayed by the progress bar at the time.
The second abstract view callback layer also defines a callback interface for monitoring the state of the abstract view layer, wherein the callback interface comprises a pause video interface, a play video interface, a video dragging progress interface, an interface for entering and exiting a full-screen video play interface, an interface for judging whether to play the full-screen video or not, and the like.
The second abstract view callback layer also comprises interfaces for monitoring UI layer operation behavior, single-click event monitoring, double-click event monitoring, progress dragging monitoring, video length information obtaining, progress information playing, information whether a single-case player is ready or not and the like, wherein the interface for monitoring UI layer operation behavior realizes the monitoring of UI layer click behavior, whether the UI layer is visible or not, return key click, full screen entering and exiting; the single-click event monitoring interface is used for monitoring single-click events of the UI layer; the double-click event monitoring interface is used for monitoring double-click events of the UI layer; the progress dragging monitoring interface is used for monitoring a video progress dragging event of the UI layer; the interface for acquiring the video length information is used for acquiring the video length; the playing progress information interface is used for acquiring the video length; and acquiring whether the singleton player is ready information interface is used for acquiring whether the singleton player is accurately ready.
When the target video is played on the second page, the global playing manager acquires the second video information entity through the unique entrance, the global playing manager calls the installation interface of the second abstract view callback layer, and installs the singleton player for the switched page, the global playing manager finds that the singleton player is bound with the first abstract view callback layer when calling the installation interface of the second abstract view callback layer, at the moment, the global playing manager takes out the first abstract view callback layer from the cached first video information entity and calls the unloading interface of the first abstract view callback layer, when the uninstalling interface of the first abstract view callback layer is called, triggering the unbounding interface of the first abstract view callback layer to finish uninstalling the singleton player, and then calling an installation interface of the second abstract view callback layer, and triggering a binding interface of the second abstract view callback layer to finish the installation of the singleton player.
When the installation interface of the second abstract view callback layer is called, if the singleton player is determined not to be bound with any abstract view callback layer, the installation interface of the second abstract view callback layer is directly called, and meanwhile, the binding interface of the second abstract view callback layer is triggered to complete installation of the singleton player.
And after the singleton player is installed in the second page, the singleton player reads the second video basic information and the second video playing configuration from the second video information entity through default implementation, and refreshes the target video based on the second video basic information and the second video playing configuration.
And in the process that the user watches the target video on the second page, the user expects to return the first page to continue browsing information, namely, the user triggers a touch operation of returning the first page on the second page, responds to the switching of the second page back to the first page, acquires a third video information entity of the target video in the first page, and plays the target video based on the third video information entity through the single-case player.
The third video information entity comprises third video basic information, third video playing configuration and a third abstract view callback layer. The third video basic information is generally the same as the first video basic information, and the third abstract view callback layer is generally the same as the first abstract view callback layer, which is not repeated here.
The third video playing configuration includes configuration information when the target video is played again in the first page, and the attribute information may be update time of the target video, whether the target video is played in a mute manner, a playing progress when the target video is played in the second page, a state of the video when the target video is played in the second page, a cache state of the target video in the second page, whether the target video is played circularly, whether the target video is played seamlessly, and the like.
When the target application is switched back to the first page from the second page for playing the target video, firstly, a third video information entity is built for the target video in the first page, when the third video information entity is built, second video basic information is obtained from the cached second video information entity, second video basic information is generated according to the second video basic information and the playing requirement (such as cover size, video size and the like) of the first page to the target video, further, second video playing configuration is obtained from the cached second video information entity, the third video playing configuration in the first page is generated based on the second video playing configuration, a third abstract view callback layer is generated, and then the building of the third video information entity is completed.
When the third video basic information and the third video playing configuration are generated, the video basic information of the target video may also be acquired from the card information of the target video stored in the memory, the third video basic information is generated based on the acquired frequency attribute information, further, the second video playing configuration is acquired from the card information of the target video stored in the memory, and the third video playing configuration in the first page is generated based on the second video playing configuration.
Specifically, when the target video is played by returning to the first page, the global play manager acquires the third video information entity through the unique entry, the global play manager calls an interface of the third abstract view callback layer, and installs the singleton player for the switched page, and when the global play manager calls an installation interface of the third abstract view callback layer of the first page, the singleton player finds that the singleton player is already bound with the second abstract view callback layer, at this time, the global play manager will take out the second abstract view callback layer from the cached second video information entity and call an unloading interface thereof, when the unloading interface of the second abstract view callback layer is called, the unbinding interface of the second abstract view callback layer is triggered to finish unloading the singleton player, and then calling an installation interface of the third abstract view callback layer, and triggering a binding interface of the third abstract view callback layer to finish the installation of the singleton player.
When the installation interface of the third abstract view callback layer is called, if the singleton player is determined not to be bound with any abstract view callback layer, the installation interface of the third abstract view callback layer is directly called, and meanwhile, the binding interface of the third abstract view callback layer is triggered to complete installation of the singleton player.
After the singleton player is installed, the singleton player acquires third video basic information and third video playing configuration from a third video information entity through default implementation, and refreshes a target video in the first page based on the third video information entity and the third video playing configuration.
An embodiment of the present application provides a video playing apparatus, as shown in fig. 4, where the video playing apparatus is applied to a terminal Device, where the terminal Device is, but not limited to, any terminal Device that can implement the idea of the present application, such as a mobile terminal, a Personal Computer (PC), a tablet computer (PAD), and the like; the terminal equipment runs a target application, wherein the target application can be any application capable of implementing the idea of the invention, such as multimedia application, communication application and the like; the target application supports different video playing functions on a first page and a second page, wherein the video playing functions can be but are not limited to a video sound control function, a playing progress control function, a video playing control function and the like, for example, the first page does not support video playing progress adjustment, and the second page supports video playing progress adjustment; the video playing device comprises:
a video information entity constructing module 41, configured to respond to switching from a first page where a target video is played to a second page by the target application, and construct a second video information entity of the target video in the second page; the second video information entity is different from the first video information entity of the target video played on the first page, and the second video information entity comprises second video basic information, second video playing configuration and a second abstract view callback layer.
And the global play management module 42 is configured to respond to a first video play instruction for the target video, load the second video information entity, call an installation interface of the second abstract view callback layer, install a singleton player for the second page, load the second video basic information and the second video play configuration of the second video information entity to the singleton player, perform video rendering by the singleton player based on the second video basic information and the second video play configuration, and respond to a user play control instruction by calling a callback interface of the second abstract view callback layer to perform video refreshing.
The global play management module 42 is further configured to: responding to the switching of the target application from a first page for playing a target video to a second page, and caching a first video information entity of the target video in the first page; the first video information entity includes first video base information, a first playback configuration, and a first abstract view callback layer.
The first page and the second page can be an information flow recommendation page, an information detail page, a video recommendation page and the like in the target application, wherein the information flow recommendation page has other information contents besides the information contents including the target video, the information detail page has detailed information of the information contents including the target video, and the video recommendation page includes other videos pushed for the user besides the target video.
The second video information entity, the first video information entity, the third video information entity, the fourth video information entity and the fifth video information entity are stored in a memory of the terminal equipment in a form of a memory data structure, wherein in a page switching scene, the video entity related to the method can be constructed on a page before switching or a page after switching, and can be determined according to actual conditions; when the page is not switched but the video currently played in the page is switched, the video information entity related to the application can be constructed before the video is switched, or can be constructed when the video is switched to other videos, and can be determined according to actual conditions.
The specific contents of the first video information entity, the second video information entity and the third video information entity may refer to the method section, and are not described herein again.
The first video playing instruction, and a second video playing instruction and a third video playing instruction described below may be issued by the global playing management module 42, and are used to trigger the global playing management module 42 to load the response video information entity.
When a target application is switched from a first page for playing a target video to a second page, a video information entity building module 41 builds a second video information entity for the target video in the second page, when the second video information entity is built, the video information entity building module 41 obtains first video basic information from the cached first video information entity through a global play management module 42, generates second video basic information based on the first video basic information, further obtains first video play configuration from the cached first video information entity through the global play management module 42, generates second video play configuration in the second page based on the first video play configuration, generates a second abstract view callback layer based on a view layer pre-built in the second page, and completes the building of the second video information entity.
Or, the video information entity constructing module 41 obtains the video basic information of the target video from the card information of the target video stored in the memory through the global play management module 42, generates the second video basic information based on the obtained video attribute information, further obtains the video play configuration from the card information of the target video stored in the memory through the global play management module 42, generates the second video play configuration in the second page based on the video play configuration, generates the second abstract view callback layer based on the view layer pre-constructed on the second page, and completes the construction of the second video information entity.
After the video information entity constructing module 41 constructs the second video information entity, the global play management module 42 obtains the second video basic information and the second video play configuration in the second video information entity by receiving the unique entry of the video information entity, and invokes the installation interface of the second abstract view callback layer to install the singleton player for the second page. The global playing management module is preset with a unique entrance for loading the video information entity.
When the installation interface of the second abstract view callback layer is called to install the singleton player for the second page, if the singleton player is found to be occupied, the global play management module 42 calls the uninstallation interface of the first abstract view callback layer to uninstall the singleton player for the first page, and then installs the singleton player for the second page by calling the installation interface of the second abstract view callback layer.
When the target application is switched from the first page for playing the target video to the second page, the target video in the first page is played by using the singleton player in the background, so that the singleton player is occupied by the target video played in the first page, the global play management module 42 cannot install the singleton player by calling the installation interface of the second abstract view callback layer, and at this time, the global play management module 42 needs to call the uninstallation interface of the first abstract view callback layer in the cached first video information entity to uninstall the singleton player from the first page, so that the global play management module 42 installs the singleton player for the second page by calling the installation interface of the second abstract view callback layer. Therefore, in the page supporting different playing functions, the same video is played through a single-case player, and the occupation of the video playing on the memory is reduced.
During the period that the target video occupies the singleton player, the singleton player is also playing the target video, the video playing configuration (e.g., video playing progress) of the target video is changed accordingly, and after the singleton player is unloaded for the first page by the global playing management module 42, the first video playing configuration is updated, for example, information such as video playing progress in the first video playing configuration is updated.
After installing the singleton player for the second page, the global play management module 42 loads the second video basic information and the second video play configuration in the second video information entity into the singleton player, and the singleton player renders the target video by using the loading medium based on the loaded second video basic information and the loaded second video play configuration, so that the video content of the target video is presented in the second page, and in the process of playing the target video, the global play management module 42 responds to the user play control instruction by calling the callback interface of the second abstract view callback layer to implement the play control of the video.
In the process of playing the target video on the second page, the User realizes interaction with the target video through a User Interface (UI) layer presented in the second page, and the interaction realization process is as follows:
the global play management module 42 responds to the user play control instruction by calling the callback interface of the second abstract view callback layer, and controls the singleton player to execute the play control action corresponding to the user play control instruction in the target video rendering process by responding to the user play control instruction acting on the play control button of the UI layer when the video is refreshed, and drives the play control button of the UI layer to present the play control style corresponding to the user play control instruction by calling the play control interface of the second abstract view callback layer.
The UI layer is a view layer presented when the single-instance player plays a video, each page is pre-constructed with a view layer, the UI layer includes a play control button, the play control button is determined according to a play requirement of the page where the video is played when the UI layer is set, for example, the UI layer may include a video play button, a sound control button, a pause play button, a video play progress bar, and the like.
The user playing control instruction may include a pause playing instruction, a playing progress dragging instruction, a video playing instruction, a full screen entering instruction, a full screen exiting instruction, and the like, where different user playing control instructions correspond to different playing control actions and playing control styles.
When the user playing control instruction is a pause playing instruction, the playing control brake is used for stopping rendering, and the playing control style is a pause playing style; when the user playing control instruction is a video playing instruction, the playing control brake is used as a rendering starting action, and the playing control style is a video playing style; when the user playing control instruction is a playing progress dragging instruction, the playing control action is a video rendering progress control action, the playing control style is a video progress control style, different video progress dragging is carried out, and the progress bar displays different video playing progresses; when the user playing control instruction is an instruction for entering a full screen, the playing control instruction is used as a video continuous rendering action, the global playing management module adjusts the size of a container of a Surface layer (Surface layer, which belongs to a UI layer) rendered by the video to be a full screen size, and records the size of the container before entering the full screen, and the playing control style is a full screen playing style; when the user playing control instruction is a full screen quitting instruction, the playing control action is a continuous rendering action, the global playing management module adjusts the container of the Surface layer rendered by the video to the size of the container before the full screen, and the playing control style is a default playing style (a default video playing area in a video playing page plays the video).
In a specific implementation process, in the process that the singleton player plays the target video on the second page, after receiving the user play control instruction acting on the play control button of the UI layer, the global play management module 42 controls the loading medium in the singleton player to execute the play control action corresponding to the user play control instruction in the process of rendering the target video, and further, invokes the play control interface of the second abstract view callback layer to drive the play control button of the UI layer in the singleton player to present the play style corresponding to the user play control instruction, so that when the user views the target video on the second page, the play state presented on the second page by the target video corresponds to the user play control instruction.
Taking a target application as an example of a multimedia application, in a process (refer to fig. 5a) that a user views a target video in a second page, after the user clicks a play button of a UI layer, the global play management module 42 receives a play pause instruction acting on the play button, at this time, the singleton player executes a rendering stop action in the target video rendering process through a loading medium, after the singleton player stops rendering a video, the global play management module 42 calls a play pause interface of a second abstract view callback layer to drive the play button of the UI layer to be presented as a play pause style (refer to fig. 5b), at this time, the play state where the user views the video is a play pause state.
The following description is made for the case where the target video is played back from the second page to the first page and the case where the video is continuously viewed on the second page, respectively.
The first condition is as follows: when the user watches the target video on the second page, the user expects to return to the first page to continue browsing information, that is, the user triggers the touch operation of returning to the first page on the second page.
The global play management module 42 responds to the target application returning to the first page from the second page where the target video is played, and caches the second video information entity of the target video in the second page. At this time, the global play management module 42 removes the previously cached first video information entity and caches the second video information entity.
When the target application returns to the first page from the second page for playing the target video, the video information entity construction module 41 responds that the target application returns to the first page from the second page for playing the target video, acquires the second video playing configuration from the second video information entity cached by the global playing management module, constructs a third playing configuration based on the second video playing configuration, and constructs a third video information entity of the target video in the first page; the third video information entity further comprises third video base information, and a third abstract view callback layer.
The global play management module 42 loads the third video information entity in response to the second video play instruction for the target video, invokes an installation interface of the third abstract view callback layer, installs a singleton player for the first page, loads the third video basic information and the third video play configuration of the third video information entity to the singleton player, performs video rendering by the singleton player based on the third video basic information and the third video play configuration, and responds to a user play control instruction by invoking a callback interface of the third abstract view callback layer to perform video refresh.
The preset requirement for playing the video in the second page is the same as the preset requirement for playing the video in the first page, and the preset requirement for playing the video in the first page is different from the preset requirement for playing the video in the second page. The same points are that: the second page needs to be continuously played when the video is played, namely, the first page and the second page need to be continuously played when the video is played; the difference lies in that: the video sound can be adjusted when the video is played in the second page, and the second page is played in a mute mode. The examples herein are merely illustrative.
Therefore, when the target application returns to the first page from the second page where the target video is played, the video information entity construction module 41 instructs the global play management module 42 to obtain the second video basic information and the second video play configuration from the cached second video information entity, generate the third video basic information based on the second video basic information, and construct the third video play configuration in the third video entity of the target video in the first page based on the second video play configuration, such as information related to the video play progress, and use the view layer preset on the first page as the third abstract view callback layer, thereby completing the construction of the third video information entity.
After the third video information entity is constructed, the global play management module 42 loads the third video information entity in response to a second video play instruction for the target video, and when the installation interface of the third video view callback layer is called to install the singleton player for the first page, if the singleton player is found to be occupied, that is, the singleton player is occupied by the target video in the second page, the global play management module 42 calls the uninstallation interface of the second abstract view callback layer to uninstall the singleton player for the second page, and reinstalls the singleton player for the first page by calling the installation interface of the third abstract view callback layer. And updating the cached second video playing configuration when the singleton player is unloaded for the second page.
After the singleton player is reinstalled on the first page, the global play management module 42 loads the third video basic information and the third video play configuration in the third video information entity into the singleton player, the singleton player renders the target video by using the loading medium based on the loaded third video basic information and the loaded third video play configuration, so that the video content of the target video is presented in the first page, if the third video play configuration is provided with resume information, the video play progress of the target video in the second page is continued to be played in the first page, and the global play management module 42 responds to the user play control instruction by calling the callback interface of the second abstract view callback layer to realize the play control of the video. In the process of playing the target video in the first page, the interactive process realized through the UI layer when the target video is played in the first page is similar to the interactive process realized through the UI layer when the target video is played in the second page, and the similar parts are not repeated.
Case two: and when the second page is the video recommendation page, the user continues to browse other videos recommended by the video recommendation page after finishing watching the target video on the second page.
In the process of playing the video recommendation page, the global play management module 42 caches a second video information entity of the target video of the second page when it is determined that the currently viewed video recommended by the video recommendation page is switched from the first video to the target video in response to a pull-up sliding operation acting on the video recommendation page.
When determining that the currently viewed video recommended by the video recommendation page is switched from the target video to a first video, the video information entity construction module 41 constructs a fourth video information entity of the first video in the video recommendation page; the fourth video information entity includes fourth video base information, a fourth video playback configuration, and a fourth abstract view callback layer. Wherein the fourth video base information is obtained from a server of the target application.
After the fourth video information entity is constructed, the global play management module 42 loads the fourth video information entity in response to a video play instruction for the first video, invokes an installation interface of the fourth abstract view callback layer, installs a singleton player for the video recommendation page, loads the fourth video basic information and the fourth video play configuration of the fourth video information entity to the singleton player, performs video rendering by the singleton player based on the fourth video basic information and the fourth video play configuration, and responds to a user play control instruction by invoking the callback interface of the fourth abstract view callback layer to perform video refreshing.
Here, the fourth video basic information is generally attribute information of the first video in the second page, for example, the attribute information includes an identifier of the first video, a source link of the first video, cover page information of the first video on the second page, a total duration of the first video, a width of the first video on the second page, and the like.
The configuration information of the first video played and configured on the second page includes the update time of the first video, whether to play the first video in a mute manner, the playing progress of the first video played last time on the second page, the state of the video played last time on the second page, the cache state of the first video on the second page, whether to play the first video in the second page circularly, whether to play the first video seamlessly, and the like, wherein the playing progress of the first video played last time is the playing duration of the first video played last time, if the first video is played first time, the playing duration is 0, and the state of the video played last time includes the playing state (such as normal playing, double-speed playing, and the like), Pause state, etc., if the first video is played for the first time, the playing state is the normal playing state.
The fourth abstract view callback layer is a view layer constructed in the second page, the view layer defines various callback interfaces in the second page, the callback interfaces comprise an interface for binding a singleton player, an interface for unbinding the singleton player, an interface for loading and unloading the singleton player, an interface for playing a video, a click pause interface, a play interface, a first frame drawing callback interface, a current buffer information callback interface and the like, and the callback interfaces can be opened according to actual conditions. Wherein the definition of the interface can refer to the interface in the second abstract view callback layer.
In a specific implementation process, when the global play management module 42 loads the fourth video information entity and calls the installation interface of the fourth video view callback layer to install the singleton player, if the singleton player is found to be occupied, that is, the singleton player is occupied by the target video in the video recommendation page, the global play management module 42 calls the uninstallation interface of the second abstract view callback layer to uninstall the singleton player for the second page, and then calls the installation interface of the fourth abstract view callback layer to reinstall the singleton player for the second page. And updating the second video playing configuration in the cached second video information entity when the singleton player is unloaded for the second page.
The global play management module 42 loads fourth video basic information and fourth video play configuration in a fourth video information entity to a singleton player after installing the singleton player for a first video to be played on a video recommendation page, the singleton player renders a target video by using a loading medium based on the loaded fourth video basic information and the loaded fourth video play configuration, so that the video content of the first video is presented on the video recommendation page, and the global play management module 42 further responds to a user play control instruction by calling a callback interface of a second abstract view callback layer to realize play control of the first video. The process that the user interacts with the first video through the UI layer in the process of playing the first video is the same as the interaction process of the target video, and the process is not described too much here.
When the first video is determined to be switched from the first video to the target video through the pull-down sliding operation acting on the video recommendation page in the video recommendation page playing process of the first video, the global play management module 42 caches the fourth video information entity of the first video on the video recommendation page, and removes the second video information entity of the target video cached before.
Since the video recommendation page already plays the target video, card information of the target video is stored in a memory of the terminal device, and the card information includes video basic information of the target video and video playing configuration of the target video. Since the same video may be played for multiple times, each time the card information of the played video is stored in the memory, the video playing configuration in the card information is the video playing configuration when the video is currently played.
When it is determined that the currently viewed video recommended by the video recommendation page is switched from the first video to the target video, the video information entity building module 41 obtains video basic information of the target video from the card information of the target video, uses the obtained video basic information of the target video as fifth video basic information, obtains a video playing configuration (second video playing configuration) of the target video from the card information of the target video, uses the obtained video playing configuration of the target video as fifth video playing configuration, and builds a fifth video information entity of the target video in the video recommendation page, where the fifth video information entity further includes a fifth abstract view callback layer.
After the fifth video information entity is constructed, the global play management module 42 loads the fifth video information entity in response to a third video play instruction for the target video, invokes an installation interface of the fifth abstract view callback layer, installs a singleton player for the video recommendation page, loads the fifth video basic information and the fifth video play configuration of the fifth video information entity to the singleton player, performs video rendering by the singleton player based on the fifth video basic information and the fifth video play configuration, and responds to a user play control instruction by invoking the callback interface of the fifth abstract view callback layer to perform video refreshing.
Here, the fifth video basic information may be the same as the second video basic information, and the fifth abstract view playback layer may be the same as the second abstract view playback layer, and the same parts are not described again.
The fifth video playing configuration is configuration information for playing the target video on the second page, and the configuration information includes update time of the target video, whether to play the target video in a mute manner, a playing progress of the target video played last time on the second page, a state of the video when the target video is played last time on the second page, a cache state of the target video on the second page, whether to play the target video on the second page circularly, whether to play the target video on the second page seamlessly, and the like.
In a specific implementation process, when the global play management module 42 loads the fifth video information entity and calls the installation interface of the fifth video view callback layer to install the singleton player, if the singleton player is found to be occupied, that is, the singleton player is occupied by the first video in the video recommendation page, the global play management module 42 calls the uninstallation interface of the fourth abstract view callback layer to uninstall the singleton player for the video recommendation page, and then installs the singleton player for the target video to be played by the video recommendation page by calling the installation interface of the fifth abstract view callback layer. And updating the fourth video playing configuration in the cached fourth video information entity when the singleton player is unloaded for the video recommendation page.
The global play management module 42 loads the fifth video basic information and the fifth video play configuration in the fifth video information entity to the singleton player after reinstalling the singleton player for the target video to be played on the video recommendation page, the singleton player renders the target video by using a loading medium based on the loaded fifth video basic information and the loaded fifth video play configuration, so that the video content of the target video is presented on the video recommendation page, and the global play management module 42 further responds to the user play control instruction by calling a callback interface of the fifth abstract view callback layer to realize play control of the target video.
Considering that the playing requirement of the video recommendation page in the target application is to continue playing the video, that is, when the currently watched video of the video recommendation page is returned to the previously watched video from another video, the user needs to continue playing the previously watched video, therefore, when the currently watched video is switched from the first video to the target video, the video recommendation page generally continues the playing progress and playing state of the last target video to play the video, for example, the previously played video a has been played for 10 seconds, and after the other video is switched to the video a, the video a starts playing from the 10 th second; if the playing state of the previously played video A is the pause state, the playing state of the video A maintains the pause state when the video A is played; the process that the user interacts with the video through the UI layer in the process of playing the target video is not described too much here.
An embodiment of the present application provides a control apparatus for a player in an application, as shown in fig. 6, the apparatus includes:
a creating module 61, configured to create a singleton player;
a first processing module 62, configured to obtain a first video information entity of a target video in a first page, and play the target video based on the first video information entity through the singleton player, where the first video information entity includes first video basic information and a first video play configuration;
a second processing module 63, configured to respond to switching from the first page to a second page, obtain a second video information entity of the target video in the second page, and play the target video based on the second video information entity through the singleton player, where the second video information entity includes second video basic information and a second video playing configuration.
In one embodiment, the first video base information is different from the second video base information, and/or the first video playback configuration is different from the second video playback configuration.
In one embodiment, the first video information entity further comprises a first abstract view callback layer, and the second video information entity further comprises a second abstract view callback layer;
the first processing module 62 is specifically configured to:
calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration;
the second processing module 63 is specifically configured to:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
In one embodiment, the first processing module 62 is further configured to:
responding to the switching from the first page to a second page, and caching the first video information entity;
the second processing module 63 is further configured to:
and when the second abstract view callback layer is called to install the singleton player, calling the first abstract view callback layer to uninstall the singleton player for the first page, and calling the second abstract view callback layer to install the singleton player for the second page.
In one embodiment, the first processing module 62 is further configured to:
and responding to the second page to be switched back to the first page, acquiring a third video information entity of the target video in the first page, and playing the target video based on the third video information entity through the singleton player.
An embodiment of the present application further provides a terminal device, and as shown in fig. 7, a schematic structural diagram of the terminal device provided in the embodiment of the present application includes:
a processor 71, a memory 72, and a bus 73; the memory 72 is used for storing execution instructions and includes a memory 721 and an external memory 722; the memory 721 herein is also referred to as an internal memory, and is used for temporarily storing the operation data in the processor 71 and the data exchanged with the external memory 722 such as a hard disk, the processor 71 exchanges data with the external memory 722 through the memory 721, and when the terminal device operates, the processor 71 communicates with the memory 72 through the bus 73, so that the processor 71 executes the following instructions in a user mode:
creating a singleton player;
acquiring a first video information entity of a target video in a first page, and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises first video basic information and first video playing configuration;
and responding to the switching from the first page to a second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises second video basic information and second video playing configuration.
Wherein the first video basis information is different from the second video basis information and/or the first video playback configuration is different from the second video playback configuration; the first video information entity further comprises a first abstract view callback layer, and the second video information entity further comprises a second abstract view callback layer.
In a possible implementation, the instructions executed by processor 71 for playing the target video based on the first video information entity by the singleton player include:
calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration;
the playing, by the singleton player, the target video based on the second video information entity includes:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
In a possible implementation, in the instructions executed by the processor 71, the method further includes:
responding to the switching from the first page to a second page, and caching the first video information entity;
the invoking the second abstract view callback layer to install the singleton player for the second page includes:
and when the second abstract view callback layer is called to install the singleton player, calling the first abstract view callback layer to uninstall the singleton player for the first page, and calling the second abstract view callback layer to install the singleton player for the second page.
In a possible implementation, the instructions executed by the processor 71 further include:
and responding to the second page to be switched back to the first page, acquiring a third video information entity of the target video in the first page, and playing the target video based on the third video information entity through the singleton player.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the information playing control method in the foregoing method embodiment.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A control method of a player in an application is characterized by comprising the following steps:
creating a singleton player;
acquiring a first video information entity of a target video in a first page, and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises a first abstract view callback layer, first video basic information and first video playing configuration;
responding to the switching from the first page to a second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises a second abstract view callback layer, second video basic information and second video playing configuration; the second abstract view callback layer is different from the first abstract view callback layer;
wherein the playing the target video based on the first video information entity by the singleton player comprises:
calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration;
the playing, by the singleton player, the target video based on the second video information entity includes:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
2. The method of claim 1, wherein the first video basis information is different from the second video basis information, and/or wherein the first video playback configuration is different from the second video playback configuration.
3. The control method of claim 1, wherein the method further comprises:
responding to the switching from the first page to a second page, and caching the first video information entity;
the invoking the second abstract view callback layer to install the singleton player for the second page includes:
and when the second abstract view callback layer is called to install the singleton player, calling the first abstract view callback layer to uninstall the singleton player for the first page, and calling the second abstract view callback layer to install the singleton player for the second page.
4. The control method according to claim 1, further comprising:
and responding to the second page to be switched back to the first page, acquiring a third video information entity of the target video in the first page, and playing the target video based on the third video information entity through the singleton player.
5. A control device for a player in an application, the device comprising:
the creating module is used for creating the singleton player;
the first processing module is used for acquiring a first video information entity of a target video in a first page and playing the target video based on the first video information entity through the singleton player, wherein the first video information entity comprises a first abstract view callback layer, first video basic information and first video playing configuration;
the second processing module is used for responding to the switching from the first page to the second page, acquiring a second video information entity of the target video in the second page, and playing the target video based on the second video information entity through the singleton player, wherein the second video information entity comprises a second abstract view callback layer, second video basic information and second video playing configuration;
wherein, when the target video is played by the singleton player based on the first video information entity, the first processing module is specifically configured to:
calling the first abstract view callback layer to install the singleton player for the first page, and playing the target video on the first page based on the first video basic information and the first video playing configuration;
when the target video is played by the singleton player based on the second video information entity, the second processing module is specifically configured to:
and calling the second abstract view callback layer to install the singleton player for the second page, and playing the target video based on the second video basic information and the second video playing configuration.
6. A video playing device is applied to a terminal device, a target application runs in the terminal device, and the target application supports different video playing functions on a first page and a second page, and comprises:
the video information entity building module is used for responding to the switching of the target application from a first page for playing a target video to a second page and building a second video information entity of the target video in the second page; the second video information entity is different from a first video information entity of the target video played by the first page, and comprises second video basic information, second video playing configuration and a second abstract view callback layer;
and the global play management module is used for responding to a first video play instruction aiming at the target video, loading the second video information entity, calling an installation interface of the second abstract view callback layer, installing a singleton player for the second page, loading the second video basic information and the second video play configuration of the second video information entity to the singleton player, rendering the video by the singleton player based on the second video basic information and the second video play configuration, and responding to a user play control instruction by calling the callback interface of the second abstract view callback layer to refresh the video.
7. The video playback device of claim 6, wherein the global playback management module is further configured to:
responding to the switching of the target application from a first page for playing a target video to a second page, and caching a first video information entity of the target video in the first page; the first video information entity includes first video base information, a first playback configuration, and a first abstract view callback layer.
8. The video playback device of claim 7, wherein the global playback management module, when invoking the installation interface of the second abstract view callback layer to install a singleton player for the second page, is configured to:
when the installation interface of the second abstract view callback layer is called to install the singleton player, if the singleton player is found to be occupied, the uninstallation interface of the first abstract view callback layer is called to uninstall the singleton player for the first page, and then the installation interface of the second abstract view callback layer is called to install the singleton player for the second page.
9. The video playback device of claim 8, wherein the global playback management module is further configured to update the first video playback configuration after unloading the singleton player for the first page.
10. The video playback device of claim 6, wherein the callback interface comprises a playback control interface, and the global playback management module, when performing video refresh in response to a user playback control command by calling the callback interface of the second abstract view callback layer, is configured to:
and responding to a user playing control instruction of a playing control button acting on a user interaction interface UI layer, controlling the singleton player to execute a playing control action corresponding to the user playing control instruction in the target video rendering process, and driving the playing control button of the UI layer to present a playing control style corresponding to the user playing control instruction by calling a playing control interface of the second abstract view callback layer.
11. The video playback device of claim 6, wherein the video information entity construction module is further configured to:
responding to the target application to return to the first page from a second page for playing the target video, acquiring the second video playing configuration from a second video information entity cached by the global playing management module, constructing a third playing configuration based on the second video playing configuration, and constructing a third video information entity of the target video in the first page; the third video information entity further comprises third video basic information and a third abstract view callback layer;
the global play management module is further configured to:
in response to the target application returning to the first page from a second page on which a target video is played, caching a second video information entity of the target video in the second page, and,
responding to a second video playing instruction aiming at the target video, loading the third video information entity, calling an installation interface of a third abstract view callback layer, installing a singleton player for the first page, loading third video basic information and third video playing configuration of the third video information entity to the singleton player, performing video rendering by the singleton player based on the third video basic information and the third video playing configuration, and responding to a user playing control instruction by calling the callback interface of the third abstract view callback layer to perform video refreshing.
12. The video playback device of claim 6, wherein the second page is a video recommendation page in the target application; the video recommendation page displays a plurality of pieces of video information to be played;
the video information entity building module is further used for building a fourth video information entity of the first video in the video recommendation page when the fact that the current watching video recommended by the video recommendation page is switched from the target video to the first video is determined; the fourth video information entity comprises fourth video basic information, fourth video playing configuration and a fourth abstract view callback layer;
the global play management module is further configured to, in response to a video play instruction for the first video, load a fourth video information entity, call an installation interface of the fourth abstract view callback layer, install a singleton player for the video recommendation page, load fourth video basic information and a fourth video play configuration of the fourth video information entity to the singleton player, perform video rendering by the singleton player based on the fourth video basic information and the fourth video play configuration, and respond to a user play control instruction by calling a callback interface of the fourth abstract view callback layer to perform video refreshing.
13. The video playback device of claim 12, wherein the global playback management module is further configured to:
when it is determined that the current watching video recommended by the video recommendation page is switched from the target video to the first video, storing card information of the target video in a memory of the terminal equipment; the card information of the target video comprises video basic information and video playing configuration of the target video.
14. The video playing apparatus according to claim 13, wherein the video information entity constructing module is further configured to, when it is determined that the currently-viewed video recommended by the video recommendation page is switched from the first video to the target video, obtain video basic information of the target video from card information of the target video, use the obtained video basic information of the target video as fifth video basic information, obtain a playing configuration of the target video from the card information of the target video, use the obtained video playing configuration of the target video as fifth video playing configuration, and construct a fifth video information entity, where the fifth video information entity further includes a fifth abstract view callback layer;
the global play management module is further configured to respond to a third video play instruction for the target video, load a fifth video information entity, call an installation interface of the fifth abstract view callback layer, install a singleton player for the video recommendation page, load fifth video basic information and a fifth video play configuration of the fifth video information entity to the singleton player, perform video rendering by the singleton player based on the fifth video basic information and the fifth video play configuration, and respond to a user play control instruction by calling a callback interface of the fifth abstract view callback layer to perform video refreshing.
15. A terminal device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the terminal device is running, the processor executing the machine-readable instructions to perform the steps of the method for controlling a player in an application according to any one of claims 1 to 4.
16. A computer-readable storage medium, having stored thereon a computer program for performing, when being executed by a processor, the steps of the method for controlling a player in an application according to any one of claims 1 to 4.
CN201910995321.2A 2019-10-18 2019-10-18 Control method and device of player in application and video playing device Active CN110611844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910995321.2A CN110611844B (en) 2019-10-18 2019-10-18 Control method and device of player in application and video playing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910995321.2A CN110611844B (en) 2019-10-18 2019-10-18 Control method and device of player in application and video playing device

Publications (2)

Publication Number Publication Date
CN110611844A CN110611844A (en) 2019-12-24
CN110611844B true CN110611844B (en) 2021-12-28

Family

ID=68893095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910995321.2A Active CN110611844B (en) 2019-10-18 2019-10-18 Control method and device of player in application and video playing device

Country Status (1)

Country Link
CN (1) CN110611844B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111405354A (en) * 2020-03-10 2020-07-10 亦非云互联网技术(上海)有限公司 Optimization method and system for player channel switching, storage medium and player
CN111818371B (en) * 2020-07-17 2021-12-24 腾讯科技(深圳)有限公司 Interactive video management method and related device
CN112202751B (en) * 2020-09-25 2022-06-07 腾讯科技(深圳)有限公司 Animation processing method and device, electronic equipment and storage medium
CN114205675B (en) * 2021-12-06 2023-04-11 上海哔哩哔哩科技有限公司 Video previewing method and device
CN114501134B (en) * 2021-12-28 2022-11-18 广东南方新媒体科技有限公司 iOS cross-page video playing method, device, equipment and storage medium
CN115278339B (en) * 2022-08-02 2024-03-15 上海哔哩哔哩科技有限公司 Mixed broadcast processing method and system
CN115966119B (en) * 2022-12-28 2023-07-21 广州市昱德信息科技有限公司 VR technology-based simulated travel training method, system, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103096172A (en) * 2013-01-18 2013-05-08 深圳市龙视传媒有限公司 Method and device for displaying recommended programs
CN103702214A (en) * 2013-12-10 2014-04-02 乐视网信息技术(北京)股份有限公司 Video playing method and electronic equipment
CN109842818A (en) * 2019-01-02 2019-06-04 平安科技(深圳)有限公司 A kind of video broadcasting method, device, computer equipment and storage medium
CN110020323A (en) * 2018-07-27 2019-07-16 平安科技(深圳)有限公司 Mix page switching method, frame, computer equipment and the storage medium of application
CN110062284A (en) * 2019-04-03 2019-07-26 北京字节跳动网络技术有限公司 Video broadcasting method, device and electronic equipment
CN110149544A (en) * 2018-02-13 2019-08-20 阿里巴巴集团控股有限公司 The method, apparatus and storage medium of video playing
CN110300328A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 A kind of video playing control method, device and readable storage medium storing program for executing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101990035B1 (en) * 2012-10-31 2019-06-18 엘지전자 주식회사 Mobile terminal and control method for the mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103096172A (en) * 2013-01-18 2013-05-08 深圳市龙视传媒有限公司 Method and device for displaying recommended programs
CN103702214A (en) * 2013-12-10 2014-04-02 乐视网信息技术(北京)股份有限公司 Video playing method and electronic equipment
CN110149544A (en) * 2018-02-13 2019-08-20 阿里巴巴集团控股有限公司 The method, apparatus and storage medium of video playing
CN110300328A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 A kind of video playing control method, device and readable storage medium storing program for executing
CN110020323A (en) * 2018-07-27 2019-07-16 平安科技(深圳)有限公司 Mix page switching method, frame, computer equipment and the storage medium of application
CN109842818A (en) * 2019-01-02 2019-06-04 平安科技(深圳)有限公司 A kind of video broadcasting method, device, computer equipment and storage medium
CN110062284A (en) * 2019-04-03 2019-07-26 北京字节跳动网络技术有限公司 Video broadcasting method, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网络视频元数据提取与自适应播放方法研究;王雷钧;《中国优秀硕士学位论文全文数据库》;20130831;全文 *

Also Published As

Publication number Publication date
CN110611844A (en) 2019-12-24

Similar Documents

Publication Publication Date Title
CN110611844B (en) Control method and device of player in application and video playing device
US8448090B2 (en) Selective plug-in activation for resource-limited platforms
US8271579B2 (en) Server method and system for executing applications on a wireless device
WO2019080511A1 (en) Multi-task management method and terminal device
WO2018126957A1 (en) Method for displaying virtual reality screen and virtual reality device
US20110066495A1 (en) System and method for customizing ads in web and mobile applications
US20090251488A1 (en) Method and system for executing applications on a wireless device
KR20100086519A (en) Advanced advertisements
US20220245881A1 (en) Virtual scene display method and apparatus, and storage medium
US20190028768A1 (en) Display method and device for attached media information
US20120120098A9 (en) System for providing information concerning the effectiveness of advertising
CN110020300B (en) Browser page synthesis method and terminal
CN102981818A (en) Scenario based animation library
CN114610428B (en) Information stream display method, device, apparatus, storage medium, and program
JP5184268B2 (en) Information processing apparatus and program
CN103838538A (en) Method and device for controlling time length for activating backlight
WO2018113748A1 (en) Full screen implementation method for video, and electronic device
US8243079B2 (en) Aligning animation state update and frame composition
EP4227806A1 (en) Application keep-alive method and electronic device
CN112905096B (en) Display control method, device, terminal equipment and storage medium
CN112698884A (en) Program starting method, device, system, equipment and storage medium
CN109669764B (en) Processing method, apparatus, device and machine readable medium
US20130103907A1 (en) Memory management device, memory management method, control program, and recording medium
US11032586B2 (en) Techniques for dynamic digital advertising
CN117492893A (en) Method and device for realizing function of floating window and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant