






技术领域technical field
本申请实施例涉及计算机技术领域,具体涉及视频合并播放方法和设备。The embodiments of the present application relate to the field of computer technology, and in particular to a video combined playback method and device.
背景技术Background technique
随着移动互联网的飞速发展,各种各样的应用层出不穷。其中,短视频应用占据了很大一部分。目前,用户在使用短视频应用的过程中,会存在频繁的视频切换。而视频切换消耗大,尤其是网上缓存时延更大。对于这种情况,常见的解决方式是将视频缓存到本地,存到磁盘,等到切换时由播放器加载本地视频。With the rapid development of the mobile Internet, various applications emerge in endlessly. Among them, short video applications account for a large part. Currently, users frequently switch between videos when using short video applications. However, video switching consumes a lot of energy, especially the online cache delay is greater. For this situation, a common solution is to cache the video locally, save it to disk, and wait until the player loads the local video when switching.
发明内容Contents of the invention
本申请实施例提出了视频合并播放方法和设备。The embodiment of the present application proposes a method and device for combined video playback.
第一方面,本申请实施例提供了一种视频合并播放方法,包括:采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间;获取视频列表中的视频对应的控制指令;在视频列表中的视频后插入对应的控制指令;按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。In the first aspect, the embodiment of the present application provides a combined video playback method, including: caching the video list by caching while downloading, and reserving cache space for the undownloaded part of the video in the video list; The control instruction corresponding to the video in the video list; the corresponding control instruction is inserted after the video in the video list; the video list is played in sequence, and in response to triggering the control instruction, the playback state of the corresponding video is controlled based on the control instruction.
在一些实施例中,该方法还包括:若对应视频播放结束,基于控制指令继续控制后续视频的播放状态。In some embodiments, the method further includes: if the playing of the corresponding video ends, continuing to control the playing state of the subsequent video based on the control instruction.
在一些实施例中,控制指令包括以下至少一种类型:播放指令、用户控制指令,播放指令通过指令服务器生成,且在视频播放结束时触发,包括以下至少一项:重播、播放下一条、播放上一条,用户控制指令基于用户操作生成,且即时触发,包括以下至少一项:快进、快退、慢进、慢退。In some embodiments, the control instruction includes at least one of the following types: play instruction, user control instruction, the play instruction is generated by the instruction server, and is triggered when the video playback ends, including at least one of the following: replay, play next, play In the previous article, user control instructions are generated based on user operations and triggered immediately, including at least one of the following: fast forward, fast rewind, slow forward, and slow rewind.
在一些实施例中,获取视频列表中的视频对应的控制指令,包括:在用户界面显示当前播放的视频;响应于检测到用户在用户界面上的用户操作,将用户操作的数据发送给指令控制器;接收指令控制器基于用户操作的数据生成的用户控制指令。In some embodiments, obtaining the control instructions corresponding to the videos in the video list includes: displaying the currently played video on the user interface; in response to detecting the user operation on the user interface, sending the data of the user operation to the instruction control device; receiving the user control instruction generated by the instruction controller based on the data operated by the user.
在一些实施例中,响应于触发控制指令,基于控制指令控制对应视频的播放状态,包括:若用户操作发生在一个视频内,基于用户控制指令控制一个视频的播放状态。In some embodiments, in response to triggering the control instruction, controlling the playback state of the corresponding video based on the control instruction includes: if the user operation occurs in a video, controlling the playback state of a video based on the user control instruction.
在一些实施例中,响应于触发控制指令,基于控制指令控制对应视频的播放状态,还包括:若用户操作发生在至少两个视频间,基于用户控制指令控制至少两个视频中的一个视频的播放状态;以及基于控制指令继续控制后续视频的播放状态,包括:若一个视频播放结束,跳转播放至少两个视频中的下一个视频,以及基于用户控制指令继续控制至少两个视频中的下一个视频的播放状态。In some embodiments, in response to triggering the control instruction, controlling the playback state of the corresponding video based on the control instruction further includes: if the user operation occurs between at least two videos, controlling the playback status of one of the at least two videos based on the user control instruction Play state; and continue to control the play state of subsequent videos based on control instructions, including: if a video ends, jump to play the next video in at least two videos, and continue to control the next video in at least two videos based on user control instructions The playback state of a video.
在一些实施例中,视频列表中的视频预先被统一格式转换成与客户端的播放器匹配。In some embodiments, the videos in the video list are pre-converted into a unified format to match the player of the client.
在一些实施例中,视频列表中的视频的缓存空间由视频列表中的视频的大小决定。In some embodiments, the cache space of the videos in the video list is determined by the size of the videos in the video list.
第二方面,本申请实施例提供了一种视频合并播放装置,包括:缓存单元,被配置成采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间;获取单元,被配置成获取视频列表中的视频对应的控制指令;插入单元,被配置成在视频列表中的视频后插入对应的控制指令;第一控制单元,被配置成按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。In the second aspect, the embodiment of the present application provides a combined video playback device, including: a cache unit, configured to cache the video list in a manner of caching while downloading, and reserve the cache for the undownloaded part of the video in the video list space; the acquisition unit is configured to acquire the control instructions corresponding to the videos in the video list; the insertion unit is configured to insert the corresponding control instructions after the videos in the video list; the first control unit is configured to play the videos in order list, and in response to triggering the control instruction, control the playing state of the corresponding video based on the control instruction.
在一些实施例中,该装置还包括:第二控制单元,被配置成若对应视频播放结束,基于控制指令继续控制后续视频的播放状态。In some embodiments, the device further includes: a second control unit configured to continue to control the playing state of the subsequent video based on the control instruction if the corresponding video is played.
在一些实施例中,控制指令包括以下至少一种类型:播放指令、用户控制指令,播放指令通过指令服务器生成,且在视频播放结束时触发,包括以下至少一项:重播、播放下一条、播放上一条,用户控制指令基于用户操作生成,且即时触发,包括以下至少一项:快进、快退、慢进、慢退。In some embodiments, the control instruction includes at least one of the following types: play instruction, user control instruction, the play instruction is generated by the instruction server, and is triggered when the video playback ends, including at least one of the following: replay, play next, play In the previous article, user control instructions are generated based on user operations and triggered immediately, including at least one of the following: fast forward, fast rewind, slow forward, and slow rewind.
在一些实施例中,获取单元进一步被配置成:在用户界面显示当前播放的视频;响应于检测到用户在用户界面上的用户操作,将用户操作的数据发送给指令控制器;接收指令控制器基于用户操作的数据生成的用户控制指令。In some embodiments, the acquisition unit is further configured to: display the currently played video on the user interface; in response to detecting the user operation on the user interface, send the data of the user operation to the instruction controller; receive the instruction controller User control instructions generated based on data from user actions.
在一些实施例中,第一控制单元进一步被配置成:若用户操作发生在一个视频内,基于用户控制指令控制一个视频的播放状态。In some embodiments, the first control unit is further configured to: if the user operation occurs in a video, control the playback state of a video based on a user control instruction.
在一些实施例中,第一控制单元进一步被配置成:若用户操作发生在至少两个视频间,基于用户控制指令控制至少两个视频中的一个视频的播放状态;以及第二控制单元进一步被配置成:若一个视频播放结束,跳转播放至少两个视频中的下一个视频,以及基于用户控制指令继续控制至少两个视频中的下一个视频的播放状态。In some embodiments, the first control unit is further configured to: if the user operation occurs between at least two videos, control the playback state of one of the at least two videos based on user control instructions; and the second control unit is further configured to The configuration is as follows: if one video ends playing, jump to play the next video of the at least two videos, and continue to control the playback state of the next video of the at least two videos based on the user control instruction.
在一些实施例中,视频列表中的视频预先被统一格式转换成与客户端的播放器匹配。In some embodiments, the videos in the video list are pre-converted into a unified format to match the player of the client.
在一些实施例中,视频列表中的视频的缓存空间由视频列表中的视频的大小决定。In some embodiments, the cache space of the videos in the video list is determined by the size of the videos in the video list.
第三方面,本申请实施例提供了一种计算机设备,该计算机设备包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的方法。In a third aspect, the embodiment of the present application provides a computer device, which includes: one or more processors; a storage device, on which one or more programs are stored; when one or more programs are used by one or more processors, so that one or more processors implement the method described in any implementation manner in the first aspect.
第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面中任一实现方式描述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.
本申请实施例提供的视频合并播放方法和设备,首先采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间;之后获取视频列表中的视频对应的控制指令;然后在视频列表中的视频后插入对应的控制指令;最后按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。通过适当的内存管理和指令管理来提升视频切换效率,解决视频卡顿问题。In the method and device for combined video playback provided by the embodiments of the present application, first, the video list is cached by caching while downloading, and a cache space is reserved for the undownloaded part of the video in the video list; then the video corresponding to the video in the video list is acquired control instructions; then insert corresponding control instructions after the videos in the video list; finally play the video list in sequence, and control the playback status of the corresponding videos based on the control instructions in response to triggering the control instructions. Through proper memory management and command management, video switching efficiency can be improved, and the video freeze problem can be solved.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1是本申请可以应用于其中的示例性系统架构;FIG. 1 is an exemplary system architecture to which the present application can be applied;
图2是根据本申请的视频合并播放方法的一个实施例的流程图;Fig. 2 is the flow chart of an embodiment of the method for combining videos according to the present application;
图3是根据本申请的视频合并播放方法的又一个实施例的流程图;Fig. 3 is the flow chart of another embodiment of the combined video playing method according to the present application;
图4是可以应用于本申请的视频合并播放方法的场景图;Fig. 4 is the scene diagram that can be applied to the video combined playing method of the present application;
图5是视频列表的示意图;Fig. 5 is a schematic diagram of a video list;
图6是视频间的指令控制的示意图;Fig. 6 is a schematic diagram of command control between videos;
图7是适于用来实现本申请实施例的计算机设备的计算机系统的结构示意图。Fig. 7 is a schematic structural diagram of a computer system suitable for implementing the computer device of the embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.
图1示出了可以应用本申请的视频合并播放方法的实施例的示例性系统架构100。FIG. 1 shows an
如图1所示,系统架构100中可以包括设备101、102和网络103。网络103用以在设备101、102之间提供通信链路的介质。网络103可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , a
设备101、102可以是支持网络连接从而提供各种网络服务的硬件设备或软件。当设备为硬件时,其可以是各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机、台式计算机和服务器等等。这时,作为硬件设备,其可以实现成多个设备组成的分布式设备群,也可以实现成单个设备。当设备为软件时,可以安装在上述所列举的电子设备中。这时,作为软件,其可以实现成例如用来提供分布式服务的多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。The
在实践中,设备可以通过安装相应的客户端应用或服务端应用来提供相应的网络服务。设备在安装了客户端应用之后,其可以在网络通信中体现为客户端。相应地,在安装了服务端应用之后,其可以在网络通信中体现为服务端。In practice, the device can provide corresponding network services by installing corresponding client applications or server applications. After the client application is installed on the device, it can be represented as a client in network communication. Correspondingly, after the server application is installed, it can be embodied as a server in network communication.
作为示例,在图1中,设备101体现为客户端,而设备102体现为服务端。例如,设备101可以是短视频应用的客户端,设备102可以是短视频应用的服务端。As an example, in FIG. 1 ,
需要说明的是,本申请实施例所提供的视频合并播放方法可以由设备101执行。It should be noted that the combined video playing method provided in the embodiment of the present application may be executed by the
应该理解,图1中的网络和设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的网络和设备。It should be understood that the number of networks and devices in FIG. 1 is merely illustrative. There can be any number of networks and devices depending on implementation needs.
继续参考图2,其示出了根据本申请的视频合并播放方法的一个实施例的流程200。该视频合并播放方法包括以下步骤:Continue to refer to FIG. 2 , which shows a
步骤201,采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间。In
在本实施例中,当用户打开短视频应用时,短视频应用的客户端(例如图1所示的设备101)可以向短视频应用的服务端(例如图1所示的设备102)发送视频列表请求。服务端可以向客户端推送包括但不限于用户喜爱的或用户好友发布的视频组成的视频列表。然后,客户端可以采用边下载边缓存的方式从服务端下载并缓存视频列表。In this embodiment, when the user opens the short video application, the client of the short video application (such as the
通常,客户端缓存的视频列表中的视频不是完整的视频,仅包含视频的一部分。而客户端会为视频列表中的视频的未下载部分预留缓存空间,以便于给视频的后续下载使用。这样,就能尽快达到起播状态。其中,缓存空间可以用于缓存视频。为了避免客户端缓存浪费,可以基于视频的大小来确定缓存空间的大小。当然,在客户端缓存充足的情况下,也可以确定视频列表中的最大视频的大小,为每个视频都预留不小于最大视频的大小的缓存空间。Usually, the videos in the video list cached by the client are not complete videos, but only part of the video. And the client will reserve cache space for the undownloaded part of the video in the video list, so as to be used for subsequent downloading of the video. In this way, the starting state can be reached as soon as possible. Among them, the cache space can be used to cache video. In order to avoid wasting the cache on the client side, the size of the cache space can be determined based on the size of the video. Certainly, in the case that the client cache is sufficient, the size of the largest video in the video list may also be determined, and a cache space not smaller than the size of the largest video is reserved for each video.
在一些实施例中,短视频应用的服务端中存储的视频的格式多样,包括但不限于MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)、FLV(Flash Video,流媒体格式)等等。如果直接从服务端下载视频列表,客户端的播放器不仅需要支持播放多种格式的视频,还需要在不同格式的视频中进行切换,增加视频切换耗时。因此,服务端可以对视频列表中的视频进行统一格式转换。例如,经过转码器转换成统一格式的视频。而具体转换成的格式需要与客户端的播放器匹配。其中,客户端的播放器支持的格式就是与客户端的播放器匹配的格式。例如,客户端的播放器支持MP4,则可以统一转换成MP4。又例如,客户端的播放器同时支持MP4和FLV,则既可以统一转换成MP4,也可以统一转换成FLV。In some embodiments, the format of the video stored in the server of the short video application is various, including but not limited to MP4 (Moving Picture Experts Group Audio Layer IV, moving picture expert compression standard audio level 4), FLV (Flash Video, stream media format), etc. If the video list is directly downloaded from the server, the client player not only needs to support playing videos in multiple formats, but also needs to switch between videos in different formats, which increases the time-consuming of video switching. Therefore, the server can perform uniform format conversion on the videos in the video list. For example, a video converted into a unified format by a transcoder. The specific converted format needs to match the client's player. Wherein, the format supported by the player of the client is the format matching the player of the client. For example, if the player of the client supports MP4, it can be converted into MP4 uniformly. For another example, if the player of the client side supports both MP4 and FLV, it can be converted into MP4 or FLV in a unified manner.
步骤202,获取视频列表中的视频对应的控制指令。
在本实施例中,视频列表中的每个视频都可以插入控制指令。客户端可以获取视频列表中的每个视频对应的控制指令。In this embodiment, control instructions can be inserted into each video in the video list. The client can acquire the control instruction corresponding to each video in the video list.
通常,控制指令可以指明视频的播放逻辑,如播放完毕之后是重播还是播放下一条等。控制指令可以包括但不限于以下至少一种类型:播放指令、用户控制指令等等。其中,指令服务器可以根据默认播放逻辑生成播放指令。播放指令可以在视频播放结束时触发,包括但不限于以下至少一项:重播、播放下一条、播放上一条等等。指令控制器可以基于用户操作(如seek操作)生成用户控制指令。用户控制指令可以即时触发,包括但不限于以下至少一项:快进、快退、慢进、慢退等等。Usually, the control instruction can indicate the playing logic of the video, such as whether to replay or play the next video after the video is played. The control instruction may include but not limited to at least one of the following types: play instruction, user control instruction and so on. Wherein, the instruction server may generate the playback instruction according to the default playback logic. The playback instruction can be triggered when the video playback ends, including but not limited to at least one of the following: replay, play the next one, play the previous one, and so on. The instruction controller can generate user control instructions based on user operations (such as seek operations). The user control instruction can be triggered immediately, including but not limited to at least one of the following: fast forward, fast rewind, slow forward, slow rewind and so on.
步骤203,在视频列表中的视频后插入对应的控制指令。
在本实施例中,对于视频列表中的每个视频对应的控制指令,客户端可以将其插入在对应的视频之后。In this embodiment, for the control instruction corresponding to each video in the video list, the client may insert it after the corresponding video.
步骤204,按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。
在本实施例中,客户端的视频管理器可以将缓存的视频列表中的视频按顺序传递给客户端的播放器。这样,播放器可以按顺序播放视频列表,以使视频在客户端的用户界面显示。当触发到控制指令时,基于控制指令控制对应视频的播放状态。其中,对于播放指令,在播放到播放指令时,控制对应视频的播放状态,如重播、播放下一条、播放上一条等等。对于用户控制指令,在当前视频插入用户控制指令时,控制对应视频的播放状态,如快进、快退、拖动播放进度等等。In this embodiment, the video manager of the client may deliver the videos in the cached video list to the player of the client in order. In this way, the player can play the list of videos sequentially so that the videos are displayed on the user interface of the client. When the control instruction is triggered, the playing state of the corresponding video is controlled based on the control instruction. Wherein, for the play command, when the play command is played, the play status of the corresponding video is controlled, such as replay, next play, previous play, and so on. For the user control command, when the current video inserts the user control command, control the playback state of the corresponding video, such as fast forward, fast rewind, drag the playback progress, and so on.
在一些实施例中,控制指令除了可以控制对应视频的播放状态,还可以控制后续视频的播放状态。因此,若对应视频播放结束,基于控制指令继续控制后续视频的播放状态。例如,若用户控制当前视频倍速播放,在当前视频播放结束之后,继续倍速播放后续视频。In some embodiments, in addition to controlling the playing state of the corresponding video, the control instruction can also control the playing state of the subsequent video. Therefore, if the playing of the corresponding video ends, the playing state of the subsequent video is continued to be controlled based on the control instruction. For example, if the user controls the double-speed playback of the current video, the subsequent video will continue to be played at double-speed after the current video is played.
本申请实施例提供的视频合并播放方法,首先采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间;之后获取视频列表中的视频对应的控制指令;然后在视频列表中的视频后插入对应的控制指令;最后按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。通过适当的内存管理和指令管理来提升视频切换效率,解决视频卡顿问题。In the combined video playback method provided by the embodiment of the present application, the video list is cached first by caching while downloading, and the cache space is reserved for the undownloaded part of the video in the video list; then the control command corresponding to the video in the video list is acquired ; Then insert corresponding control instructions after the videos in the video list; finally play the video list in order, and in response to triggering the control instructions, control the playback status of the corresponding videos based on the control instructions. Through proper memory management and command management, video switching efficiency can be improved, and the video freeze problem can be solved.
进一步参考图3,其示出了是根据本申请的视频合并播放方法的又一个实施例的流程300。该视频合并播放方法包括以下步骤:Further referring to FIG. 3 , it shows a
步骤301,采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间。
在本实施例中,步骤301具体操作已在图2所示的实施例中步骤201进行了详细的介绍,在此不再赘述。In this embodiment, the specific operation of
步骤302,在用户界面显示当前播放的视频。
在本实施例中,在播放器播放视频列表中的当前视频时,在用户界面上可以显示当前播放的视频。In this embodiment, when the player plays the current video in the video list, the currently played video can be displayed on the user interface.
步骤303,响应于检测到用户在用户界面上的用户操作,将用户操作的数据发送给指令控制器。
在本实施例中,用户可以在用户界面上对当前视频进行用户操作。客户端可以采集用户操作的数据,并发送给指令控制器。In this embodiment, the user can perform user operations on the current video on the user interface. The client can collect user operation data and send it to the command controller.
这里,采用控制指令和码流结合,避免用户采用上下翻页才能切换视频。用户可以随意定义用户操作与用户控制指令对应。当执行用户操作时,会将对应的用户控制指令插入到视频中,由播放器进行解析。比如,可以定义点击操作对应视频切换指令。用户点击用户界面产生数据,传递到指令控制器生成视频切换指令。视频切换指令直接插入到当前视频末尾。播放器播放到指令时,立即执行视频切换指令,直接加载跳转到下一条视频头开始播放。界面完全不用切换,节省用户界面操作。Here, the combination of control commands and code streams is used to prevent users from turning pages up and down to switch videos. Users can freely define the correspondence between user operations and user control instructions. When a user operation is performed, the corresponding user control instruction will be inserted into the video, which will be parsed by the player. For example, it may be defined that a click operation corresponds to a video switching instruction. The user clicks on the user interface to generate data, which is transmitted to the command controller to generate a video switching command. Video switching instructions are inserted directly at the end of the current video. When the player reaches the command, it immediately executes the video switching command, directly loads and jumps to the next video head to start playing. There is no need to switch the interface at all, saving user interface operations.
步骤304,接收指令控制器基于用户操作的数据生成的用户控制指令。
在本实施例中,指令控制器可以基于用户操作的数据生成用户控制指令,并发送给客户端。In this embodiment, the instruction controller may generate a user control instruction based on user operation data and send it to the client.
步骤305,在视频列表中的视频后插入对应的控制指令。
步骤306,按顺序播放视频列表。
在本实施例中,步骤305-306具体操作已在图2所示的实施例中步骤203-204进行了详细的介绍,在此不再赘述。In this embodiment, the specific operations of steps 305-306 have been introduced in detail in steps 203-204 in the embodiment shown in FIG. 2 , and will not be repeated here.
步骤307,用户操作是否发生在一个视频内。
在本实施例中,在视频播放过程中,客户端可以确定检测到的用户操作是否发生在一个视频内。若发生在一个视频内,执行步骤308,若发生在至少两个视频间,执行步骤309。In this embodiment, during video playback, the client may determine whether the detected user operation occurs within a video. If it occurs within one video, perform
步骤308,基于用户控制指令控制一个视频的播放状态。
在本实施例中,若用户操作发生在一个视频内,客户端可以基于用户控制指令控制这一个视频的播放状态。例如,若对一个视频常规快进,则仅控制这一个视频常规快进即可。In this embodiment, if the user operation occurs in a video, the client can control the playback state of the video based on the user control instruction. For example, if a video is normally fast-forwarded, only the normal fast-forward of this video can be controlled.
步骤309,基于用户控制指令控制至少两个视频中的一个视频的播放状态。Step 309: Control the playing state of one of the at least two videos based on the user control instruction.
在本实施例中,若用户操作发生在至少两个视频间,客户端可以基于用户控制指令控制至少两个视频中的一个视频的播放状态。In this embodiment, if the user operation occurs between at least two videos, the client may control the playback state of one of the at least two videos based on the user control instruction.
步骤310,若一个视频播放结束,跳转播放至少两个视频中的下一个视频,以及基于用户控制指令继续控制至少两个视频中的下一个视频的播放状态。
在本实施例中,若一个视频播放结束,客户端可以跳转播放至少两个视频中的下一个视频,以及基于用户控制指令继续控制至少两个视频中的下一个视频的播放状态。In this embodiment, if one video is played, the client can jump to play the next video of the at least two videos, and continue to control the playback state of the next video of the at least two videos based on user control instructions.
通常,对于用户操作发生在至少两个视频间,普通的用户操作通常控制到第一个视频的末尾就结束了。而本申请实施例补充了跳转等控制指令,当控制到第一个视频的末尾时会触发控制指令,跳转到下一个视频继续控制。Usually, for user operations that occur between at least two videos, common user operations usually end at the end of the first video. However, in the embodiment of the present application, control commands such as jump are supplemented. When the control reaches the end of the first video, the control command will be triggered to jump to the next video to continue control.
从图3中可以看出,与图2对应的实施例相比,本实施例中的视频合并播放方法的流程300突出了用户操作控制步骤。由此,本实施例描述的方案用户可以基于需求进行用户操作,生成相应的用户控制指令,以控制视频的播放状态。并且,对于发生在至少两个视频间的用户操作,补充了跳转等控制指令,当控制到第一个视频的末尾时会触发控制指令,跳转到下一个视频继续控制。It can be seen from FIG. 3 that, compared with the embodiment corresponding to FIG. 2 , the
为了便于理解,图4提供了可以实现本申请的视频合并播放方法的应用场景图。如图4所示,当用户打开客户端上的短视频应用时,会向短视频应用的视频服务器发送视频列表请求。视频服务器中存储有视频1、视频2和视频3组成的视频列表。视频服务器将视频1、视频2和视频3进行视频转码为客户端的播放器支持的格式。客户端采用边下载边缓存的方式从视频服务器下载视频列表,并缓存到视频缓存中。视频缓存中的视频不是完整的视频,仅包含视频的一部分。而视频缓存会为视频列表中的视频的未下载部分预留缓存空间,以便于给视频的后续下载使用。视频列表中的视频对应的控制指令来自于指令控制器。其中,控制指令包括播放指令和用户控制指令两种类型。播放指令由指令服务器生成,经由指令控制器,插入视频列表中的视频后。客户端的视频管理器将视频缓存中的视频列表传递给播放器进行播放时,在用户界面(UI)上显示当前播放的视频。用户在用户界面上对当前视频进行用户操作。用户操作的数据会发送给指令控制器。指令控制器基于用户操作的数据生成用户控制指令,插入视频列表中的视频后。视频管理器将缓存的视频列表中的视频按顺序传递给播放器。播放器按顺序播放视频列表,视频在用户界面显示。当触发到控制指令时,基于控制指令控制对应视频的播放状态。For ease of understanding, FIG. 4 provides an application scenario diagram that can implement the combined video playing method of the present application. As shown in Figure 4, when the user opens the short video application on the client, a video list request will be sent to the video server of the short video application. A video list consisting of video 1, video 2 and video 3 is stored in the video server. The video server transcodes video 1, video 2 and video 3 into a format supported by the player of the client. The client downloads the video list from the video server by caching while downloading, and caches it in the video cache. The video in the video cache is not a complete video, it only contains a part of the video. The video cache will reserve cache space for the undownloaded part of the video in the video list, so that it can be used for subsequent downloading of the video. The control commands corresponding to the videos in the video list come from the command controller. Wherein, the control instruction includes two types of play instruction and user control instruction. The play command is generated by the command server and inserted after the video in the video list via the command controller. When the video manager of the client sends the video list in the video buffer to the player for playing, the currently playing video is displayed on the user interface (UI). The user performs user operations on the current video on the user interface. The data operated by the user will be sent to the command controller. The command controller generates a user control command based on the data operated by the user, and inserts it behind the video in the video list. The video manager delivers the videos in the cached video list to the player in order. The player plays a list of videos in order, and the videos are displayed in the user interface. When the control instruction is triggered, the playing state of the corresponding video is controlled based on the control instruction.
其中,图5示出了视频缓存中的视频列表的示意图。视频1包括视频1已下载数据和视频1未下载预留,其后插入控制指令。同理,视频2包括视频2已下载数据和视频2未下载预留,其后插入控制指令。视频2包括视频2已下载数据和视频2未下载预留,其后插入控制指令。Wherein, FIG. 5 shows a schematic diagram of a video list in the video cache. Video 1 includes the downloaded data of Video 1 and the undownloaded reservation of Video 1, and then inserts control instructions. Similarly, the video 2 includes the downloaded data of the video 2 and the undownloaded reservation of the video 2, and then inserts the control instruction. Video 2 includes the downloaded data of Video 2 and the reserved video 2 undownloaded data, and then inserts control instructions.
其中,图5示出了视频间的指令控制的示意图。若用户操作发生在视频1、视频2和视频3之间。当跳转到下一个视频时,进行指令解析,从视频1、视频2和视频3的地址中查找视频起始地址,组装指令,得到跳转地址,播放器根据跳转地址加载视频继续进行播放状态控制。Wherein, FIG. 5 shows a schematic diagram of instruction control between videos. If the user operation occurs between video 1, video 2 and video 3. When jumping to the next video, perform instruction analysis, find the video start address from the addresses of video 1, video 2 and video 3, assemble the instructions, and get the jump address, and the player loads the video according to the jump address to continue playing state control.
下面参考图7,其示出了适于用来实现本申请实施例的计算机设备(例如图1所示的设备101)的计算机系统700的结构示意图。图7示出的计算机设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring now to FIG. 7 , it shows a schematic structural diagram of a
如图7所示,计算机系统700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有系统700操作所需的各种程序和数据。CPU 701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , a
以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: an
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本申请的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via
需要说明的是,本申请的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,程序设计语言包括面向目标的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或电子设备上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of this application may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional procedural programming language—such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or electronic device. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括缓存单元、获取单元、插入单元和第一控制单元。其中,这些单元的名称在种情况下并不构成对该单元本身的限定,例如,缓存单元还可以被描述为“采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间的单元”。The units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware. The described units may also be set in a processor, for example, it may be described as: a processor includes a cache unit, an acquisition unit, an insertion unit, and a first control unit. Among them, the names of these units do not constitute a limitation of the unit itself in this case, for example, the cache unit can also be described as "caching the video list by caching while downloading, and providing information for unseen videos in the video list. Download some units with reserved cache space".
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的计算机设备中所包含的;也可以是单独存在,而未装配入该计算机设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该计算机设备执行时,使得该计算机设备:采用边下载边缓存的方式缓存视频列表,以及为视频列表中的视频的未下载部分预留缓存空间;获取视频列表中的视频对应的控制指令;在视频列表中的视频后插入对应的控制指令;按顺序播放视频列表,以及响应于触发控制指令,基于控制指令控制对应视频的播放状态。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the computer device described in the above embodiments; it may also exist independently without being assembled into the computer device. middle. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the computer device, the computer device: caches the video list by caching while downloading; Reserve cache space for the undownloaded part; obtain the corresponding control instruction of the video in the video list; insert the corresponding control instruction after the video in the video list; play the video list in order, and respond to the trigger control instruction, control based on the control instruction Corresponds to the playback state of the video.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principle. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, and should also cover the technical solutions formed by the above-mentioned technical features or without departing from the above-mentioned inventive concept. Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with technical features with similar functions disclosed in (but not limited to) this application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011253156.2ACN112437352B (en) | 2020-11-11 | 2020-11-11 | Method and device for combined video playback |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011253156.2ACN112437352B (en) | 2020-11-11 | 2020-11-11 | Method and device for combined video playback |
| Publication Number | Publication Date |
|---|---|
| CN112437352A CN112437352A (en) | 2021-03-02 |
| CN112437352Btrue CN112437352B (en) | 2023-02-17 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011253156.2AActiveCN112437352B (en) | 2020-11-11 | 2020-11-11 | Method and device for combined video playback |
| Country | Link |
|---|---|
| CN (1) | CN112437352B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113301424B (en)* | 2021-05-21 | 2023-07-11 | 北京字跳网络技术有限公司 | Play control method, device, storage medium and program product |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009301640A (en)* | 2008-06-12 | 2009-12-24 | Fujitsu Ten Ltd | Reproduction control device, method, and program |
| CN109391843B (en)* | 2017-08-03 | 2022-02-25 | 腾讯科技(深圳)有限公司 | Online video speed doubling playing method, device, medium and intelligent terminal |
| CN107547940B (en)* | 2017-09-13 | 2019-11-12 | 广州酷狗计算机科技有限公司 | Video playing processing method, equipment and computer readable storage medium |
| CN108566519B (en)* | 2018-04-28 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Video production method, device, terminal and storage medium |
| CN111385660B (en)* | 2018-12-28 | 2022-07-12 | 广州市百果园信息技术有限公司 | Video on demand method, device, equipment and storage medium |
| CN111510789B (en)* | 2019-01-30 | 2021-09-21 | 上海哔哩哔哩科技有限公司 | Video playing method, system, computer equipment and computer readable storage medium |
| CN110366024A (en)* | 2019-07-01 | 2019-10-22 | 北京达佳互联信息技术有限公司 | A kind of method and device playing video |
| CN110856031B (en)* | 2019-11-18 | 2022-01-18 | 广州市百果园信息技术有限公司 | Media resource display system, method, equipment and storage medium |
| CN110996134B (en)* | 2019-12-23 | 2022-09-09 | 腾讯科技(深圳)有限公司 | Video playing method, device and storage medium |
| CN111405346A (en)* | 2020-03-20 | 2020-07-10 | 北京字节跳动网络技术有限公司 | Video stream playback control method, device and storage medium |
| Publication number | Publication date |
|---|---|
| CN112437352A (en) | 2021-03-02 |
| Publication | Publication Date | Title |
|---|---|---|
| EP4021000B1 (en) | Video playback method, device, apparatus, and storage medium | |
| US10051013B2 (en) | Method and apparatus for streaming multimedia content of server by using cache | |
| KR101207050B1 (en) | Support for interactive palyback devices for performance aware peer-to-peer content-on-demand service | |
| US8539535B2 (en) | Methods and apparatus for supporting VOD requests in a system with hierarchical content stores | |
| US20230224545A1 (en) | Video playback method and apparatus, storage medium, and electronic device | |
| KR102658020B1 (en) | Techniques for advancing playback of interactive media titles in response to user selections | |
| CN108769816B (en) | Video playing method, device and storage medium | |
| CN110381326A (en) | Video system and processing method, equipment and computer-readable medium | |
| CN114040245B (en) | Video playing method and device, computer storage medium and electronic equipment | |
| US20240118864A1 (en) | Method and device for mixedly playing a program | |
| CN114201705A (en) | Video processing method and device, electronic equipment and storage medium | |
| CN112437352B (en) | Method and device for combined video playback | |
| MX2008016087A (en) | Methods and system to provide references associated with data streams. | |
| CN113766321B (en) | Video playback method, device, equipment and storage medium | |
| CN117156224A (en) | Video processing method, device, electronic equipment and storage medium | |
| US20050132411A1 (en) | Information providing system and information providing method, content recording apparatus and content recording method, and computer program | |
| WO2021119052A9 (en) | Methods and systems for trick play using partial video file chunks | |
| CN113457130B (en) | Game content playback method and device, readable storage medium and electronic equipment | |
| CN114302228A (en) | Interactive video playback method, system and storage medium | |
| CN119988766A (en) | Video playback method, device, equipment and storage medium | |
| WO2025103508A1 (en) | Information interaction method and apparatus, and device, medium and program product | |
| WO2024036979A9 (en) | Multimedia resource playback method and related apparatus | |
| CN117130740A (en) | A data processing method, device, terminal equipment and medium | |
| CN117812295A (en) | Display equipment and method for continuously playing media assets | |
| CN120166249A (en) | A display device, storage server and method for continuing to broadcast screen content |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | Address after:312599 Affiliated Building B-2, 3rd Floor, Jiayi Plaza, 127 Renmin East Road, Nanming Street, Xinchang County, Shaoxing City, Zhejiang Province Patentee after:Xin Chang Lian Shang Network Technology Group Co., Ltd. Country or region after:China Address before:312599 Affiliated Building B-2, 3rd Floor, Jiayi Plaza, 127 Renmin East Road, Nanming Street, Xinchang County, Shaoxing City, Zhejiang Province Patentee before:LIANSHANG (XINCHANG) NETWORK TECHNOLOGY Co.,Ltd. Country or region before:China |