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

Video playing method and device and electronic equipment Download PDF

Info

Publication number
CN110996154A
CN110996154A CN201911285281.9A CN201911285281A CN110996154A CN 110996154 A CN110996154 A CN 110996154A CN 201911285281 A CN201911285281 A CN 201911285281A CN 110996154 A CN110996154 A CN 110996154A
Authority
CN
China
Prior art keywords
video
view
played
visible
views
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911285281.9A
Other languages
Chinese (zh)
Other versions
CN110996154B (en
Inventor
刘健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing IQIYI Science and Technology Co Ltd
Original Assignee
Beijing IQIYI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing IQIYI Science and Technology Co Ltd filed Critical Beijing IQIYI Science and Technology Co Ltd
Priority to CN201911285281.9A priority Critical patent/CN110996154B/en
Publication of CN110996154A publication Critical patent/CN110996154A/en
Application granted granted Critical
Publication of CN110996154B publication Critical patent/CN110996154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides a video playing method, a video playing device and electronic equipment, wherein the method comprises the following steps: determining visible video views in a visible state in an information flow page, selecting a video view to be played from the visible video views, acquiring video data of a video represented by the video view to be played from a server, adding a player for the video view to be played, and controlling the player to play the video data. By applying the scheme provided by the embodiment of the invention to play the video, the terminal only needs to add a player for the video view to be played, and does not need to add a player for each video view in the information flow page respectively by the server, so that the consumption of the memory of the terminal when the App in the terminal displays the information flow page can be reduced.

Description

Video playing method and device and electronic equipment
Technical Field
The present invention relates to the field of video application technologies, and in particular, to a video playing method and apparatus, and an electronic device.
Background
When a person uses an information browsing Application (App) on a terminal, the App may browse information provided by an information flow page. The information flow page typically includes teletext information, advertising information, video views, etc. In order to give the user a better experience, the terminal will typically automatically play the video represented by the displayed video view when the video view in the information flow page is displayed on the screen of the terminal.
In the prior art, in order to enable a terminal to automatically play a video represented by a video view displayed on a terminal screen in an information flow page, a server usually adds a player to each video view in the information flow page.
However, when there are many video views included in the streaming page, a player is added to each video view in the streaming page. That is, the information flow page includes multiple players, which results in a large data volume of the information flow page, and thus causes the App in the terminal to occupy a large memory of the terminal when displaying the information flow page.
Disclosure of Invention
The embodiment of the invention aims to provide a video playing method, a video playing device and electronic equipment, so as to reduce the consumption of a terminal memory when an App in the terminal displays an information stream page. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video playing method, where the method includes:
determining a visible video view in a visible state in an information flow page, wherein a player is not added to the video view in the information flow page;
selecting a video view to be played from the visible video views;
acquiring video data of a video represented by the video view to be played from a server;
and adding a player for the video view to be played, and controlling the player to play the video data.
Optionally, the selecting a video view to be played from the visible video views includes:
judging whether all displayed first-class video views exist in the visible video views;
if the first type of video views exist, selecting video views to be played from the first type of video views;
if the first type of video view does not exist, selecting a video view to be played from a second type of video view, wherein the second type of video view is as follows: a partially displayed video view in the visible video view.
Optionally, the second type of video view is: the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed.
Optionally, the selecting a video view to be played from the visible video views includes:
and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
Optionally, the selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation includes:
when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
Optionally, the selecting a video view to be played from the visible video views includes:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
Optionally, the selecting, from the visible video views, a video view with a display position closest to the center of the screen as a video view to be played includes:
when a plurality of video views with display positions closest to the center of a screen exist in the visible video views, monitoring sliding operation of a user for the information flow page;
when it is monitored that the user stops the sliding operation, selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation;
and when one video view with the display position closest to the center of the screen exists in the visible video views, taking the video view with the display position closest to the center of the screen as a video view to be played.
Optionally, after the controlling the player to play the video data, the method further includes:
and when the video view to be played is monitored to be switched from a visible state to an invisible state, deleting the player added to the video view to be played.
In a second aspect, an embodiment of the present invention further provides a video playing apparatus, where the apparatus includes:
the view acquisition unit is used for determining a visible video view in a visible state in an information flow page, wherein a player is not added to the video view in the information flow page;
the view determining unit is used for selecting a video view to be played from the visible video views;
the data acquisition unit is used for acquiring video data of a video represented by the video view to be played from a server;
and the video playing unit is used for adding a player for the video view to be played and controlling the player to play the video data.
Optionally, the view determining unit includes:
the view judging subunit is used for judging whether all the displayed first-class video views exist in the visible video views;
the first view selection subunit is used for selecting a video view to be played from the first type of video view when the judgment result of the view judgment subunit is yes;
a second view selecting subunit, configured to select, when the judgment result of the view judging subunit is negative, a video view to be played from a second type of video view, where the second type of video view is: a partially displayed video view in the visible video view.
Optionally, the second type of video view is: the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed.
Optionally, the view determining unit is specifically configured to:
and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
Optionally, the view determining unit is specifically configured to:
when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
Optionally, the view determining unit is specifically configured to:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
Optionally, the view determining unit includes:
the sliding detection subunit is used for monitoring the sliding operation of the user on the information flow page when a plurality of video views with the display positions closest to the center of the screen exist in the visible video views;
the first view determining subunit is used for selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation after the sliding operation of the user is monitored to stop;
and the second view determining subunit is used for taking the video view with the display position closest to the center of the screen as the video view to be played when one video view with the display position closest to the center of the screen exists in the visible video views.
Optionally, the apparatus further comprises:
and the player deleting unit is used for deleting the player added to the video view to be played when the video view to be played is monitored to be switched from the visible state to the invisible state.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus;
wherein the processor, the communication interface and the memory complete mutual communication through the communication bus,
the memory is used for storing a computer program;
the processor is configured to implement any one of the video playing methods provided in the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements any one of the video playing methods provided in the first aspect.
When the scheme provided by the embodiment of the invention is applied to play the video, the video view to be played is selected from the visible video views of the information flow page, wherein the player is not added to the video view in the information flow page, and the player is added to the video view to be played, so that after the terminal acquires the video data of the video represented by the video view to be played from the server, the player can be controlled to play the video data.
It can be seen that, because no player is added to the video view in the information flow page in the embodiment of the present invention, when the scheme provided by the embodiment of the present invention is applied to play a video, and after the terminal selects a video view to be played, a player is added to the video view to be played, so that the video data of the video represented by the video view in the information flow page can be played.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a video playing method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating the determination of a visible video view according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a process of selecting a video view to be played according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a display of an information browsing page in an embodiment of the present invention;
FIG. 5 is a schematic diagram of another display of an information browsing page in an embodiment of the present invention;
fig. 6 is a schematic flowchart of another video playing method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a view determining unit according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to reduce the consumption of a terminal memory when an App displays an information stream page in a terminal, the embodiment of the invention provides a video playing method and device and electronic equipment.
First, a video playing method provided by an embodiment of the present invention is described below.
It should be noted that the video playing method provided by the embodiment of the present invention may be applied to an information browsing application program, for example, an application program having a video view in an information flow page, such as a live video application program, a short video application program, and a news search application program.
The execution main body of the video playing method provided by the embodiment of the invention can be a terminal, and the terminal can be equipment such as mobile equipment, a notebook computer, a desktop computer and the like, and can also be other terminal equipment.
When the terminal is a mobile device, the operating system of the terminal may be an IOS operating system or an Android operating system. The IOS operating system is a proprietary mobile operating system developed by apple for its mobile devices.
The video playing method provided by the embodiment of the invention comprises the following steps:
determining a visible video view in a visible state in an information flow page, wherein a player is not added to the video view in the information flow page;
selecting a video view to be played from the visible video views;
acquiring video data of a video represented by the video view to be played from a server;
and adding a player for the video view to be played, and controlling the player to play the video data.
When the method provided by the embodiment of the invention is used for playing the video, because the player is not added to the video view in the information flow page in the embodiment of the invention, the video is played by using the scheme provided by the embodiment of the invention, and the player is added to the video view to be played after the video view to be played is selected by the terminal, so that the video data of the video represented by the video view in the information flow page can be played. In addition, after the player is added to the view in the information flow page, the view to which the player is added needs to be rendered when the information flow page is displayed at the terminal.
The following describes a video playing method according to an embodiment of the present invention with reference to specific embodiments.
As shown in fig. 1, the video playing method provided by the embodiment of the present invention includes the following steps S110 to S140.
S110: a visible video view in a visible state in an information flow page is determined.
The video views in the above-described information flow page are not added with players. That is, the server does not add a player for any one video view in the stream page.
In the embodiment of the present invention, the visible video view in the visible state in step S110 refers to a visible video view already displayed on the screen of the terminal. The visible video view is a view of the type of video that has been displayed on the screen of the terminal.
In an embodiment, the type of the view may not be recorded in the information flow page, in this case, a view type corresponding to each view in the information flow page may be stored in the server, and a type of the loading video view may be defined at the client, where the type of the loading video view corresponds to a video view type in the view types stored in the server, that is, the view type to which the type of the loading video view is bound is the video view type.
Accordingly, as shown in fig. 2, step S110 can be implemented as following steps S111 to S113:
s111: determining a visible view in a visible state in an information flow page;
s112: acquiring the view type of each visible view from a server;
s113: a view of a view type corresponding to the type of the loading video view is selected from the visible views as a visible video view.
For example, the type of the loaded video view may be defined as QRVideoView, and the video view type in the view types stored in the server may be QRVideoData, and then, the QRVideoView corresponds to the QRVideoData, that is, the QRVideoView is bound to the QRVideoData. In this case, a view of the QRVideoData type corresponding to the QRVideoView may be selected from the visible views as the visible video view.
According to the method and the device, the visible video view is determined through the data type acquired from the server, and the visible video view can be determined more conveniently and accurately.
S120: and selecting a video view to be played from the visible video views.
In one embodiment, step S120 can be implemented as the following steps: and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
When there are a plurality of visible video views, the video view to be played can be selected from the plurality of visible videos by the embodiment.
S130: and acquiring the video data of the video represented by the video view to be played from the server.
In the embodiment of the present invention, images such as posters of videos and images of any frame of videos may be used to represent videos, and the images may be used as views representing the videos in an information browsing page.
S140: and adding a player for the video view to be played, and controlling the player to play the video data.
The method provided by the embodiment of the invention is applied to play the video, because the player is not added to the video view in the information flow page in the embodiment of the invention, the video is played by applying the scheme provided by the embodiment of the invention, and the player is added to the video view to be played after the terminal selects the video view to be played, so that the video data of the video represented by the video view in the information flow page can be played. In addition, after the player is added to the view in the information flow page, the view to which the player is added needs to be rendered when the information flow page is displayed at the terminal.
In one embodiment, step S110 can be implemented as following steps a to B:
step A: a visible view in a visible state in an information flow page is determined.
And B: a visible video view of the video type is determined from the visible views.
In the embodiment, the visible view is determined first, and then the visible video view of the video type is determined from the visible view, so that the visible video view can be obtained more conveniently.
In one embodiment, step a may be implemented as the following steps: and acquiring the uppermost view controller from each subclass of the base controller, and acquiring the visible view through the uppermost view controller.
When the base controller, i.e. the base class, i.e. App displays a page, all parent classes of the page to be displayed, for example, when the operating system of the terminal is an IOS system, the base controller may be a qrbaseview controller. The top view controller is a view controller visible to a user, and the top view controller is a sub-class of a base controller, for example, when the operating system of the terminal is an IOS system, the top view controller may be a topview controller.
In a specific embodiment, when the operating system of the terminal is an IOS operating system, step a may be implemented as the following steps: finding a list view UITableView from each sub-view of an uppermost view controller TopViewController, acquiring a visible view array visibleCells through the list view UITableView, and determining the view in the visible view array as a visible view. The arrangement sequence of the views in the list view is the display sequence of the views on the terminal screen.
In an embodiment, when the video playing method is implemented, the video playing method may be packaged in a class, for example, the video playing method may be packaged in a management class, and the management class may be defined as QRVideoManager, for example, so that when an App provides a service, the video playing method may be independent from other services provided by the App, which is more convenient for maintenance of the video playing method and extension of the video playing method.
In one embodiment, as shown in fig. 3, step S120 can be implemented as the following steps S121 to S123:
s121: judging whether a first type of video views which are all displayed exist in the visible video views or not;
s122: if the step S121 judges that the first type of video views exist, selecting the video views to be played from the first type of video views;
s123: if it is determined in step S121 that the first type of video view does not exist, a video view to be played is selected from the second type of video view.
Wherein, the second type of video view is: a partially displayed video view in a video view is visible. In one embodiment, the second type of video view may be: and the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed. The preset ratio may be any one of 40% to 60%, or other ratios, and the embodiment of the present invention is not particularly limited. In order to make the video viewed by the user more complete and reduce the memory occupied by the information stream page of the App when the terminal displays the video, the preset proportion may be set to a larger value, for example, any proportion not less than 50%, specifically, the preset proportion may be 50%.
According to the embodiment, when the video views displayed on the terminal screen have both the completely displayed video views and the partially displayed video views, the video represented by the completely displayed video views can be played preferentially, and when the completely displayed video does not exist, the video represented by the partially displayed video views can be played. When a certain video view is completely displayed, the user can completely see the video view, at the moment, the video represented by the video view is played, the user can see the video with a complete picture, and the user experience is better.
In a specific embodiment, before step S121, the following steps may be further included: the method comprises the steps of obtaining the display position of a visible video view in a terminal screen, determining the distance between the display position of the visible video view and each edge of the terminal screen according to the display position of the visible video view in the terminal screen and the display size of a visible video, and determining the display proportion of the visible video view on the terminal screen according to the distance between the display position of the visible video view and each edge of the terminal screen.
The person skilled in the art may also determine the scale of the position of the display of the visible video view on the terminal screen according to other ways, and the embodiment of the present invention does not specifically limit the determination method of the scale of the position of the display of the visible video view on the terminal screen.
Accordingly, step S121 can be implemented as the following steps: and judging whether the first type of video views which are all displayed exist in the visible video views according to the display proportion of the visible video views on the terminal screen.
For example, step S121 may be implemented as the following steps: and judging whether a first type of video view with the proportion of 1 displayed on the terminal screen exists in the visible video views.
In another specific embodiment, before step S121, the following steps may be further included:
storing all displayed video views in the visible video views into a first array;
storing part of the displayed video views in the visible video views into a second array;
accordingly, step S121 can be implemented as the following steps: judging whether a video view exists in the first array or not;
step S122 may be implemented as the following steps: if the video view exists in the first array, selecting the video view to be played from the first array;
step S122 may be implemented as the following steps: and if the video view does not exist in the first array, selecting the video view to be played from the second array.
The specific implementation mode is more convenient to determine the video view to be played in an array mode.
In an embodiment, after it is monitored that the user stops the sliding operation on the information flow page, before the step of selecting the video view to be played from the visible video views according to the sliding direction of the sliding operation, the method may further include the following steps:
acquiring the current offset of the list view and the last offset of the list view after the user stops the sliding operation aiming at the information flow page last time;
and determining the sliding direction of the sliding operation according to the current offset and the last offset.
By the embodiment, the sliding direction of the sliding operation can be determined more conveniently.
In a specific embodiment, the step of determining the sliding direction of the sliding operation according to the current offset and the last offset may be implemented as the following steps:
if the current offset is smaller than the last offset, determining the sliding direction of the sliding operation as upward sliding;
and if the current offset is larger than the last offset, determining the sliding direction of the sliding operation as downward sliding.
In one embodiment, the current offset and the last offset may be obtained by a function. For example, currentOffset function may be defined as a function for obtaining the current offset amount, and oldOffset may be defined as a function for obtaining the last offset amount, so that the current offset amount may be obtained by currentOffset function, and the last offset amount may be obtained by oldOffset function.
In one embodiment, the step of selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation may be implemented as the following steps C and D:
and C: when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
step D: and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
When the sliding direction of the user is upward sliding, the sight of the user is generally concentrated at the position on the upper portion of the screen, and when the sliding direction of the user is downward sliding, the sight of the user is generally concentrated at the position on the lower portion of the screen.
Fig. 4 is a schematic display diagram of an information browsing page when the user slides upward, and fig. 5 is a schematic display diagram of an information browsing page when the user slides downward.
In one embodiment, step S120 can be implemented as the following steps:
storing all displayed video views in the visible video views into a first array;
storing part of the displayed video views in the visible video views into a second array;
judging whether a video view exists in the first array or not;
if the video views exist in the first array, storing the video views in the first array into the video array to be played according to the arrangement sequence in the list view;
if the video views do not exist in the first array, storing the video views in the second array into the video array to be played according to the arrangement sequence in the list view;
correspondingly, the step C can be implemented as the following steps:
when the sliding direction is the upward sliding direction, selecting a first object from the video array to be played as a video view to be played;
the step D can be implemented as the following steps:
and when the sliding direction is the downward sliding direction, selecting the last object from the video array to be played as the video view to be played.
The video array to be played may be a temporary array, the temporary array may be represented by tempArray, and the video view to be played may be represented by targetVideoView. Other identifiers may be used by those skilled in the art to represent the temporary array and the video view to be played.
In one embodiment, step S120 can be implemented as the following steps:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
Since the video view with the display position closest to the center of the screen is usually more noticeable to the user, the video view with the display position closest to the center of the screen is selected as the video view to be played in the embodiment, so that the probability of the user watching the video can be improved.
In one embodiment, the step of selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played can be implemented as the following steps E to G:
step E: when a plurality of video views with display positions closest to the center of the screen exist in the visible video views, monitoring sliding operation of a user for an information flow page;
step F: when it is monitored that the user stops sliding operation on the information flow page, according to the sliding direction of the sliding operation, video views to be played are selected from the video views with the display positions closest to the center of the screen;
step G: and when one video view with the display position closest to the center of the screen exists in the visible video views, taking the video view with the display position closest to the center of the screen as the video view to be played.
Since there may be a plurality of video views in the visible video view whose display positions are closest to the center of the screen, in this case, the view to be played may be determined according to the sliding direction.
In one embodiment, the step of selecting the video view with the display position closest to the center of the screen as the video view to be played from the visible video views can be implemented by the following steps:
determining the distance between the display position of the visible video view and the center of the terminal screen according to the display position of the visible video view in the terminal screen, determining the shortest distance from the distances from the center of the terminal screen, storing the video view corresponding to the determined shortest distance into a center-closest array, and selecting the video view to be played from the video views in the center-closest array.
In an embodiment of the present invention, to facilitate implementation of the method, a distance between a position where the visible video view is displayed and a center of a screen of the terminal may be represented by centterdistance, the nearest array of the center may be represented by videoArray, and the shortest distance may be represented by minidistance. Those skilled in the art may also use other identifiers to indicate the distance from the position of the visible video view display to the center of the terminal screen, the closest array of the center, and the shortest distance, and the embodiment of the present invention is not limited in particular.
In one embodiment, the step of selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played can be implemented as the following steps H to J:
h: when a plurality of video views with display positions closest to the center of the screen exist in the visible video views, monitoring sliding operation of a user for an information flow page;
i: when it is monitored that the user stops sliding operation on the information flow page, selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation;
j: and when one video view with the display position closest to the center of the screen exists in the visible video views, taking the video view with the display position closest to the center of the screen as the video view to be played.
By the embodiment, when a plurality of video views with the display positions closest to the center of the screen exist in the visible video views, the video views to be played can also be determined.
In one embodiment, the step I of selecting a video view to be played from among video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation may be implemented by the following steps:
storing the video views of which the display positions are closest to the center of the screen into a central nearest array according to the arrangement sequence in the list view;
when the sliding direction of the sliding operation is the upward sliding direction, selecting a first object from the nearest array in the center as a video view to be played;
and when the sliding direction of the sliding operation is the downward sliding direction, selecting the last object from the central nearest array as the video view to be played.
In one embodiment, as shown in fig. 6, after step S140, the method further includes the following step S150:
s150: and when the video view to be played is monitored to be switched from the visible state to the invisible state, deleting the player of the video view to be played.
When the situation that the video view to be played is switched from the visible state to the invisible state is monitored, the video view to be played is not displayed on the screen of the terminal, and the player of the video view to be played is deleted at the moment, so that the number of players added in the information flow page can be reduced, and the consumption of the memory of the terminal when the App in the terminal displays the information flow page is further reduced.
An embodiment of the present invention further provides a video playing device, as shown in fig. 7, the device includes:
a view obtaining unit 210, configured to determine a visible video view in a visible state in an information flow page, where a player is not added to the video view in the information flow page;
a view determining unit 220, configured to select a video view to be played from the visible video views;
a data obtaining unit 230, configured to obtain, from a server, video data of a video represented by the video view to be played;
and a video playing unit 240, configured to add a player to the video view to be played, and control the player to play the video data.
When the device provided by the embodiment of the invention is used for playing videos, because the player is not added to the video view in the information flow page in the embodiment of the invention, the scheme provided by the embodiment of the invention is used for playing videos, and after the video view to be played is selected by the terminal, the player is added to the video view to be played, so that the video data of the videos represented by the video view in the information flow page can be played. . In addition, after the player is added to the view in the information flow page, the view to which the player is added needs to be rendered when the information flow page is displayed at the terminal.
In one embodiment, as shown in fig. 8, the view determining unit 220 may include:
a view judging subunit 221, configured to judge whether all displayed first-class video views exist in the visible video views;
a first view selecting subunit 222, configured to select a video view to be played from the first type of video view when the determination result of the view determining subunit 221 is yes;
a second view selecting subunit 223, configured to select, when the judgment result of the view judging subunit 221 is negative, a video view to be played from a second type of video view, where the second type of video view is: a partially displayed video view in the visible video view.
In one embodiment, the second type of video view is: the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed.
In an embodiment, the view determining unit 220 may be specifically configured to:
and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
In an embodiment, the view determining unit 220 may be specifically configured to:
when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
In an embodiment, the view determining unit 220 may be specifically configured to:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
In one embodiment, the view determining unit 220 may include:
the sliding detection subunit is used for monitoring the sliding operation of the user on the information flow page when a plurality of video views with the display positions closest to the center of the screen exist in the visible video views;
the first view determining subunit is used for selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation after the situation that the user stops the sliding operation on the information flow page is monitored;
and the second view determining subunit is used for taking the video view with the display position closest to the center of the screen as the video view to be played when one video view with the display position closest to the center of the screen exists in the visible video views.
In one embodiment, as shown in fig. 9, the apparatus may further include:
and the player deleting unit 250 is configured to delete the player added to the video view to be played when it is monitored that the video view to be played is switched from the visible state to the invisible state.
When the situation that the video view to be played is switched from the visible state to the invisible state is monitored, the video view to be played is not displayed on the screen of the terminal, and the player of the video view to be played is deleted at the moment, so that the number of players added in the information flow page can be reduced, and the consumption of the memory of the terminal when the App in the terminal displays the information flow page is further reduced.
An embodiment of the present invention further provides an electronic device, as shown in fig. 10, which includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301 is configured to implement the following steps when executing the program stored in the memory 303:
determining a visible video view in a visible state in an information flow page;
selecting a video view to be played from the visible video views;
acquiring video data of a video represented by the video view to be played from a server;
and adding a player for the video view to be played, and controlling the player to play the video data.
The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The electronic equipment provided by the embodiment of the invention is applied to playing the video, because the player is not added to the video view in the information flow page in the embodiment of the invention, the video is played by applying the scheme provided by the embodiment of the invention, and the player is added to the video view to be played after the video view to be played is selected by the terminal, so that the video data of the video represented by the video view in the information flow page can be played. . In addition, after the player is added to the view in the information flow page, the view to which the player is added needs to be rendered when the information flow page is displayed at the terminal.
An embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the computer program implements a video playing method provided in any one of the foregoing methods.
An embodiment of the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the video playing methods provided above.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus/electronic device/storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A video playback method, the method comprising:
determining a visible video view in a visible state in an information flow page, wherein a player is not added to the video view in the information flow page;
selecting a video view to be played from the visible video views;
acquiring video data of a video represented by the video view to be played from a server;
and adding a player for the video view to be played, and controlling the player to play the video data.
2. The method of claim 1, wherein selecting the video view to be played from the visible video views comprises:
judging whether all displayed first-class video views exist in the visible video views;
if the first type of video views exist, selecting video views to be played from the first type of video views;
if the first type of video view does not exist, selecting a video view to be played from a second type of video view, wherein the second type of video view is as follows: a partially displayed video view in the visible video view.
3. The method of claim 2,
the second type of video view is: the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed.
4. The method of claim 1, wherein selecting the video view to be played from the visible video views comprises:
and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
5. The method according to claim 4, wherein the selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation comprises:
when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
6. The method of claim 1, wherein selecting the video view to be played from the visible video views comprises:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
7. The method according to claim 6, wherein the selecting, from the visual video views, a video view with a display position closest to the center of the screen as the video view to be played comprises:
when a plurality of video views with display positions closest to the center of a screen exist in the visible video views, monitoring sliding operation of a user for the information flow page;
when it is monitored that the user stops the sliding operation, selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation;
and when one video view with the display position closest to the center of the screen exists in the visible video views, taking the video view with the display position closest to the center of the screen as a video view to be played.
8. The method according to any one of claims 1-7, wherein after said controlling said player to play said video data, said method further comprises:
and when the video view to be played is monitored to be switched from a visible state to an invisible state, deleting the player added to the video view to be played.
9. A video playback apparatus, comprising:
the view acquisition unit is used for determining a visible video view in a visible state in an information flow page, wherein a player is not added to the video view in the information flow page;
the view determining unit is used for selecting a video view to be played from the visible video views;
the data acquisition unit is used for acquiring video data of a video represented by the video view to be played from a server;
and the video playing unit is used for adding a player for the video view to be played and controlling the player to play the video data.
10. The apparatus of claim 9, wherein the view determining unit comprises:
the view judging subunit is used for judging whether all the displayed first-class video views exist in the visible video views;
the first view selection subunit is used for selecting a video view to be played from the first type of video view when the judgment result of the view judgment subunit is yes;
a second view selecting subunit, configured to select, when the judgment result of the view judging subunit is negative, a video view to be played from a second type of video view, where the second type of video view is: a partially displayed video view in the visible video view.
11. The apparatus of claim 10, wherein the second type of video view is: the proportion of the displayed part in the visible video view exceeds the preset proportion and the video view is not completely displayed.
12. The apparatus according to claim 9, wherein the view determination unit is specifically configured to:
and when it is monitored that the user stops the sliding operation aiming at the information flow page, selecting a video view to be played from the visible video views according to the sliding direction of the sliding operation.
13. The apparatus according to claim 12, wherein the view determination unit is specifically configured to:
when the sliding direction is the upward sliding direction, selecting the video view with the top display position as the video view to be played from the visible video views;
and when the sliding direction is a downward sliding direction, selecting the video view with the lowest display position from the visible video views as the video view to be played.
14. The apparatus according to claim 9, wherein the view determination unit is specifically configured to:
and selecting the video view with the display position closest to the center of the screen from the visible video views as the video view to be played.
15. The apparatus of claim 14, wherein the view determining unit comprises:
the sliding detection subunit is used for monitoring the sliding operation of the user on the information flow page when a plurality of video views with the display positions closest to the center of the screen exist in the visible video views;
the first view determining subunit is used for selecting a video view to be played from video views with display positions closest to the center of the screen according to the sliding direction of the sliding operation after the sliding operation of the user is monitored to stop;
and the second view determining subunit is used for taking the video view with the display position closest to the center of the screen as the video view to be played when one video view with the display position closest to the center of the screen exists in the visible video views.
16. The apparatus of any one of claims 9 to 15, further comprising:
and the player deleting unit is used for deleting the player added to the video view to be played when the video view to be played is monitored to be switched from the visible state to the invisible state.
17. An electronic device comprising a processor, a communication interface, a memory, and a communication bus;
wherein the processor, the communication interface and the memory complete mutual communication through the communication bus,
the memory is used for storing a computer program;
the processor is configured to implement the video playback method according to any one of claims 1 to 8 when executing the program stored in the memory.
18. A computer-readable storage medium, in which a computer program is stored, which, when executed by a processor, implements the video playback method of any one of claims 1 to 8.
CN201911285281.9A 2019-12-13 2019-12-13 Video playing method and device and electronic equipment Active CN110996154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911285281.9A CN110996154B (en) 2019-12-13 2019-12-13 Video playing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911285281.9A CN110996154B (en) 2019-12-13 2019-12-13 Video playing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110996154A true CN110996154A (en) 2020-04-10
CN110996154B CN110996154B (en) 2022-09-02

Family

ID=70093556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911285281.9A Active CN110996154B (en) 2019-12-13 2019-12-13 Video playing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110996154B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153471A (en) * 2020-09-25 2020-12-29 四川封面传媒有限责任公司 Video playing control method and device and storage medium
CN113286189A (en) * 2021-04-23 2021-08-20 北京奇艺世纪科技有限公司 Video playing method, device, server and storage medium
CN113676767A (en) * 2021-10-20 2021-11-19 北京搜狐新动力信息技术有限公司 Video playing method and system
CN113949934A (en) * 2021-10-19 2022-01-18 广州方硅信息技术有限公司 Dynamic video content playing control method, device, medium and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791947A (en) * 2016-04-21 2016-07-20 腾讯科技(深圳)有限公司 Method and device for playing video
US20170161232A1 (en) * 2015-12-08 2017-06-08 Le Holdings (Beijing) Co., Ltd. Method and electronic device for configuring a video player in a web page
CN107181803A (en) * 2017-05-23 2017-09-19 百度在线网络技术(北京)有限公司 Method and apparatus for playing video
CN107241657A (en) * 2017-07-06 2017-10-10 广州优视网络科技有限公司 Video broadcasting method, device, computing device and storage medium
CN109982135A (en) * 2017-12-27 2019-07-05 中国电信股份有限公司 Channel switching method, device, terminal and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170161232A1 (en) * 2015-12-08 2017-06-08 Le Holdings (Beijing) Co., Ltd. Method and electronic device for configuring a video player in a web page
CN105791947A (en) * 2016-04-21 2016-07-20 腾讯科技(深圳)有限公司 Method and device for playing video
CN107181803A (en) * 2017-05-23 2017-09-19 百度在线网络技术(北京)有限公司 Method and apparatus for playing video
CN107241657A (en) * 2017-07-06 2017-10-10 广州优视网络科技有限公司 Video broadcasting method, device, computing device and storage medium
CN109982135A (en) * 2017-12-27 2019-07-05 中国电信股份有限公司 Channel switching method, device, terminal and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153471A (en) * 2020-09-25 2020-12-29 四川封面传媒有限责任公司 Video playing control method and device and storage medium
CN113286189A (en) * 2021-04-23 2021-08-20 北京奇艺世纪科技有限公司 Video playing method, device, server and storage medium
CN113949934A (en) * 2021-10-19 2022-01-18 广州方硅信息技术有限公司 Dynamic video content playing control method, device, medium and computer equipment
CN113949934B (en) * 2021-10-19 2024-03-29 广州方硅信息技术有限公司 Dynamic video content playing control method, device, medium and computer equipment
CN113676767A (en) * 2021-10-20 2021-11-19 北京搜狐新动力信息技术有限公司 Video playing method and system

Also Published As

Publication number Publication date
CN110996154B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN110996154B (en) Video playing method and device and electronic equipment
US11119627B2 (en) Information display method, device, apparatus and storage medium
CN105528392B (en) Classification label ordering method and device
US10114865B2 (en) Tile cache
CN111988659B (en) Multi-information-source dynamic window previewing method and device, intelligent display equipment and storage medium
US10498737B2 (en) Methods, systems, and media for controlling access to content
CN109144652B (en) View display method and device, electronic equipment and storage medium
CN103004228A (en) Obtaining keywords for searching
KR102004568B1 (en) Visual representation of chart scaling
US9204205B1 (en) Viewing advertisements using an advertisement queue
CN107295415B (en) Video playing method and device
US11252219B2 (en) Method and apparatus for downloading a file
CN109120954B (en) Video message pushing method and device, computer equipment and storage medium
CN110913135A (en) Video shooting method and device, electronic equipment and storage medium
EP3651421A1 (en) Multimedia display method, apparatus, and device
EP2990961A1 (en) Method, apparatus, and electronic device for establishing virtual directory
KR20170034766A (en) Image display apparatus, and method for operating the same
JP2016177614A (en) Conference system, information processing device, information terminal, and program
CN111131812A (en) Broadcast time testing method and device and computer readable storage medium
US20170161871A1 (en) Method and electronic device for previewing picture on intelligent terminal
US10104149B2 (en) Reception terminal, information processing method, program, server, transmission terminal, and information processing system
CN110275753B (en) Value added service acquisition method, device and equipment of application program
CN110048937B (en) Method, device, user terminal and storage medium for displaying chat information in split screen mode
CN109842812B (en) Multi-application program prioritization method, intelligent television and storage medium
US10872356B2 (en) Methods, systems, and media for presenting advertisements during background presentation of media content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant