CN109698979B - Video playing method and device and electronic equipment - Google Patents

Video playing method and device and electronic equipment Download PDF

Info

Publication number
CN109698979B
CN109698979B CN201811526946.6A CN201811526946A CN109698979B CN 109698979 B CN109698979 B CN 109698979B CN 201811526946 A CN201811526946 A CN 201811526946A CN 109698979 B CN109698979 B CN 109698979B
Authority
CN
China
Prior art keywords
video
player
page
switched
switching
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
CN201811526946.6A
Other languages
Chinese (zh)
Other versions
CN109698979A (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.)
Beijing iQiyi Science and Technology Co Ltd
Original Assignee
Beijing iQiyi Science and Technology 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 Beijing iQiyi Science and Technology Co Ltd filed Critical Beijing iQiyi Science and Technology Co Ltd
Priority to CN201811526946.6A priority Critical patent/CN109698979B/en
Publication of CN109698979A publication Critical patent/CN109698979A/en
Application granted granted Critical
Publication of CN109698979B publication Critical patent/CN109698979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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
    • H04N21/47202End-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 for requesting content on demand, e.g. video on demand
    • 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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44213Monitoring of end-user related data
    • H04N21/44222Analytics of user selections, e.g. selection of programs or purchase activity
    • 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
    • H04N21/47217End-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 for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Abstract

The embodiment of the invention provides a method, a device and electronic equipment for playing a video, which can pause the video in a current page being played in a player after receiving a switching operation on the current page, judge whether a video to be played exists in the switching page under the condition of keeping the background of the player running, serve as the switched video, close the player if the switched video does not exist in the switching page, and play the switched video by using the player after the current page is switched to the switching page if the switched video exists in the switching page, so that seamless switching of video playing after page switching is realized, and compared with the situation that the player is always kept running, the consumption of system resources is reduced.

Description

Video playing method and device and electronic equipment
Technical Field
The present invention relates to the field of video playing, and in particular, to a method and an apparatus for video playing, and an electronic device.
Background
At present, with the continuous development of internet video playing, internet video playing modes are becoming rich, and when a user browses internet videos, the user often needs to switch back and forth between different video pages, for example, when the user is interested in a currently watched video, the user can select to enter a page for introducing the video in detail to continue watching the video, or when the user is watching the video and is interested in other videos recommended in the current page, the user can select to directly jump to watch the recommended video.
In order to realize the above viewing of the video after page switching, in the prior art, there are two main implementation manners:
the first mode is as follows: when the page needs to be switched, the player in the original page is closed first, and after the original page is switched, the player is opened again, so that the video playing after the page is switched is realized.
The second mode is as follows: it is necessary to ensure that at least one player in the background is always running, and when the page switching is completed, the video playing after the page switching is realized based on the playing parameters of the original page.
The inventor finds that the prior art at least has the following problems in the process of implementing the invention:
the first method needs to restart the player after entering the switched page and waits for the player to play the video, the video playing switching time is long, seamless switching of video playing cannot be achieved, user experience is poor, and the second method can achieve seamless switching of video playing, but the player always keeps a running state no matter whether the switched page has the video needing to be played or not, and consumption of system resources is increased.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for playing a video, and an electronic device, so as to implement seamless switching of video playing when a page is switched, and reduce consumption of system resources compared with a case where a player is kept running all the time when there is no video to be played in a switched page. The specific technical scheme is as follows:
the invention provides a video playing method, which comprises the following steps:
after receiving a switching operation of a current page, pausing a video in the current page being played in a player;
under the condition of keeping the background of the player running, judging whether a video needing to be played exists in a switching page or not as a switched video;
if the switched video does not exist in the switching page, closing the player;
and if the switched video exists in the switching page, playing the switched video by using the player after the current page is switched to the switching page.
Further, before the step of determining whether a video to be played exists in a switching page as a switched video under the condition that the background of the player is kept running, the method further includes:
calling a function for executing the operation of closing the player after a preset time length;
if the switched video exists in the switching page, the method further comprises the following steps:
and canceling the function for executing the player closing operation, and executing the player closing operation after the player runs for a preset time.
Further, before the step of determining whether there is a video to be played in the switching page, the method further includes:
monitoring the running time of the player from the moment of pausing the player;
if the switched video does not exist in the switching page, the step of closing the player comprises the following steps:
if the switched video does not exist in the switching page and the monitored running time of the player is longer than the preset time, closing the player;
if the switched video needing to be played exists in the switching page, the method further comprises the following steps:
and canceling the monitoring of the running time of the player.
Further, the playing the switched video by using the player includes:
judging whether the video which is paused to be played is the same as the switched video;
if the video which is paused is the same as the switched video, continuing to play the video which is paused;
and if the video which is paused to be played is not the same as the switched video, playing the switched video by using the player.
Further, the determining whether the video paused to be played and the video after being switched are the same includes:
acquiring video information of a video which is paused by the player;
acquiring video information of the switched video in the switched page;
and comparing the video information of the video which is paused with the video information of the switched video, and judging whether the video which is paused is the same as the switched video.
An embodiment of the present invention further provides a device for playing a video, where the device includes:
the playing and pausing module is used for pausing the video in the current page which is being played in the player after receiving the switching operation of the current page;
the video judgment module is used for judging whether a video needing to be played exists in the switching page as a switched video under the condition of keeping the background of the player running;
a player closing module, configured to close the player if the switched video does not exist in the switching page;
and the video playing module is used for playing the switched video by using the player after the current page is switched to the switching page if the switched video exists in the switching page.
Further, before the video determining module, the method further includes:
the function calling module is used for calling a function for executing the operation of closing the player after a preset time length;
the video playing module is specifically configured to cancel the operation of closing the player after the function that executes the operation of closing the player runs for a preset time.
Further, before the video determining module, the method further includes:
the time length monitoring module is used for monitoring the running time length of the player from the moment of pausing the player;
the player closing module is specifically configured to close the player if the switched video does not exist in the switched page and the monitored running time of the player is longer than a preset time;
the video playing module is specifically configured to cancel monitoring of the running duration of the player.
Further, the video playing module is specifically configured to determine whether the video that is paused to be played is the same as the video that is switched; if the video which is paused is the same as the switched video, continuing to play the video which is paused; and if the video which is paused to be played is not the same as the switched video, playing the switched video by using the player.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any video playing method when executing the program stored in the memory.
The present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned video playing methods are implemented.
Embodiments of the present invention further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute any one of the above-mentioned video playing methods.
The method for playing the video provided by the embodiment of the invention can pause the video in the current page being played in the player after receiving the switching operation of the current page, judge whether the video to be played exists in the switching page as the switched video under the condition of keeping the background of the player running, close the player if the switched video does not exist in the switching page, and play the switched video by using the player after the current page is switched to the switching page if the switched video exists in the switching page, because the player which keeps running can directly play the video when the video to be played exists in the switched page, the seamless switching of the video playing after the page switching is realized, and compared with the method for keeping the player running, when the video to be played does not exist in the switched page all the time, the player is closed after running for a preset time, so that the consumption of system resources is reduced.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a method for playing a video according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for playing a video according to another embodiment of the present invention;
fig. 3 is a flowchart of a method for playing a video according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to provide a solution that can implement seamless switching of video playing after page switching and reduce system resource consumption when there is no video to be played in a switched page compared with a case where a player is always kept running, embodiments of the present invention provide a method, an apparatus, and an electronic device for video playing. And the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
In one embodiment of the present invention, a method for playing video is provided, as shown in fig. 1, the method includes the following steps:
s101: and after receiving the switching operation of the current page, pausing the video in the current page playing in the player.
In this step, when the user is interested in a certain video played in the current page, the user may select to enter a page that introduces the video in detail to continue to watch the video, or when the user is watching the video and is interested in other videos recommended in the current page, the user may select to directly skip to watch the recommended video, and when the video is played in the current displayed page, the user may pause to play the video played in the current displayed page after receiving a switching operation on the current displayed page, preferentially, where the switching operation may be any one of ways that can perform human-computer interaction, for example, the switching operation may be a click operation or a key operation, and embodiments of the present invention are not limited specifically herein.
S102: and under the condition of keeping the background of the player running, judging whether the video needing to be played exists in the switching page as the switched video.
In this step, under the condition that the player for playing the video before switching is running, after the switched page data is obtained, whether the switched video data to be played exists in the switched page is judged, preferably, whether the video to be played exists in the switched page is judged by directly obtaining parameters in the switched page, and whether the video to be played exists in the switched page or not is also judged by directly analyzing the switched page data to determine whether the video data to be played exists in the switched page or determine whether the address link of the video to be played exists in the switched page.
S103: and if the switched video does not exist in the switching page, closing the player.
In this step, when it is determined in step S102 that there is no switched video to be played in the switched page, the player for playing the video before switching is turned off.
S104: and if the switched video exists in the switching page, playing the switched video by using the player after the current page is switched to the switching page.
In this step, when it is determined in step S102 that there is a switched video to be played in the switched page, the switched video to be played in the switched page is played using the player that is always running and is used to play the video before switching.
The method for playing the video provided by the embodiment of the invention can pause playing the video before switching played in the currently displayed page after receiving the switching operation of the currently displayed page, and under the condition that the player for playing the video before switching is kept running, judge whether the video to be played exists in the page to be switched to be used as the video after switching, if the video to be played does not exist in the page to be switched, close the player, and if the video to be played exists in the page to be switched, play the video after switching the page to be switched by using the player, because when the video to be played exists in the page after switching, the player kept running can directly play the video, thereby realizing the seamless switching of the video after switching the page, compared with the method of always keeping the player running, when the switched page does not have the video needing to be played, the player is closed after running for a preset time, and consumption of system resources is reduced.
In another embodiment of the present invention, there is also provided a method for playing a video, as shown in fig. 2, the method including the steps of:
s201: and after receiving the switching operation of the current page, pausing the video in the current page playing in the player.
In this step, the method may be specifically performed in the manner described in step S101, and will not be described in detail here.
S202: and calling a function for executing the operation of closing the player after a preset time length.
In this step, for different operating systems, different functions may be called to implement closing the player operation after a preset time duration, preferably, when the operating system is iOS, the player operation may be closed by delayed execution through a performSelector method, or the player operation may be closed by delayed execution through an NSTimer timer method, or the player operation may be closed by delayed execution through GCD (Grand Central Dispatch, multithreading optimization technology).
In one embodiment, when the operating system is an Android system, the player closing operation can be delayed by calling a new Thread () or a new TimerTask () function, or can be delayed by postDelayed by a Handler.
S203: and under the condition of keeping the background of the player running, judging whether the video needing to be played exists in the switching page as the switched video.
In this step, the method may be specifically performed in the manner described in step S102, and will not be described in detail here.
S204: and if the switched video does not exist in the switching page, closing the player.
In this step, if it is determined that there is no switched video in the switched page, after the player runs for the preset duration, the function called in step S202 executes the operation of closing the player, and closes the player.
S205: and if the switched video exists in the switching page, canceling the function for executing the player closing operation, and executing the player closing operation after the player runs for a preset time length.
In this step, preferentially, when the operating system is iOS and the performance of the operation of closing the player is performed with a delay by the performSelector method, the operation of closing the player may be performed after the player runs for a preset time by canceling the function of performing the operation of closing the player with an NSObject, when the operation of closing the player is performed with a delay by the method of using an nstometer, the operation of closing the player may be canceled by calling a (void) update of the nstometer, and when the operation of closing the player is performed with a delay by the GCD, the operation of closing the player may be canceled by a dispatch _ block _ cancel (task).
S206: and after the current page is switched to the switching page, playing the switched video by using the player.
In this step, since the video to be played in the switched page may need to be played on the basis of the video played in the page before switching, the video before switching may be played continuously, and the video after switching may also be a new video, it may be preferentially determined whether the video before switching and the video after switching are the same, specifically, whether the video before switching and the video after switching that are retained in the player are the same may be obtained, and the video information after switching of the video after switching in the switched page may be obtained, and the video information before switching and the video information after switching may be compared to determine whether the video before switching and the video after switching are the same, specifically, the video information mentioned above may be a video ID, and if the video before switching and the video after switching are the same, the playing progress of the video before switching when the playing is suspended may be obtained, and the video before switching may be played continuously by using the player according to the playing progress, and if the video before switching is different from the video after switching, playing the video after switching by using the player.
After receiving the switching operation of the current page, pausing the video in the current page being played in the player, calling a function for executing the operation of closing the player after a preset time, under the condition of keeping the background of the player running, judging whether the video needing to be played exists in the switching page as the switched video, if the switched video does not exist in the switching page, closing the player, if the switched video exists in the switching page, canceling the function for executing the operation of closing the player, executing the operation of closing the player after the player runs for the preset time, and after the current page is switched to the switching page, playing the switched video by using the player, wherein the player keeping running can directly play the video when the video needing to be played exists in the switched page, so that the page switching is realized, compared with the method of always keeping the player running, when the switched page has no video needing to be played, the player is closed after running for a preset time, and consumption of system resources is reduced.
In another embodiment of the present invention, there is also provided a method for playing a video, as shown in fig. 3, the method including the steps of:
s301: and after receiving the switching operation of the current page, pausing the video in the current page playing in the player.
In this step, the method may be specifically performed in the manner described in step S101, and will not be described in detail here.
S302: the running time of the player is monitored from the moment the player is paused.
In this step, the running time of the player may be monitored by calling an API (Application Programming Interface), for example, a Sleep () function in a standard library may be called, the preset time of Sleep (6 × 100) is 0.6s, after the player runs for 0.6s, the operation of closing the player is executed when the running time of the monitored player is not cancelled, and it needs to be specially noted that the preset time should be much longer than the time required for completing the entire page switching.
S303: and under the condition of keeping the background of the player running, judging whether the video needing to be played exists in the switching page as the switched video.
In this step, the method may be specifically performed in the manner described in step S102, and will not be described in detail here.
S304: and if the switched videos do not exist in the switching page and the running time of the monitored player is longer than the preset time, closing the player.
In this step, after it is determined that there is no switched video to be played in the page to be switched, the player may be closed after the player runs for a preset duration, preferentially, the player may be closed by calling an API or by using a delay function, for example, when a Sleep () function in the standard library is called in step S302, preferentially, the preset duration has been set, and after the preset duration has been determined, the player may be selected to be closed when there is no switched video to be played in the page to be switched, so in this step, when it is determined that there is no switched video to be played in the page to be switched, the player may be selected to be closed after the preset duration by using the delay function according to the set delay logic.
S305: and if the switched video needing to be played exists in the page to be switched, canceling the monitoring player.
In this step, after the switched video to be played exists in the page to be switched, monitoring of the player can be cancelled, specifically, when the monitoring function is used to monitor the running duration of the player, monitoring of the running duration of the player by the monitoring function is cancelled, preferentially, when the operation of closing the player is executed after the monitoring function is set to run for the preset duration, the operation of closing the player after running for the preset duration is also cancelled, so that the player is kept running, and the switched video can be played later.
S306: and if the switched video exists in the switching page, playing the switched video by using the player after the current page is switched to the switching page.
In this step, the method described in step S206 may be specifically adopted, and will not be described in detail here.
The method for playing the video provided by the embodiment of the present invention may pause the video in the current page being played in the player after receiving the switching operation on the current page, and monitor the running time of the player from the moment when the player is paused, and under the condition that the background of the player is kept running, judge whether the video to be played exists in the switched page as the video after switching, and if the video after switching does not exist in the switched page and the running time of the player obtained by monitoring is greater than the preset time, close the player, and if the video after switching needs to be played exists in the page to be switched, cancel the monitoring of the player, and if the video after switching exists in the switched page, use the player to play the video after switching the current page to the switched page, because when the video to be played exists in the switched page, the player which keeps running can directly play the video, seamless switching of video playing is realized after page switching, and compared with the method of always keeping the player running, the method for monitoring the running time of the player is adopted, when the video which needs to be played does not exist in the switched page, the player is closed after running for the preset time, and the consumption of system resources is reduced.
Based on the same inventive concept, according to the method for playing video provided by the embodiment of the present invention, the embodiment of the present invention further provides a device for playing video, as shown in fig. 3, the device includes:
the play and pause module 401 is configured to pause the video in the current page being played in the player after receiving the switching operation on the current page.
The video determining module 402 is configured to determine whether a video to be played exists in the switching page as the switched video under the condition that the background of the player is kept running.
A player closing module 403, configured to close the player if there is no switched video in the switching page.
The video playing module 404 is configured to play the switched video by using a player after the current page is switched to the switching page if the switched video exists in the switching page.
Further, before the video determining module 402, the method further includes:
a function calling module 405, configured to call a function for executing a player shutdown operation after a preset time duration
The video playing module 404 is specifically configured to cancel the function that executes the operation of closing the player, and execute the operation of closing the player after the player runs for the preset time duration.
Further, before the video determining module 402, the method further includes:
a duration monitoring module 406, configured to monitor the running duration of the player from the moment of pausing the player;
a player closing module 403, configured to close the player if there is no switched video in the switched page and the running time of the player obtained through monitoring is greater than a preset time;
the video playing module 404 is specifically configured to cancel monitoring of the running time of the player.
Further, the video playing module 404 is specifically configured to determine whether the video that is paused is the same as the video that is switched, continue to play the video that is paused if the video that is paused is the same as the video that is switched, and play the video that is switched using the player if the video that is paused is not the same as the video that is switched.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
after receiving the switching operation of the current page, pausing the video in the current page being played in the player;
under the condition of keeping the background of the player running, judging whether a video needing to be played exists in a switching page or not as a switched video;
if the switched video does not exist in the switching page, closing the player;
and if the switched video exists in the switching page, playing the switched video by using the player after the current page is switched to the switching page.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned video playing methods.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the above-described methods for video playback.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (7)

