Video preview method and apparatus
Abstract
This application provides video preview techniques. The techniques comprise detecting a preview operation performed on a target video cover in a video preview page, and determining an operation duration of the preview operation, wherein the video preview page comprises video covers of at least two videos, a page container is provided at a position where each video cover is displayed in the video preview page, and each page container is configured to detect a preview operation performed on a corresponding video cover; determining a player container associated with a page container of the target video cover when the operation duration reaches a duration threshold, wherein the player container is configured to carry a target player of playing video content; loading the target player carried in the player container, and playing video content corresponding to the target video cover at a position of the target video cover through the target player.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method of implementing video preview, comprising:
detecting a preview operation performed on a target video cover in a video preview page, wherein the video preview page comprises a plurality of video covers corresponding to a plurality of videos, wherein a page container is provided at a position where each video cover is displayed in the video preview page, and wherein each page container is configured to detect a preview operation performed on a corresponding video cover; determining whether an operation duration of the preview operation reaches a duration threshold; determining a player container associated with a page container of the target video cover in response to determining that the operation duration of the preview operation reaches the duration threshold, wherein the player container is configured to carry a target player of playing content of a video corresponding to the target video cover, wherein the player container is embedded as a sub-element of the page container of the target video cover, and wherein the page container is configured to monitor the preview operation performed on the target video cover; loading the target player carried in the player container associated with the page container of the target video cover; playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player; detecting, by the page container, whether the preview operation on the target video cover is cancelled; and controlling the target player to pause playback of the content of the video based on the page container detecting that the preview operation on the target video cover is cancelled.
2 . The method according to claim 1 , wherein before detecting the preview operation performed on the target video cover in the video preview page, the method further comprises:
obtaining video metadata and a playback parameter that correspond to the target video cover; creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter; and creating the player container based on the target player.
3 . The method according to claim 2 , wherein the method further comprises:
separately encapsulating player instances corresponding to a plurality of video types before creating the target player of playing the video corresponding to the target video cover; and wherein the creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter further comprises:
parsing the video metadata,
determining a target video type and a content identifier that correspond to the target video cover based on the video metadata,
invoking a player instance corresponding to the target video type based on the target video type, wherein the player instance is among the encapsulated player instances corresponding to the plurality of video types, and
creating the target player corresponding to the target video cover based on the player instance, the content identifier, and the playback parameter.
4 . The method according to claim 1 , wherein the method further comprises:
encapsulating an intermediate operation layer, wherein the intermediate operation layer is configured to determine a playback operation corresponding to the detected preview operation; and wherein the playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player comprises: determining the playback operation corresponding to the preview operation through the encapsulated intermediate operation layer, and controlling, based on the playback operation, the target player to play the content of the video corresponding to the target video cover at the position of the target video cover in the video preview page.
5 . The method according to claim 1 , wherein before the loading the target player carried in the player container, the method further comprises:
determining whether the preview operation is a preview operation first detected for the target video cover in a first preset duration; and in response to determining that the preview operation is the preview operation first detected for the target video cover in the first preset duration, loading the target player carried in the player container associated with the page container of the target video cover.
6 . The method according to claim 1 , wherein the loading the target player and the playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player further comprises:
determining whether an initialization of the target player is completed; initializing the target player in response to determining that the initialization of the target player is not completed; and playing the content of the video corresponding to the target video cover at the position of the target video cover through the target player after completing the initialization.
7 . The method according to claim 1 , wherein the method further comprises:
determining whether there is a playback permission of playing the content of the video corresponding to the target video cover before playing the content of the video in the video preview page through the target player; in response to determining that there is the playback permission, determining whether the preview operation is cancelled; and in response to determining that the preview operation is not cancelled, playing the content of the video corresponding to the target video cover at the position of the target video cover through the target player.
8 . The method according to claim 1 , wherein the method further comprises:
determining whether the preview operation is cancelled after determining that an initialization of the target player is completed; and in response to determining that the preview operation is not cancelled, playing the content of the video corresponding to the target video cover at the position of the target video cover through the target player.
9 . The method according to claim 1 , wherein while playing the content of the video corresponding to the target video cover at the position of the target video cover through the target player, the method further comprises:
in response to detecting that the preview operation is cancelled, determining whether another preview operation is detected for the target video cover in a second preset duration from a cancellation of the preview operation; and disabling the target player in response to determining that no preview operation is detected in the second preset duration from the cancellation of the preview operation.
10 . The method according to claim 1 , wherein the method further comprises:
feeding back to the page container information indicative of a loading state or a playback state of the target player.
11 . A computing device, comprising:
a memory and a processor, wherein the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions to implement operations comprising: detecting a preview operation performed on a target video cover in a video preview page, wherein the video preview page comprises a plurality of video covers corresponding to a plurality of videos, wherein a page container is provided at a position where each video cover is displayed in the video preview page, and wherein each page container is configured to detect a preview operation performed on a corresponding video cover; determining whether an operation duration of the preview operation reaches a duration threshold; determining a player container associated with a page container of the target video cover in response to determining that the operation duration of the preview operation reaches the duration threshold, wherein the player container is configured to carry a target player of playing content of a video corresponding to the target video cover, wherein the player container is embedded as a sub-element of the page container of the target video cover, and wherein the page container is configured to monitor the preview operation performed on the target video cover; loading the target player carried in the player container associated with the page container of the target video cover; playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player; detecting, by the page container, whether the preview operation on the target video cover is cancelled; and controlling the target player to pause playback of the content of the video based on the page container detecting that the preview operation on the target video cover is cancelled.
12 . The computing device according to claim 11 , wherein before detecting the preview operation performed on the target video cover in the video preview page, the operations further comprise:
obtaining video metadata and a playback parameter that correspond to the target video cover; creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter; and creating the player container based on the target player.
13 . The computing device according to claim 12 , the operations further comprising:
separately encapsulating player instances corresponding to a plurality of video types before creating the target player of playing the video corresponding to the target video cover; and wherein the creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter further comprises:
parsing the video metadata,
determining a target video type and a content identifier that correspond to the target video cover based on the video metadata,
invoking a player instance corresponding to the target video type, wherein the player instance is among the encapsulated player instances corresponding to the plurality of video types, and
creating the target player corresponding to the target video cover based on the player instance, the content identifier, and the playback parameter.
14 . The computing device according to claim 11 , the operations further comprising:
encapsulating an intermediate operation layer, wherein the intermediate operation layer is configured to determine a playback operation corresponding to the detected preview operation; and wherein the playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player comprises:
determining the playback operation corresponding to the preview operation through the encapsulated intermediate operation layer, and
controlling, based on the playback operation, the target player to play the content of the video corresponding to the target video cover at the position of the target video cover in the video preview page.
15 . The computing device according to claim 11 , the operations further comprising:
determining whether there is a playback permission of playing the content of the video corresponding to the target video cover before playing the content of the video through the target player; determining whether the preview operation is cancelled in response to determining that there is the playback permission; and playing the content of the video corresponding to the target video cover in the video preview page through the target player in response to determining that the preview operation is not cancelled.
16 . The computing device according to claim 11 , wherein while playing the content of the video corresponding to the target video cover at the position of the target video cover through the target player, the operations further comprise:
in response to detecting that the preview operation is cancelled, determining whether another preview operation is detected for the target video cover in a second preset duration from a cancellation of the preview operation; and disabling the target player in response to determining that no preview operation is detected in the second preset duration from the cancellation of the preview operation.
17 . The computing device according to claim 11 , the operations further comprising:
feeding back to the page container information indicative of a loading state or a playback state of the target player.
18 . A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the computer-executable instructions cause the processor to implement operations comprising:
detecting a preview operation performed on a target video cover in a video preview page, wherein the video preview page comprises a plurality of video covers corresponding to a plurality of videos, wherein a page container is provided at a position where each video cover is displayed in the video preview page, and wherein each page container is configured to detect a preview operation performed on a corresponding video cover; determining whether an operation duration of the preview operation reaches a duration threshold; determining a player container associated with a page container of the target video cover in response to determining that the operation duration of the preview operation reaches the duration threshold, wherein the player container is configured to carry a target player of playing content of a video corresponding to the target video cover, wherein the player container is embedded as a sub-element of the page container of the target video cover, and wherein the page container is configured to monitor the preview operation performed on the target video cover; loading the target player carried in the player container associated with the page container of the target video cover; playing content of the video corresponding to the target video cover at a position of the target video cover in the video preview page through the target player; detecting, by the page container, whether the preview operation on the target video cover is cancelled; and controlling the target player to pause playback of the content of the video based on the page container detecting that the preview operation on the target video cover is cancelled.
19 . The non-transitory computer-readable storage medium according to claim 18 , wherein before detecting the preview operation performed on the target video cover in the video preview page, the operations further comprise:
obtaining video metadata and a playback parameter that correspond to the target video cover; creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter; and creating the player container based on the target player.
20 . The non-transitory computer-readable storage medium according to claim 19 , the operations further comprising:
separately encapsulating player instances corresponding to a plurality of video types before creating the target player of playing the video corresponding to the target video cover; and wherein the creating the target player of playing the video corresponding to the target video cover based on the video metadata and the playback parameter further comprises:
parsing the video metadata,
determining a target video type and a content identifier that correspond to the target video cover based on the video metadata,
invoking a player instance corresponding to the target video type, wherein the player instance is among the encapsulated player instances corresponding to the plurality of video types, and
creating the target player corresponding to the target video cover based on the player instance, the content identifier, and the playback parameter.Join the waitlist — get patent alerts
Track US12604070B2 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.