Disclosure of Invention
The application provides a video playing method and device, electronic equipment and a computer readable storage medium, which can solve the problems of low screen utilization rate and poor user experience when a large screen terminal plays a short video. The technical scheme is as follows:
in one aspect, a method for video playing is provided, where the method includes:
the terminal receives a playing instruction for a video set to be played; the video set to be played comprises at least one sub video;
acquiring each sub-video, and a display position attribute and a playing time attribute corresponding to each sub-video based on the playing instruction;
determining a display position for displaying each sub-video in a current interface of the terminal based on the display position attribute corresponding to each sub-video;
and playing each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
Preferably, the display position attribute of the sub video includes a coordinate, a size, and a display hierarchy;
the step of determining the display position for displaying each sub-video in the current interface of the terminal based on the display position attribute corresponding to each sub-video includes:
acquiring respective coordinates, sizes and display levels of the sub videos;
and determining the display position of each sub-video based on the coordinates and the size of each sub-video, and setting the display position as the display hierarchy.
Preferably, the playing time attribute of the sub-video includes a playing time length, an initial playing time and an initial playing position; the starting playing time is the time point when each sub video starts playing in the video set to be played, and the starting playing position is the time point when each sub video starts playing;
the step of playing each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video includes:
and displaying each corresponding sub-video at each display position in the current interface of the terminal, and playing each sub-video based on the initial playing time, the initial playing position and the playing duration of each sub-video.
Preferably, the video set to be played is generated as follows:
when a video set generation instruction is received, displaying a preset editing interface;
acquiring each sub video used for generating a video set to be played according to a received selection instruction aiming at least one sub video;
editing the original display position attribute and the original playing time attribute of each sub-video according to the received editing instruction for each sub-video to obtain the edited target display position attribute and the edited target playing time attribute of each sub-video;
and generating a set identifier of the video set to be played, and establishing an association relation between the set identifier and the sub-video identifiers of the sub-videos, the target display position attributes of the sub-videos and the target playing time attributes of the sub-videos.
Preferably, the step of obtaining each sub-video based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video includes:
acquiring a set identifier of the video set to be played in the playing instruction;
acquiring each sub-video identifier having an association relation with the set identifier, a target display position attribute of each sub-video and a target playing time attribute of each sub-video, taking the target display position attribute of each sub-video as a corresponding display position attribute, and taking the target playing time attribute of each sub-video as a corresponding playing time attribute;
and acquiring each sub video based on each sub video identifier.
In another aspect, an apparatus for video playback is provided, the apparatus including:
the receiving module is used for receiving a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video;
the acquisition module is used for acquiring each sub-video and the display position attribute and the playing time attribute corresponding to each sub-video based on the playing instruction;
the determining module is used for determining the display position for displaying each sub-video in the current interface of the terminal based on the display position attribute corresponding to each sub-video;
and the playing module is used for playing each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
Preferably, the display position attribute of the sub video includes a coordinate, a size, and a display hierarchy;
the determining module comprises:
the first acquisition submodule is used for acquiring the respective coordinates, sizes and display levels of the sub videos;
and the first processing submodule is used for determining the display position of each sub-video based on the coordinates and the size of each sub-video and setting the display position as the display hierarchy.
Preferably, the playing time attribute of the sub-video includes a playing time length, an initial playing time and an initial playing position; the starting playing time is the time point when each sub video starts playing in the video set to be played, and the starting playing position is the time point when each sub video starts playing;
the playing module is specifically configured to:
and displaying each corresponding sub-video at each display position in the current interface of the terminal, and playing each sub-video based on the initial playing time, the initial playing position and the playing duration of each sub-video.
Preferably, the video set to be played is generated as follows:
when a video set generation instruction is received, displaying a preset editing interface;
acquiring each sub video used for generating a video set to be played according to a received selection instruction aiming at least one sub video;
editing the original display position attribute and the original playing time attribute of each sub-video according to the received editing instruction for each sub-video to obtain the edited target display position attribute and the edited target playing time attribute of each sub-video;
and generating a set identifier of the video set to be played, and establishing an association relation between the set identifier and the sub-video identifiers of the sub-videos, the target display position attributes of the sub-videos and the target playing time attributes of the sub-videos.
Preferably, the obtaining module includes:
the second obtaining submodule is used for obtaining the set identifier of the video set to be played in the playing instruction;
a third obtaining submodule, configured to obtain each sub-video identifier having an association relationship with the set identifier, a target display position attribute of each sub-video, and a target play time attribute of each sub-video, use the target display position attribute of each sub-video as a display position attribute corresponding to each sub-video, and use the target play time attribute of each sub-video as a play time attribute corresponding to each sub-video;
and the fourth obtaining submodule is used for obtaining each sub-video based on each sub-video identifier.
In another aspect, an electronic device is provided, including:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to invoke the operation instruction, and the executable instruction enables the processor to execute an operation corresponding to the video playing method shown in the first aspect of the present application.
In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor, implements the method of video playback illustrated in the first aspect of the present application.
The beneficial effect that technical scheme that this application provided brought is:
the terminal receives a playing instruction for a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, then, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
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.
The present application provides a video playing method, an apparatus, an electronic device, and a computer-readable storage medium, which are intended to solve the above technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present invention provides an application environment for playing a video, and referring to fig. 1, the application environment includes: a first device 101 and a second device 102. The first device 101 and the second device 102 are connected through a network, the first device 101 is an access device, and the second device 102 is an accessed device. The first device 101 may be a terminal and the second device 102 may be a server. The terminal can be any one of a smart television, a smart tablet or a computer terminal, and the like, an application client for playing videos, such as a video client, a browser client and the like, can be installed in the terminal, and different application clients can correspond to different servers and perform data interaction with the servers to realize video playing, for example, the video client performs data interaction with a corresponding server a to realize video playing, and the browser client performs data interaction with a corresponding server B to realize video playing.
A method of playing video may be performed in the application environment, as shown in fig. 2, the method includes:
step S201, a terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video;
specifically, the video set to be played may be a video set formed by splicing a plurality of sub-videos, where the video set has a set identifier, and meanwhile, the set identifier has an association relationship with the sub-video identifier of each sub-video.
Step S202, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained;
the playing instruction comprises a set identifier of a video set, after the terminal receives the playing instruction, the set identifier in the playing instruction is firstly obtained, then each sub-video identifier which has an association relation with the set identifier, the target display position attribute of each sub-video and the target playing time attribute of each sub-video are obtained, and each sub-video is obtained based on each sub-video identifier.
Step S203, determining the display position for displaying each sub-video in the current interface of the terminal based on the display position attribute corresponding to each sub-video;
specifically, after the display position attributes corresponding to each sub-video and each sub-video are obtained, the display position of each sub-video, that is, the display position of each sub-video in the terminal screen during playing, can be determined based on the display position attributes of each sub-video.
And step S204, playing each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
After the display positions of the sub-videos are determined, the sub-videos can be played at the display positions based on the playing time attributes corresponding to the sub-videos.
In the embodiment of the invention, a terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
In another embodiment, a detailed description of a video playing method as shown in fig. 2 is continued.
Step S201, a terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video;
specifically, the embodiment of the present invention may be applied to a terminal with a large screen, such as a smart television, a smart tablet, and the like, and the terminal may have the following characteristics:
(1) on a hardware architecture, a device has a central processing unit, a memory, an input unit and an output unit, that is, the device is often a microcomputer device having a communication function. In addition, various input modes such as a keyboard, a mouse, a touch screen, a microphone, a camera and the like can be provided, and input can be adjusted as required. Meanwhile, the equipment often has a plurality of output modes, such as a telephone receiver, a display screen and the like, and can be adjusted according to needs;
(2) on a software system, the device must have an operating system, such as Windows Mobile, Symbian, Palm, Android, iOS, and the like. Meanwhile, the operating systems are more and more open, and personalized application programs developed based on the open operating system platforms are infinite, such as a communication book, a schedule, a notebook, a calculator, various games and the like, so that the requirements of personalized users are met to a great extent;
(3) in terms of communication capacity, the device has flexible access mode and high-bandwidth communication performance, and can automatically adjust the selected communication mode according to the selected service and the environment, thereby being convenient for users to use. The device can support GSM (Global System for Mobile Communication), WCDMA (Wideband Code Division Multiple Access), CDMA2000(Code Division Multiple Access), TDSCDMA (Time Division-Synchronous Code Division Multiple Access), Wi-Fi (Wireless-Fidelity), WiMAX (world interoperability for Microwave Access), etc., thereby adapting to various systems of networks, not only supporting voice service, but also supporting various Wireless data services;
(4) in the aspect of function use, the equipment focuses more on humanization, individuation and multi-functionalization. With the development of computer technology, devices enter a human-centered mode from a device-centered mode, and the embedded computing, control technology, artificial intelligence technology, biometric authentication technology and the like are integrated, so that the human-oriented purpose is fully embodied. Due to the development of software technology, the equipment can be adjusted and set according to individual requirements, and is more personalized. Meanwhile, the device integrates a plurality of software and hardware, and the function is more and more powerful.
Further, the video set to be played in the present application may be a video set formed by splicing one or more sub-videos, where the video set has a set identifier, and meanwhile, the set identifier has an association relationship with the sub-video identifier of each sub-video. For example, a video set a includes three sub-videos a ', b', and c ', where the set of a is identified as 001, the sub-video of a' is identified as 002, the sub-video of b 'is identified as 003, and the sub-video of c' is identified as 004, then 001 has an association relationship with 002, 003, and 004.
In practical application, a terminal can display a plurality of video sets in a display page, and when a user selects any one of the video sets and clicks a function button for playing, a play instruction for the video set is initiated.
Step S202, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained;
specifically, the playing instruction includes a set identifier of the video set, so that after receiving the playing instruction, the terminal may extract the set identifier in the playing instruction, then obtain sub-video identifiers of sub-videos included in the video set based on a preset association relationship, and obtain the sub-videos based on the sub-video identifiers.
Further, each sub-video has a sub-video identifier, a display position attribute and a play time attribute, the display position attribute includes coordinates, a size and a display hierarchy, the play time attribute includes a play duration, an initial play time and an initial play position, and the specific details are shown in table 1:
TABLE 1
Wherein, the VideoID is sub-video identification information, X and Y are sub-video coordinates, and Width and Height are sub-video sizes; the display hierarchy is a hierarchy of layers displaying sub-videos, and when displaying, a layer with a high display hierarchy may cover a layer with a low display hierarchy, for example, a sub-video a and a sub-video B are simultaneously displayed at a certain display position, the display hierarchy of a is 1 level, and the display hierarchy of B is 2 levels (less than 1 level), and if a and B are simultaneously played, a user may only see a picture of a, but may not see a picture of B.
Note that the difference between StartTime and StartPosition is that StartTime is a time point at which each sub-video starts playing in the set of videos to be played, and StartPosition is a time point at which each sub-video itself starts playing. For example, the video set a includes three sub-videos a ', b ', and c ', the total duration of a is 5:00, the total duration of a ' is 3:00, the total duration of b ' is 7:00, and the total duration of c ' is 6:00, where a ' is played from 0:00 of a, b ' is played from 2:00, and c ' is played from 4:00, and then these three time points are StartTime; when playing a ', the playback starts from 0:58 of a', when playing b ', the playback starts from 3:49 of b', when playing c ', the playback starts from 2:27 of c', then the three time points are StartPosition; thus, the Duration of a ' is 2 minutes, the Duration of b ' is 2 minutes, and the Duration of c ' is 1 minute.
Further, the related information contained in each video set may be as shown in table 2:
TABLE 2
In a preferred embodiment of the present invention, the step of obtaining each sub-video based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video includes:
acquiring a set identifier of a video set to be played in a playing instruction;
acquiring each sub-video identifier having an association relation with the set identifier, a target display position attribute of each sub-video and a target playing time attribute of each sub-video, taking the target display position attribute of each sub-video as a corresponding display position attribute, and taking the target playing time attribute of each sub-video as a corresponding playing time attribute;
and acquiring each sub video based on each sub video identifier.
Specifically, the playing instruction may include a set identifier of the video set, and after receiving the playing instruction, the terminal acquires the set identifier in the playing instruction, then acquires each sub-video identifier having an association relationship with the set identifier, a target display position attribute of each sub-video, and a target playing time attribute of each sub-video, and acquires each sub-video based on each sub-video identifier.
The information may be obtained locally from the terminal, obtained from the server, or obtained from both, and may be set according to actual requirements in actual applications, which is not limited in this embodiment of the present invention.
Step S203, determining the display position for displaying each sub-video in the current interface of the terminal based on the display position attribute corresponding to each sub-video;
after the sub-videos and the display position attributes corresponding to the sub-videos are obtained, the display position of each sub-video, that is, the display position of each sub-video in the terminal screen during playing, can be determined based on the display position attributes of each sub-video.
In a preferred embodiment of the present invention, the step of determining the display position for displaying each sub-video in the current interface of the terminal based on the display position attribute corresponding to each sub-video includes:
acquiring respective coordinates, sizes and display levels of the sub videos;
the display position of each sub video is determined based on the coordinates and size of each sub video, and the display position is set as a display hierarchy.
Specifically, the parameter values of X, Y, Width, Height and Layer of each sub-video are obtained, then the display position of each sub-video is determined according to the parameter values of X, Y, Width and Height corresponding to each sub-video, and then each display position is set as the corresponding display level. For example, the video set a includes sub-videos a ', B', and c ', and the display positions of a', B ', and c' are determined according to the respective values of X, Y, Width, Height, and Layer, and then the display position of a 'is set as the corresponding display level, the display position of B' is set as the corresponding display level, and the display position of c 'is set as the corresponding display level, and the layouts of a', B ', and c' may be as shown in fig. 3A or as shown in fig. 3B.
And step S204, playing each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
After the display positions of the sub-videos are determined, the sub-videos can be played at the display positions based on the playing time attributes corresponding to the sub-videos.
In a preferred embodiment of the present invention, the step of playing each sub-video at a corresponding display position in a current interface of the terminal based on a playing time attribute corresponding to each sub-video includes:
and displaying each corresponding sub-video at each display position in the current interface of the terminal, and playing each sub-video based on the initial playing time, the initial playing position and the playing duration of each sub-video.
Specifically, each sub-video has a start playing time, a start playing position and a playing time, and the video set also has a total playing time, so that when the playing video set is played, the corresponding sub-video is played every time one StartTime is reached, when the sub-video starts playing, the sub-video starts playing from StartPosition, and the playing time is Duration.
For example, in the previous example, the video set a includes three sub-videos a ', b', and c ', the playing time of a is 5 minutes, when a user plays a, the 0:00 first playing sub-video is a', the playing time of a 'is 2 minutes, when 2:00 is reached, the playing time of b', b 'is 2 minutes, when 4:00 is reached, the playing time of c', c 'is 1 minute, when 5:00 is reached, c' is also played, and thus a is completely played.
Of course, in the playing process, it is not necessary that the current sub-video is played only after the current sub-video is played, and the playing of the other sub-videos may also be started when the playing of the current sub-video is not completed.
In a preferred embodiment of the present invention, the video set to be played is generated as follows:
when a video set generation instruction is received, displaying a preset editing interface;
acquiring each sub video used for generating a video set to be played according to a received selection instruction aiming at least one sub video;
editing the original display position attribute and the original playing time attribute of each sub-video according to the received editing instruction for each sub-video to obtain the edited target display position attribute and the edited target playing time attribute of each sub-video;
and generating a set identifier of a video set to be played, and establishing an association relation between the set identifier and the sub-video identifier of each sub-video, the target display position attribute of each sub-video and the target playing time attribute of each sub-video.
Specifically, the user can generate the video set by himself through the terminal. In practical application, when a user clicks an action button for generating a video set in an interactive interface of a terminal, a preset editing interface is displayed, the action button for adding a sub-video is preset in the editing interface, when the user clicks the action button, a preset selection interface of the sub-video can be displayed, the user can select at least one sub-video in the selection interface, and after the selection is completed, the user can click an action button which is preset in the selection interface and used for determining to add the selected sub-video, so that the addition of the sub-video in the editing interface is completed. The sub-video selected by the user may be a sub-video stored locally by the terminal, or may be a URL (uniform resource Locator) of the sub-video, which is not limited in this embodiment of the present invention.
After the sub-videos are added into the editing interface, the sub-videos all have default original display position attributes and original playing time attributes, and at this time, a user can edit the original display position attributes and the original playing time attributes of any sub-video, for example, each parameter in table 1 can be displayed to the user through a visual interactive interface, and the user sets parameter values of each parameter respectively; after the editing is finished, the target display position attribute and the target playing time attribute of the sub-video are obtained, and the like is repeated for other sub-videos. In practical applications, a sub-video may be referred to by multiple video sets, and then the sub-video may have multiple display position attributes and multiple play time attributes at the same time, which are, of course, independent from each other, that is, when a user edits one of the display position attributes and the play time attributes, the other display position attributes and play time attributes are not affected.
The editing interface can also be provided with an action button for determining generation of a video set, when a user clicks the action button, a set identifier of the video set containing each sub-video can be generated, and then the association relationship between the set identifier and the sub-video identifier of each sub-video, the target display position attribute of each sub-video and the target playing time attribute of each sub-video is established.
It should be noted that the to-be-played video set may be generated in the terminal in the manner described above, or may be generated in the server, for example, the server acquires each sub-video, then the terminal sends an editing instruction of the user to the server, and the server edits each sub-video according to the editing instruction, so as to generate the to-be-played video set. Of course, the video set to be played may also be generated by the terminal and the server together, which is not limited in this embodiment of the present invention.
Further, the set identifier, each sub-video identifier, each target display position attribute, each target playing time attribute, and the association relationship may be saved.
For example, the set identifier, each sub-video identifier, each target display position attribute, each target play time attribute, and the association relation may be obtained from the local terminal when the user plays the video set.
For another example, the set identifier, each sub-video identifier, each target display position attribute, each target play time attribute, and the association relation may also be uploaded to the server, or even all the sub-videos may be uploaded to the server together, so that the terminal obtains the set identifier, each sub-video identifier, each target display position attribute, each target play time attribute, the association relation, and each sub-video from the server when the user plays the video set.
Or, each sub-video may not be generated into a video set, but each sub-video is directly played through the related parameters of each sub-video; the video set can also be directly played through the terminal after the server generates the video set.
For convenience of understanding, the terminal generates a video set and plays the generated video set.
For example, a user selects at least one sub-video in a terminal, then sets a display position attribute and a play time attribute of each sub-video, the terminal generates a set identifier including a video set of each sub-video, establishes an association relationship between the set identifier and the sub-video identifier of each sub-video, the target display position attribute of each sub-video and the target play time attribute of each sub-video, and stores the association relationship locally in the terminal.
When a user initiates a playing instruction for playing the video set, the terminal analyzes the playing instruction to obtain a set identifier, acquires each sub-video and a display position attribute and a playing time attribute corresponding to each sub-video based on the association relationship, determines a display position for displaying each sub-video in a current interface of the terminal based on the display position attribute corresponding to each sub-video, and plays each sub-video at a corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
For another example, the user selects at least one sub-video in the terminal, then sets the display position attribute and the play time attribute of each sub-video, the terminal generates a set identifier including a video set of each sub-video, establishes an association relationship between the set identifier and the sub-video identifier of each sub-video, the target display position attribute of each sub-video and the target play time attribute of each sub-video, and uploads the set identifier, each sub-video identifier, the display position attribute of each sub-video, the target play time attribute of each sub-video and the association relationship to the server.
When a user initiates a playing instruction for playing the video set, the terminal analyzes the playing instruction to obtain a set identifier, acquires each sub-video identifier corresponding to the set identifier, a display position attribute of each sub-video and a target playing time attribute of each sub-video from the server, acquires each sub-video based on each sub-video identifier, determines a display position for displaying each sub-video in a current interface of the terminal based on the display position attribute corresponding to each sub-video, and plays each sub-video at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
In the embodiment of the invention, a terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
Furthermore, the user can select a plurality of sub-videos according to the preference of the user, a video set is generated based on the plurality of sub-videos, different watching experiences can be generated by the combination of different sub-videos, and interestingness and user experience of the video set are further improved.
Fig. 4 is a schematic structural diagram of a video playing apparatus according to another embodiment of the present application, and as shown in fig. 4, the apparatus of this embodiment may include:
a receiving module 401, configured to receive a play instruction for a video set to be played; the video set to be played comprises at least one sub video;
an obtaining module 402, configured to obtain each sub-video based on the playing instruction, and a display position attribute and a playing time attribute corresponding to each sub-video;
a determining module 403, configured to determine, based on a display position attribute corresponding to each sub-video, a display position at which each sub-video is displayed in a current interface of the terminal;
and the playing module 404 is configured to play each sub-video at a corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video.
In a preferred embodiment of the present invention, the display position attributes of the sub video include coordinates, size, and display hierarchy;
the determining module comprises:
the first acquisition submodule is used for acquiring the respective coordinates, sizes and display levels of the sub videos;
and the first processing submodule is used for determining the display position of each sub-video based on the coordinates and the size of each sub-video and setting the display position as a display hierarchy.
In a preferred embodiment of the present invention, the playing time attribute of the sub-video includes a playing time length, an initial playing time and an initial playing position; the starting playing time is the time point when each sub video starts playing in the video set to be played, and the starting playing position is the time point when each sub video starts playing;
the playing module is specifically configured to:
and displaying each corresponding sub-video at each display position in the current interface of the terminal, and playing each sub-video based on the initial playing time, the initial playing position and the playing duration of each sub-video.
In a preferred embodiment of the present invention, the video set to be played is generated as follows:
when a video set generation instruction is received, displaying a preset editing interface;
acquiring each sub video used for generating a video set to be played according to a received selection instruction aiming at least one sub video;
editing the original display position attribute and the original playing time attribute of each sub-video according to the received editing instruction for each sub-video to obtain the edited target display position attribute and the edited target playing time attribute of each sub-video;
and generating a set identifier of a video set to be played, and establishing an association relation between the set identifier and the sub-video identifier of each sub-video, the target display position attribute of each sub-video and the target playing time attribute of each sub-video.
In a preferred embodiment of the present invention, the obtaining module includes:
the second obtaining submodule is used for obtaining a set identifier of a video set to be played in the playing instruction;
a third obtaining submodule, configured to obtain each sub-video identifier having an association relationship with the set identifier, a target display position attribute of each sub-video, and a target play time attribute of each sub-video, use the target display position attribute of each sub-video as a display position attribute corresponding to each sub-video, and use the target play time attribute of each sub-video as a play time attribute corresponding to each sub-video;
and the fourth obtaining submodule is used for obtaining each sub-video based on each sub-video identifier.
The video playing apparatus of this embodiment can execute the video playing method shown in the first embodiment of this application, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment of the invention, a terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
Furthermore, the user can select a plurality of sub-videos according to the preference of the user, a video set is generated based on the plurality of sub-videos, different watching experiences can be generated by the combination of different sub-videos, and interestingness and user experience of the video set are further improved.
In another embodiment of the present application, there is provided an electronic device including: a memory and a processor; at least one program, stored in the memory for execution by the processor, to implement: the terminal receives a playing instruction for a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
In an alternative embodiment, an electronic device is provided, as shown in fig. 5, the electronic device 5000 shown in fig. 5 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The processor 5001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI bus or EISA bus, etc. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The memory 5003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the teachings of any of the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as smart televisions, desktop computers, and the like.
Yet another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when run on a computer, enables the computer to perform the corresponding content in the aforementioned method embodiments. Compared with the prior art, the terminal receives a playing instruction aiming at a video set to be played; the video set to be played comprises at least one sub video; and then, each sub-video is obtained based on the playing instruction, and the display position attribute and the playing time attribute corresponding to each sub-video are obtained, the display position for displaying each sub-video in the current interface of the terminal is determined based on the display position attribute corresponding to each sub-video, and each sub-video is played at the corresponding display position in the current interface of the terminal based on the playing time attribute corresponding to each sub-video. Through the mode, the user can watch the video set comprising the sub-videos in the current interface of the terminal, the utilization rate of the current interface of the terminal is fully utilized, and compared with the situation that only one video is played in the current interface, the interest of the video can be greatly improved by playing the video set, so that the user experience is improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.