CN111510784A - Video switching method and device, storage medium and terminal - Google Patents

Video switching method and device, storage medium and terminal Download PDF

Info

Publication number
CN111510784A
CN111510784A CN202010208217.7A CN202010208217A CN111510784A CN 111510784 A CN111510784 A CN 111510784A CN 202010208217 A CN202010208217 A CN 202010208217A CN 111510784 A CN111510784 A CN 111510784A
Authority
CN
China
Prior art keywords
video
key
terminal
switching
playing
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.)
Pending
Application number
CN202010208217.7A
Other languages
Chinese (zh)
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.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN202010208217.7A priority Critical patent/CN111510784A/en
Publication of CN111510784A publication Critical patent/CN111510784A/en
Pending legal-status Critical Current

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/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/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

Abstract

The embodiment of the application discloses a video switching method, a video switching device, a storage medium and a terminal, and belongs to the technical field of computers. The method comprises the following steps: when the terminal is in a state of playing the current video, monitoring a key event from the earphone, when the key event is monitored, analyzing the key event to obtain a key identifier and a pressing frequency, identifying the key identifier and the pressing frequency to obtain a control instruction, and when the control instruction is a switching instruction, selecting a target video from a video set and switching the current video into the target video. Through the mode, the user can control the keys on the earphone connected with the terminal, so that the switching of videos in the terminal is controlled, convenience is provided for the user to switch the videos, and the user experience is improved.

Description