1. A method of video playback, the method comprising:
after receiving a switching operation of a current page, pausing a video in the current page being played in a player;
under the condition that the background of the player is kept running, judging whether a video needing to be played exists in a switching page or not, wherein the video is used as a switched video, and the switched video and the video in the current page are different videos;
if the switched video does not exist in the switching page, closing the player after the player runs for a preset time length;
and if the switched video exists in the switching page, playing the switched video by using the player after the current page is switched to the switching page.
2. The method according to claim 1, wherein before the step of determining whether there is a video to be played in the switching page as the switched video while keeping the player running in the background, the method further comprises:
calling a function for executing the operation of closing the player after a preset time length;
if the switched video exists in the switching page, the method further comprises the following steps:
and canceling the function to execute the operation of closing the player after the player runs for a preset time.
3. The method according to claim 1, wherein before the step of determining whether there is a video to be played in the switching page, the method further comprises:
monitoring the running time of the player from the moment of pausing the player;
if the switched video does not exist in the switching page, the step of closing the player comprises the following steps:
if the switched video does not exist in the switching page and the monitored running time of the player is longer than the preset time, closing the player;
if the switched video needing to be played exists in the switching page, the method further comprises the following steps:
and canceling the monitoring of the running time of the player.
4. An apparatus for video playback, the apparatus comprising:
the playing and pausing module is used for pausing the video in the current page which is being played in the player after receiving the switching operation of the current page;
the video judgment module is used for judging whether a video needing to be played exists in a switching page as a switched video under the condition that the background of the player is kept running, wherein the switched video and the video in the current page are different videos;
a player closing module, configured to close the player after the player runs for a preset duration if the switched video does not exist in the switching page;
and the video playing module is used for playing the switched video by using the player after the current page is switched to the switching page if the switched video exists in the switching page.
5. The apparatus of claim 4, further comprising:
the function calling module is used for calling a function for executing the operation of closing the player after a preset time length;
the video playing module is further configured to: and if the switched video exists in the switching page, canceling the operation of closing the player after the function runs for a preset time length.
6. The apparatus of claim 4, further comprising:
the time length monitoring module is used for monitoring the running time length of the player from the moment of pausing the player;
the player closing module is further configured to close the player if the switched video does not exist in the switched page and the monitored running time of the player is longer than a preset time;
the video playing module is further configured to cancel monitoring of the running duration of the player if the switched video that needs to be played exists in the switching page.
7. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any one of claims 1 to 3 when executing a program stored in the memory.
CN201811526946.6A 2018-12-13 2018-12-13 Video playing method and device and electronic equipment Active CN109698979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811526946.6A CN109698979B (en) 2018-12-13 2018-12-13 Video playing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811526946.6A CN109698979B (en) 2018-12-13 2018-12-13 Video playing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109698979A CN109698979A (en) 2019-04-30
CN109698979B true CN109698979B (en) 2022-04-22

Family

ID=66231657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811526946.6A Active CN109698979B (en) 2018-12-13 2018-12-13 Video playing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109698979B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110087115A (en) * 2019-05-27 2019-08-02 北京奇艺世纪科技有限公司 A kind of video player control method, device and relevant device
CN110162394A (en) * 2019-05-31 2019-08-23 北京字节跳动网络技术有限公司 Playback method, device, electronic equipment and the storage medium of media object

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197393A (en) * 2017-06-16 2017-09-22 广州荔枝网络有限公司 A kind of implementation method of singleton video player
CN108449638A (en) * 2018-03-15 2018-08-24 广州虎牙信息科技有限公司 A kind of method, apparatus and electronic equipment playing advertisement

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040041835A1 (en) * 2002-09-03 2004-03-04 Qiu-Jiang Lu Novel web site player and recorder
EP2224351A1 (en) * 2009-02-26 2010-09-01 Telefonaktiebolaget L M Ericsson (publ) method for use in association with a multi-tab interpretation and rendering function
US9535653B2 (en) * 2012-08-31 2017-01-03 Google Inc. Adjusting audio volume of multimedia when switching between multiple multimedia content
CN103686410A (en) * 2013-12-10 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and terminal for video playing
CN105554575B (en) * 2015-12-11 2019-12-03 北京元心科技有限公司 The method and device that media play function is handled in multisystem
CN107943875A (en) * 2017-11-13 2018-04-20 暴风集团股份有限公司 The control method of browser kernel, device and terminal in player application
CN107943400B (en) * 2017-11-30 2021-05-21 努比亚技术有限公司 Double-sided screen switching method, mobile terminal and readable storage medium
CN108536512B (en) * 2018-04-17 2021-03-26 Oppo广东移动通信有限公司 Interface switching method and device and terminal equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197393A (en) * 2017-06-16 2017-09-22 广州荔枝网络有限公司 A kind of implementation method of singleton video player
CN108449638A (en) * 2018-03-15 2018-08-24 广州虎牙信息科技有限公司 A kind of method, apparatus and electronic equipment playing advertisement

Also Published As

Publication number Publication date
CN109698979A (en) 2019-04-30

Similar Documents

Publication Publication Date Title
EP3215938B1 (en) System and method for fast starting an application
KR102191318B1 (en) Activity continuation between electronic devices
CN109698979B (en) Video playing method and device and electronic equipment
US9236088B2 (en) Application communication
CN108966016B (en) Video clip rebroadcasting method and device and terminal equipment
WO2017181598A1 (en) Method and device for playing video
US20180082340A1 (en) Pausing an advertisement
WO2017113708A1 (en) Video playback method and device
CN104066011A (en) Control method of interface switching of intelligent TV and control device thereof
WO2017219872A1 (en) Set top box upgrading and channel changing methods and systems
CN111447239A (en) Video stream playing control method, device and storage medium
US9965295B2 (en) Creating a custom series of commands
WO2017032237A1 (en) Method and device for refreshing playlist
US10802847B1 (en) System and method for reproducing and resolving application errors
US10180894B2 (en) Identifying a stack frame responsible for resource usage
US9288125B2 (en) Application control of embedded web content execution
CN111372115B (en) Application program access method and device and communication system
CN108650544B (en) Media playing method, device and system
CN110825456A (en) Loading time calculation method and device, computer equipment and storage medium
CN107682733B (en) Control method and system for improving user experience of watching video
CN110933508B (en) Video playing method and device and electronic equipment
CN109729419B (en) Push video preloading method and device, electronic equipment and storage medium
US20170034301A1 (en) Caching streaming media to user devices
CN111666136A (en) Thread processing method and device, electronic equipment and storage medium
CN110971960B (en) Video processing method and device, electronic equipment and storage medium

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