Video switching method and device, storage medium and terminal
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for switching videos, a storage medium, and a terminal.
Background
Along with the development of intelligent terminals, intelligent terminals have gradually become necessary articles for daily life of people, and earphones serving as important accessories of the intelligent terminals are widely used by people. In some special occasions, the earphone can bring more convenience to the user, so that the user can not disturb others when listening to the sound emitted by the terminal. In the related art, a user can watch videos in a terminal by using an earphone in an auxiliary mode, and when the user wants to switch the videos, the user needs to click a display screen of the terminal and then switch the videos, so that the user is very inconvenient to switch the videos.
Disclosure of Invention
The embodiment of the application provides a video switching method, a video switching device, a storage medium and a terminal, and can solve the problem that video switching is inconvenient when a user watches videos through earphones. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a video switching method, where the method includes:
monitoring a key event from an earphone when the terminal is in a current video playing state;
when the key event is monitored, analyzing the key event to obtain a key identifier and the number of pressing times, and identifying the key identifier and the number of pressing times to obtain a control instruction;
when the control instruction is a switching instruction, selecting a target video from a video set; wherein the video set comprises the current video and the video set comprises at least one video;
and switching the current video into the target video.
In a second aspect, an embodiment of the present application provides a video switching apparatus, where the apparatus includes:
the monitoring module is used for monitoring a key event from the earphone when the terminal is in a current video playing state;
the processing module is used for analyzing the key event to obtain a key identifier and the pressing times and identifying the key identifier and the pressing times to obtain a control instruction when the key event is monitored;
the selection module is used for selecting a target video from a video set when the control instruction is a switching instruction; wherein the video set comprises the current video and the video set comprises at least one video;
and the switching module is used for switching the current video into the target video.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides a terminal, including: the system comprises a processor, a memory and a display screen; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
when the scheme of the embodiment of the application is executed, when the terminal is in a state of playing the current video, the key event from the earphone is monitored, when the key event is monitored, the key event is analyzed to obtain the key identifier and the pressing times, the key identifier and the pressing times are identified to obtain the control command, when the control command is the switching command, the target video is selected from the video set, and the current video is switched to the target video. Through the mode, the user can control the keys on the earphone connected with the terminal, so that the switching of videos in the terminal is controlled, convenience is provided for the user to switch the videos, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application 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, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;
FIG. 3 is an architectural diagram of the android operating system of FIG. 1;
FIG. 4 is an architecture diagram of the IOS operating system of FIG. 1;
fig. 5 is a schematic flowchart of a video switching method according to an embodiment of the present application;
fig. 6 is another schematic flowchart of a video switching method according to an embodiment of the present application;
fig. 7 is another schematic flowchart of a video switching method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a video switching apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
The processor 110 may include one or more processing cores, the processor 110 may connect various parts within the entire terminal using various interfaces and lines, perform various functions of the terminal and process data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and call data stored in the memory 120. alternatively, the processor 110 may be implemented in at least one hardware form of a DSP (digital signal processing), an FPGA (field-programmable gate array), a P L a (programmable logic array), and the like, the processor 110 may integrate a CPU (central processing unit), a GPU (graphic processing unit), a modem, and the like, wherein the CPU mainly processes an operating system, a user interface, and an application program, etc., the GPU is responsible for rendering and rendering contents, and the modem may be used for processing wireless communication, and the wireless communication may be implemented by integrating the above-described communication chip 110.
The Memory 120 may include a RAM (random access Memory) and a ROM (read-only Memory). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The storage data area may also store data created by the terminal in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 2, the memory 120 may be divided into an operating system space, in which an operating system runs, and a user space, in which native and third-party applications run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.
In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
For example, the operating system is an Android system, programs and data stored in the memory 120 are as shown in fig. 3, the memory 120 may store L inux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application framework layer 380, wherein the L inux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space, L inux kernel layer 320 provides underlying drivers for various hardware of the terminal, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, power management and the like, the system runtime library layer 340 provides main feature support for the system through C/C + + libraries, for example, the L ite library provides support for an Android database, the OpenG L/ES library provides support for 3D drawing, the kit library provides support for a browser kernel, and the like, the SQ runtime library also provides an Android runtime library (e photo library) in the system library, the osg library provides support for 3D drawing, the application library for a third party, a third party application management system, a management system application management system can develop and a third party application management system can use a communication interface, a communication system, a communication management API, a communication system, a third party application management API, a third party application management system, a web page, a third party application management API, a third party application management system management API, a third party application management system, a third party application management system, a third party application.
Taking the OS as an example of an IOS system, programs and data stored in the memory 120 are shown in fig. 4, the IOS system includes a Core OS layer 420(Core OS layer), a Core Services layer 440(Core Services layer), a Media layer 460(Media layer), and a touchable layer 480(coco touch L layer), the Core OS layer 420 includes an OS kernel, drivers, and underlying program frames providing functions closer to hardware for use by program frames located in the Core Services layer 440, the Core Services layer 440 provides system Services and/or program frames required by applications, such as a Foundation (Foundation) frame, an account frame, an advertisement frame, a data storage frame, a network connection frame, a geo-location frame, a motion frame, etc., the Media layer 460 provides audiovisual-related interfaces for applications, such as a graphical image-related interface, an audio technology-related interface, a video technology-related interface, an audio-video transmission technology wireless service (air) service frame, etc., the Media layer 460 provides audiovisual-related interfaces for applications, such as a graphical image-related interface, an audio technology-related interface, a game-related interface, a remote interactive interface, a user interface, a remote interactive interface, and the like.
In the framework shown in FIG. 4, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a WiFi (wireless fidelity) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the terminal described above. The terminal device may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of UE (user equipment), MS (mobile station), etc., which are provided with wireless communication functions, and the embodiments of the present invention are not limited thereto.
In the terminal shown in fig. 1, the processor 110 may be configured to call an application program stored in the memory 120, and specifically execute the video switching method according to the embodiment of the present application.
The following describes in detail a video switching method provided in an embodiment of the present application with reference to fig. 5 to 7.
Please refer to fig. 5, which is a flowchart illustrating a video switching method according to an embodiment of the present disclosure. The present embodiment is exemplified by applying a video switching method to a terminal, where the video switching method may include the following steps:
s501, when the terminal is in a current video playing state, key events from the earphone are monitored.
The key event refers to a pressing operation performed by a user on a key on the headset, such as: double clicking the volume up key of the earphone, clicking the pause key of the earphone, etc., all belong to the key press event.
Generally, when a user opens a video in a terminal, the terminal is in a video playing state, the terminal starts to monitor a key event from an earphone at the moment, and after the terminal monitors the key event, the key event is analyzed to obtain a key identifier and pressing times, so that a control instruction for switching the video is obtained. When the terminal is not in a video playing state, the key events from the earphone can not be monitored, so that certain loss of the electric quantity and the running memory of the terminal is avoided.
S502, when the key event is monitored, analyzing the key event to obtain the key identifier and the pressing times, and identifying the key identifier and the pressing times to obtain a control command.
The key identification refers to a basic control key identification set on the earphone, such as a volume increasing key, a volume decreasing key, a pause key and other basic control key identifications. The number of pressing times refers to the number of times that the user presses the control key on the earphone, namely, the number of pressing times corresponding to the key identifier identified by the terminal. The control instruction is an instruction for controlling the video playing of the terminal, and the control instruction is correspondingly different according to different key events, and the control instruction can be an instruction for switching the video, an instruction for pausing the playing of the video, and an instruction for controlling the playing volume of the video. The keys on the earphone can be physical entity keys or touch keys.
Generally, when a key event is monitored, the key event needs to be analyzed to obtain a key identifier and a pressing frequency corresponding to the key event, and then a corresponding control instruction is obtained through the key identifier and the pressing frequency, and the control instruction corresponding to the key identifier and the pressing frequency can be obtained through a table look-up manner.
For example, the following steps are carried out: recognizing that the key identification is a volume increasing key, and when the number of pressing times is two, the corresponding control instruction is used for switching the next video; or the identified key identification is a volume reduction key, and when the number of pressing times is two, the corresponding control instruction is used for switching the last video; or when the identified key identification is a pause key and the pressing times are two times, the corresponding control instruction is used for switching the next video; or when the recognized key identification is a pause key and the number of times of pressing is three times, the corresponding control instruction is used for switching the last video and the like.
And S503, when the control command is a switching command, selecting a target video from the video set.
The switching instruction is a control instruction for switching videos, and the switching instruction may be an instruction for instructing the terminal to switch to a next video, or an instruction for instructing the terminal to switch to a previous video. The video set comprises at least one playable video and also comprises a video currently played by the terminal. The target video refers to a video in the video set for replacing a current video, and according to a difference between a playing mode of the current video and a switching instruction, the target video may be a next video or a previous video arranged in the order of the current video in the video set, may also be a video randomly selected from the video set as the next video, may also be a video similar to or related to the content or style of the current video in the video set, and may also be the previous video before the current video is played.
Generally, when it is recognized that the control instruction corresponding to the key event is a switching instruction, corresponding video switching processing may be performed according to the switching instruction, where the switching instruction includes switching a current video to a previous video and switching the current video to a next video, and there are various ways of selecting a target video from a video set according to the switching instruction:
optionally, when the current playing mode of the terminal is sequential playing and the switching instruction is to switch the current video to the previous video, the previous video before the playing of the current video arranged in sequence may be selected from the video set as the target video; when the current playing mode of the terminal is sequential playing and the switching instruction is to switch the current video to the next video, the next video of the current video arranged in sequence can be selected from the video set as the target video.
Optionally, when the current playing mode of the terminal is random playing and the current video is switched to the next video during the switching instruction, a video similar to or related to the current video content or style can be selected from the video set as the target video; when the current playing mode of the terminal is random playing and the current video is switched to the previous video during the switching instruction, the previous video before the current video is played can be selected from the video set as the target video.
And S504, switching the current video to the target video.
Generally, after a target video is selected from a video set, a video currently played by a terminal is switched to the target video, a playing time point of the current video can be obtained, the playing time point is stored in a storage unit, and when a playing instruction for playing the current video is received during subsequent video switching, a playing time point associated with the current video is obtained, and the video is played based on the playing time point, so that a user can watch the video again from a historical video watching point, and the video watching experience of the user is enhanced.
Meanwhile, in the process that the terminal watches the video, when the earphone pulling-out event is monitored, the preset volume information is obtained, the terminal controls the video to send audio sound through the sound production unit based on the preset volume information, so that after the user pulls out the earphone, the video audio information can be played through the volume which is set in advance and is played outside the terminal, or the video audio information can be played through the preset lower volume, the user is prevented from being scared by the suddenly increased audio volume, and the user further obtains better video watching experience.
According to the video switching method, when the terminal is in a state of playing the current video, the key event from the earphone is monitored, when the key event is monitored, the key event is analyzed to obtain the key identifier and the pressing times, the key identifier and the pressing times are identified to obtain the control command, when the control command is the switching command, the target video is selected from the video set, and the current video is switched to the target video. Through the mode, the user can control the keys on the earphone connected with the terminal, so that the switching of videos in the terminal is controlled, convenience is provided for the user to switch the videos, and the user experience is improved.
Referring to fig. 6, another flow chart of a video switching method according to an embodiment of the present application is provided. The present embodiment is exemplified by applying a video switching method to a terminal. The video switching method may include the steps of:
s601, when the terminal is in a state of playing the current video, monitoring a key event from the earphone.
The key event refers to a pressing operation performed by a user on a key on the headset, such as: double clicking the volume up key of the earphone, clicking the pause key of the earphone, etc., all belong to the key press event.
Generally, when a user opens a video in a terminal, the terminal is in a video playing state, the terminal starts to monitor a key event from an earphone at the moment, and after the terminal monitors the key event, the key event is analyzed to obtain a key identifier and pressing times, so that a control instruction for switching the video is obtained. When the terminal is not in a video playing state, the key events from the earphone can not be monitored, so that certain loss of the electric quantity and the running memory of the terminal is avoided.
S602, when the key event is monitored, analyzing the key event to obtain the key identifier and the pressing times, and identifying the key identifier and the pressing times to obtain a control instruction.
The key identification refers to a basic control key identification set on the earphone, such as a volume increasing key, a volume decreasing key, a pause key and other basic control key identifications. The number of pressing times refers to the number of times that the user presses the control key on the earphone, namely, the number of pressing times corresponding to the key identifier identified by the terminal. The control instruction is an instruction for controlling the video playing of the terminal, and the control instruction is correspondingly different according to different key events, and the control instruction can be an instruction for switching the video, an instruction for pausing the playing of the video, and an instruction for controlling the playing volume of the video. The keys on the earphone can be physical entity keys or touch keys.
Generally, when a key event is monitored, the key event needs to be analyzed to obtain a key identifier and a pressing frequency corresponding to the key event, and then a corresponding control instruction is obtained through the key identifier and the pressing frequency, and the control instruction corresponding to the key identifier and the pressing frequency can be obtained through a table look-up manner.
For example, the following steps are carried out: recognizing that the key identification is a volume increasing key, and when the number of pressing times is two, the corresponding control instruction is used for switching the next video; or the identified key identification is a volume reduction key, and when the number of pressing times is two, the corresponding control instruction is used for switching the last video; or when the identified key identification is a pause key and the pressing times are two times, the corresponding control instruction is used for switching the next video; or when the recognized key identification is a pause key and the number of times of pressing is three times, the corresponding control instruction is used for switching the last video and the like.
Figure BDA0002421889890000111
TABLE 1
For example, the following steps are carried out: referring to table 1, if there are three control keys on the headset, which are a volume pause key, a volume up key, and a volume down key, respectively, the audio will stop playing the video when the user presses or touches the volume pause key on the headset 1 time; when the user presses or touches the volume increasing key on the earphone for 1 time, the audio increases the volume of the played audio; when a user presses or touches a volume increasing key on the earphone for 2 times, a switching instruction is generated to instruct the terminal to switch the current video to the next video; when the user presses or touches the volume down key on the headset 1 time, the audio will decrease the volume of the played audio; when the user presses or touches the volume-down key on the headset 2 times, a switching instruction is generated to instruct the terminal to switch the current video to the previous video.
S603, when the control instruction is a switching instruction, acquiring the previous video or the next video of the current video in the video set.
The switching instruction is a control instruction for switching videos, and the switching instruction may be an instruction for instructing the terminal to switch to a next video, or an instruction for instructing the terminal to switch to a previous video. The video set comprises at least one playable video and also comprises a video currently played by the terminal.
Generally, when it is determined that the control command is a switching command, a video corresponding to the switching command is selected from the video set according to the switching command.
When the current playing mode of the terminal is sequential playing and the switching instruction is to switch the current video to the previous video, the previous video before the playing of the current video arranged according to the sequence can be selected from the video set as the target video; when the current playing mode of the terminal is sequential playing and the switching instruction is to switch the current video to the next video, the next video of the current video arranged in sequence can be selected from the video set as the target video.
Optionally, when the current playing mode of the terminal is random playing and the current video is switched to the next video during the switching instruction, a video similar to or related to the current video content or style can be selected from the video set as the target video; when the current playing mode of the terminal is random playing and the current video is switched to the previous video during the switching instruction, the previous video before the current video is played can be selected from the video set as the target video.
S604, taking the previous video or the next video as the target video.
The target video refers to a video in the video set for replacing a current video, and according to a playing mode of the current video and a difference of the switching instruction, the target video may be a next video or a previous video arranged in the order of the current video in the video set, may also be a video randomly selected from the video set as the next video, may also be a video similar to or related to the content of the current video in the video set, and may also be the previous video before the current video is played.
Generally, after a control instruction is identified as a switching instruction, if the instruction instructs a terminal to switch a current video to a next video by analyzing the switching instruction, acquiring the next video in a video set, where the current video is arranged in sequence, or selecting a video related to or similar to the current video from the video set based on a preset rule, and taking the video as a target video; and if the switching instruction is analyzed to know that the instruction instructs the terminal to switch the current video to the previous video, acquiring the previous video in which the current video is arranged in sequence in the video set, or acquiring the previous video played by the current video by inquiring the video playing history record, and taking the video as the target video.
And S605, switching the current video to the target video.
Generally, after a target video is selected from a video set, a video currently played by a terminal is switched to the target video, a playing time point of the current video can be obtained, the playing time point is stored in a storage unit, and when a playing instruction for playing the current video is received during subsequent video switching, a playing time point associated with the current video is obtained, and the video is played based on the playing time point, so that a user can watch the video again from a historical video watching point, and the video watching experience of the user is enhanced.
S606, the playing time point of the current video is obtained.
The playing time point is a playing progress point at which the video is closed after being played for a period of time, so that the user can continue to watch the video at the last watching position when watching the same video again.
For example, the following steps are carried out: the playing time length of the video A is 30 minutes, the video A is switched to the video B after the user watches the video A for 10 minutes, at the moment, the terminal acquires the playing time point of the video A as the 10-minute position, the user switches the video B to the video A after 5 minutes, the playing time point of the video B is simultaneously acquired as the 5-minute position, and the terminal starts to play the video from the 10-minute position of the video A according to the recorded playing time point of the video A, so that the user can continuously watch the new content of the video A.
S607, storing the playing time point in the storage unit.
S608, when a play instruction for playing the current video is received, acquiring a play time point associated with the current video.
Generally, after a current video is switched to a new video, a terminal acquires a playing time point of the current video, and when a user switches to the current video again, the video starts to be played from the position of the playing time point according to the playing time point of the last video playing, so that the user can watch a complete video at the position where the user watches the video last time, the watching time of the user is saved, and the bad use experience caused by the fact that the user watches the same part of the same video twice repeatedly can be avoided.
And S609, playing the current video based on the playing time.
S610, when the earphone pulling-out event is monitored, preset volume information is obtained.
The earphone pulling-out event refers to an operation that the earphone is pulled out of the terminal by a user, and when the user inserts the earphone into the terminal and pulls the earphone out of the terminal, or when the user connects the earphone with the terminal in a Bluetooth mode and disconnects the earphone from the terminal in the Bluetooth mode, the terminal can monitor the corresponding event and execute the corresponding operation. The earphone pulling-out event can be an operation that the earphone with the plug is pulled out from the earphone hole by a user, or an operation that the Bluetooth earphone connected with the terminal through Bluetooth is disconnected by the user. The preset volume information refers to volume information corresponding to sound emitted by the terminal when the terminal cannot emit the sound through the earphone, and the preset volume information can be that the terminal sets proper volume by a user before the earphone is plugged into the terminal or before the earphone is connected with the terminal Bluetooth, or can be preset lower volume when the earphone is pulled out of the terminal or the earphone is disconnected with the terminal Bluetooth, so that the terminal can not suddenly emit audio with higher volume to scare the user.
S611, emitting an audio sound through the sound emitting unit based on the preset volume information.
Generally, when the earphone is pulled out of the terminal or the earphone is disconnected from the bluetooth connection of the terminal, the terminal may adjust the volume of the audio in the video to the preset volume through preset volume information, and emit audio sound through a sound emitting unit in the terminal, so that a user can transition from an environment where the user acquires the audio information from the earphone to an environment where the user directly acquires the audio information from the terminal.
According to the content, the video switching method provided by the scheme includes the steps of monitoring a key event from an earphone when a terminal is in a state of playing a current video, analyzing the key event to obtain a key identifier and pressing times when the key event is monitored, identifying the key identifier and the pressing times to obtain a control instruction, obtaining a previous video or a next video of the current video in a video set when the control instruction is the switching instruction, using the previous video or the next video as a target video, switching the current video to the target video, obtaining a playing time point of the current video, storing the playing time point into a storage unit, obtaining a playing time point associated with the current video when a playing instruction for playing the current video is received, playing the current video based on the playing time point, obtaining preset volume information when the earphone is monitored to be pulled out, and emitting audio sound through the sound emitting unit based on the preset volume information. Through the mode, the user can control the keys on the earphone connected with the terminal to further control the switching of videos in the terminal, convenience is provided for the user to switch videos, the user can obtain comfortable transition in hearing when the earphone is disconnected with the terminal, and the use experience of the user is further improved.
Referring to fig. 7, another flow chart of a video switching method according to an embodiment of the present application is provided. The present embodiment is exemplified by applying a video switching method to a terminal. The video switching method may include the steps of:
and S701, monitoring a key event from the earphone when the terminal is in a state of playing the current video.
The key event refers to a pressing operation performed by a user on a key on the headset, such as: double clicking the volume up key of the earphone, clicking the pause key of the earphone, etc., all belong to the key press event.
Generally, when a user opens a video in a terminal, the terminal is in a video playing state, the terminal starts to monitor a key event from an earphone at the moment, and after the terminal monitors the key event, the key event is analyzed to obtain a key identifier and pressing times, so that a control instruction for switching the video is obtained. When the terminal is not in a video playing state, the key events from the earphone can not be monitored, so that certain loss of the electric quantity and the running memory of the terminal is avoided.
S702, when the key event is monitored, analyzing the key event to obtain a key identifier and the pressing times, and identifying the key identifier and the pressing times to obtain a control instruction.
The key identification refers to a basic control key identification set on the earphone, such as a volume increasing key, a volume decreasing key, a pause key and other basic control key identifications. The number of pressing times refers to the number of times that the user presses the control key on the earphone, namely, the number of pressing times corresponding to the key identifier identified by the terminal. The control instruction is an instruction for controlling the video playing of the terminal, and the control instruction is correspondingly different according to different key events, and the control instruction can be an instruction for switching the video, an instruction for pausing the playing of the video, and an instruction for controlling the playing volume of the video. The keys on the earphone can be physical entity keys or touch keys.
Generally, when a key event is monitored, the key event needs to be analyzed to obtain a key identifier and a pressing frequency corresponding to the key event, and then a corresponding control instruction is obtained through the key identifier and the pressing frequency, and the control instruction corresponding to the key identifier and the pressing frequency can be obtained through a table look-up manner.
For example, the following steps are carried out: recognizing that the key identification is a volume increasing key, and when the number of pressing times is two, the corresponding control instruction is used for switching the next video; or the identified key identification is a volume reduction key, and when the number of pressing times is two, the corresponding control instruction is used for switching the last video; or when the identified key identification is a pause key and the pressing times are two times, the corresponding control instruction is used for switching the next video; or when the recognized key identification is a pause key and the number of times of pressing is three times, the corresponding control instruction is used for switching the last video and the like.
Figure BDA0002421889890000161
TABLE 2
For example, the following steps are carried out: referring to table 2, if there is a control key for volume pause on the earphone, the audio will stop playing the video when the user presses or touches the volume pause key on the earphone for 1 time; when a user presses or touches a volume pause key on the earphone for 2 times, a switching instruction is generated to instruct the terminal to switch the current video to the next video; when the user presses or touches the volume pause key on the earphone for 3 times, a switching instruction is generated to instruct the terminal to switch the current video to the previous video.
And S703, determining a similar video set similar to the current video from the video sets according to a preset rule.
The preset rule is a preset rule for selecting a video from a video set, and can be set manually or different according to different video playing software. The video set comprises at least one playable video and a video currently played by the terminal, the video set comprises videos similar to or related to the current video content or style and videos with no same points as the current video content or style, the similar video set is a video set similar to or related to the current video content or style in the video set, and the similar video set comprises at least one similar video.
Generally, when the control instruction is determined to be a switching instruction, whether the previous video of the current video or the next video of the current video needs to be switched is determined according to the switching instruction, and if the current video needs to be switched to the previous video according to the switching instruction, the video with the latest playing time of the current video can be inquired from a video playing history record to serve as a target video; if the current video needs to be switched to the next video according to the switching instruction, videos similar to or related to the current video content or style can be selected from the video set according to a preset rule to form a similar video set, the videos in the similar video set are subjected to similarity or relevance arrangement, and the video with the highest similarity or relevance is selected as the target video.
S704, selecting a target video from the similar video set.
The target video is a video in the video set for replacing the current video, and the final target video is different according to the content or style of the current video and the difference of the switching instruction.
S705, the current video is switched to the target video.
Generally, after a target video is selected from a video set, a video currently played by a terminal is switched to the target video, a playing time point of the current video can be obtained, the playing time point is stored in a storage unit, and when a playing instruction for playing the current video is received during subsequent video switching, a playing time point associated with the current video is obtained, and the video is played based on the playing time point, so that a user can watch the video again from a historical video watching point, and the video watching experience of the user is enhanced.
S706, the playing time point of the current video is obtained.
The playing time point is a playing progress point at which the video is closed after being played for a period of time, so that the user can continue to watch the video at the last watching position when watching the same video again.
For example, the following steps are carried out: the playing time length of the video A is 30 minutes, the video A is switched to the video B after the user watches the video A for 10 minutes, at the moment, the terminal acquires the playing time point of the video A as the 10-minute position, the user switches the video B to the video A after 5 minutes, the playing time point of the video B is simultaneously acquired as the 5-minute position, and the terminal starts to play the video from the 10-minute position of the video A according to the recorded playing time point of the video A, so that the user can continuously watch the new content of the video A.
S707, storing the playing time point in the storage unit.
S708, when a play instruction for playing the current video is received, acquiring a play time point associated with the current video.
Generally, after a current video is switched to a new video, a terminal acquires a playing time point of the current video, and when a user switches to the current video again, the video starts to be played from the position of the playing time point according to the playing time point of the last video playing, so that the user can watch a complete video at the position where the user watches the video last time, the watching time of the user is saved, and the bad use experience caused by the fact that the user watches the same part of the same video twice repeatedly can be avoided.
S709, play the current video based on the play time.
And S710, acquiring preset volume information when the earphone pulling-out event is monitored.
The earphone pulling-out event refers to an operation that the earphone is pulled out of the terminal by a user, and when the user inserts the earphone into the terminal and pulls the earphone out of the terminal, or when the user connects the earphone with the terminal in a Bluetooth mode and disconnects the earphone from the terminal in the Bluetooth mode, the terminal can monitor the corresponding event and execute the corresponding operation. The earphone pulling-out event can be an operation that the earphone with the plug is pulled out from the earphone hole by a user, or an operation that the Bluetooth earphone connected with the terminal through Bluetooth is disconnected by the user. The preset volume information refers to volume information corresponding to sound emitted by the terminal when the terminal cannot emit the sound through the earphone, and the preset volume information can be that the terminal sets proper volume by a user before the earphone is plugged into the terminal or before the earphone is connected with the terminal Bluetooth, or can be preset lower volume when the earphone is pulled out of the terminal or the earphone is disconnected with the terminal Bluetooth, so that the terminal can not suddenly emit audio with higher volume to scare the user.
And S711, emitting audio sound through the sound emitting unit based on the preset volume information.
Generally, when the earphone is pulled out of the terminal or the earphone is disconnected from the bluetooth connection of the terminal, the terminal may adjust the volume of the audio in the video to the preset volume through preset volume information, and emit audio sound through a sound emitting unit in the terminal, so that a user can transition from an environment where the user acquires the audio information from the earphone to an environment where the user directly acquires the audio information from the terminal.
According to the content, the video switching method provided by the scheme includes the steps of monitoring a key event from an earphone when a terminal is in a state of playing a current video, analyzing the key event to obtain a key identifier and pressing times when the key event is monitored, identifying the key identifier and the pressing times to obtain a control instruction, obtaining a previous video or a next video of the current video in a video set when the control instruction is the switching instruction, using the previous video or the next video as a target video, switching the current video to the target video, obtaining a playing time point of the current video, storing the playing time point into a storage unit, obtaining a playing time point associated with the current video when a playing instruction for playing the current video is received, playing the current video based on the playing time point, obtaining preset volume information when the earphone is monitored to be pulled out, and emitting audio sound through the sound emitting unit based on the preset volume information. Through the mode, the user can control the keys on the earphone connected with the terminal to further control the switching of videos in the terminal, convenience is provided for the user to switch videos, the user can obtain comfortable transition in hearing when the earphone is disconnected with the terminal, and the use experience of the user is further improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, a schematic structural diagram of a video switching apparatus according to an exemplary embodiment of the present application is shown, which is hereinafter referred to as an apparatus 8. The means 8 may be implemented in software, hardware or a combination of both as all or part of a terminal. The device 8 is applied to a terminal, and the device 8 comprises:
a monitoring module 801, configured to monitor a key event from the earphone when the terminal is in a state of playing a current video;
the processing module 802 is configured to, when the key event is monitored, analyze the key event to obtain a key identifier and a number of times of pressing, and identify the key identifier and the number of times of pressing to obtain a control instruction;
a selecting module 803, configured to select a target video from a video set when the control instruction is a switching instruction; wherein the video set comprises the current video and the video set comprises at least one video;
a switching module 804, configured to switch the current video to the target video.
Optionally, the selecting module 803 includes:
a first obtaining unit, configured to obtain a previous video or a next video of the current video in the video set;
a first selecting unit, configured to take a previous video or a next video as the target video.
Optionally, the selecting module 803 includes:
the determining unit is used for determining a similar video set similar to the current video from the video sets according to a preset rule;
a second selecting unit, configured to select the target video from the set of similar videos.
Optionally, the switching module 804 further includes:
the second acquisition unit is used for acquiring the playing time point of the current video;
and the storage unit is used for storing the playing time point into the storage unit.
Optionally, the switching module 804 further includes:
a third obtaining unit, configured to obtain a playing time point associated with the current video when a playing instruction for playing the current video is received;
and the playing unit is used for playing the current video based on the playing time point.
Optionally, the apparatus 8 further includes:
the fourth acquisition unit is used for acquiring preset volume information when the earphone pulling-out event is monitored;
and the sound generating unit is used for generating audio sound through the sound generating unit based on the preset volume information.
It should be noted that, when the video switching apparatus provided in the foregoing embodiment executes the video switching method, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed to different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the video switching apparatus and the video switching method provided in the foregoing embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the above method steps, and a specific execution process may refer to specific descriptions of embodiments shown in fig. 5 to 7, which are not described herein again.
The application also provides a terminal, which comprises a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for switching video, the method comprising:
monitoring a key event from an earphone when the terminal is in a current video playing state;
when the key event is monitored, analyzing the key event to obtain a key identifier and the number of pressing times, and identifying the key identifier and the number of pressing times to obtain a control instruction;
when the control instruction is a switching instruction, selecting a target video from a video set; wherein the video set comprises the current video and the video set comprises at least one video;
and switching the current video into the target video.
2. The method according to claim 1, wherein the key identification is a volume up key, and when the number of pressing times is two, the control instruction is used to switch to the next video; or
The key identification is a volume reduction key, and when the number of pressing times is two, the control instruction is used for switching the last video.
3. The method of claim 1, wherein selecting the target video from the set of videos comprises:
acquiring a previous video or a next video of the current video in the video set;
and taking the last video or the next video as the target video.
4. The method of claim 1, wherein selecting the target video from the set of videos comprises:
determining a similar video set similar to the current video from the video sets according to a preset rule;
selecting the target video from the set of similar videos.
5. The method of claim 1, wherein switching the current video to the target video further comprises:
acquiring a playing time point of the current video;
and storing the playing time point into a storage unit.
6. The method according to claim 5, further comprising, after storing the playing time point in a storage unit:
when a playing instruction for playing the current video is received, acquiring a playing time point associated with the current video;
and playing the current video based on the playing time point.
7. The method of claim 1, further comprising:
when an earphone pulling-out event is monitored, acquiring preset volume information;
and sending out audio sound through a sound production unit based on the preset volume information.
8. An apparatus for switching video, the apparatus comprising:
the monitoring module is used for monitoring a key event from the earphone when the terminal is in a current video playing state;
the processing module is used for analyzing the key event to obtain a key identifier and the pressing times and identifying the key identifier and the pressing times to obtain a control instruction when the key event is monitored;
the selection module is used for selecting a target video from a video set when the control instruction is a switching instruction; wherein the video set comprises the current video and the video set comprises at least one video;
and the switching module is used for switching the current video into the target video.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. A terminal, comprising: the system comprises a processor, a memory and a display screen; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
CN202010208217.7A 2020-03-23 2020-03-23 Video switching method and device, storage medium and terminal Pending CN111510784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010208217.7A CN111510784A (en) 2020-03-23 2020-03-23 Video switching method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010208217.7A CN111510784A (en) 2020-03-23 2020-03-23 Video switching method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN111510784A true CN111510784A (en) 2020-08-07

Family

ID=71871580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010208217.7A Pending CN111510784A (en) 2020-03-23 2020-03-23 Video switching method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN111510784A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006140866A (en) * 2004-11-15 2006-06-01 Seiko Epson Corp Electronic equipment
CN102256007A (en) * 2011-06-03 2011-11-23 深圳市同洲电子股份有限公司 Method and device for controlling audio playing list according to Bluetooth earphone command and mobile terminal
CN102325216A (en) * 2011-06-29 2012-01-18 惠州Tcl移动通信有限公司 Mobile communication equipment and volume control method thereof
CN103092490A (en) * 2013-01-30 2013-05-08 广东欧珀移动通信有限公司 Video control method and device
CN103618924A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Method for controlling video and user terminal
CN105975242A (en) * 2016-04-28 2016-09-28 乐视控股(北京)有限公司 Multimedia loudspeaker volume control method and device as well as electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006140866A (en) * 2004-11-15 2006-06-01 Seiko Epson Corp Electronic equipment
CN102256007A (en) * 2011-06-03 2011-11-23 深圳市同洲电子股份有限公司 Method and device for controlling audio playing list according to Bluetooth earphone command and mobile terminal
CN102325216A (en) * 2011-06-29 2012-01-18 惠州Tcl移动通信有限公司 Mobile communication equipment and volume control method thereof
CN103092490A (en) * 2013-01-30 2013-05-08 广东欧珀移动通信有限公司 Video control method and device
CN103618924A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Method for controlling video and user terminal
CN105975242A (en) * 2016-04-28 2016-09-28 乐视控股(北京)有限公司 Multimedia loudspeaker volume control method and device as well as electronic equipment

Similar Documents

Publication Publication Date Title
CN110582017B (en) Video playing method, device, terminal and storage medium
CN108491275B (en) Program optimization method, device, terminal and storage medium
CN112738623B (en) Video file generation method, device, terminal and storage medium
WO2017202348A1 (en) Video playing method and device, and computer storage medium
KR102058465B1 (en) Management system and method for remote controller of electronic device
CN107220020B (en) Display method and electronic equipment
US9760998B2 (en) Video processing method and apparatus
CN107333162B (en) Method and device for playing live video
CN103914280A (en) Method and apparatus for laying out image using image recognition
CN108900407B (en) Method and device for managing session record and storage medium
CN111459586A (en) Remote assistance method, device, storage medium and terminal
CN108984142B (en) Split screen display method and device, storage medium and electronic equipment
CN112040324A (en) Playing progress adjusting method and device, storage medium and terminal
EP2838225A1 (en) Message based conversation function execution method and electronic device supporting the same
CN110300047B (en) Animation playing method and device and storage medium
CN111949239A (en) Screen sharing method and device, storage medium and terminal
CN115643445A (en) Interaction processing method and device, electronic equipment and storage medium
US20230370672A1 (en) Method for processing sound information, and non-transitory computer storage medium and electronic device
CN111510784A (en) Video switching method and device, storage medium and terminal
CN115017340A (en) Multimedia resource generation method and device, electronic equipment and storage medium
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN110913384A (en) Dial card switching method and device, storage medium and terminal
CN106358070B (en) Multimedia file uploading method and device
CN116456131B (en) Special effect rendering method and device, electronic equipment and storage medium
CN112230906B (en) Method, device and equipment for creating list control and readable 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200807

RJ01 Rejection of invention patent application after publication