CN107181803B - Method and device for playing video - Google Patents

Method and device for playing video Download PDF

Info

Publication number
CN107181803B
CN107181803B CN201710367189.1A CN201710367189A CN107181803B CN 107181803 B CN107181803 B CN 107181803B CN 201710367189 A CN201710367189 A CN 201710367189A CN 107181803 B CN107181803 B CN 107181803B
Authority
CN
China
Prior art keywords
player
video
webpage
bitmap
playing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710367189.1A
Other languages
Chinese (zh)
Other versions
CN107181803A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201710367189.1A priority Critical patent/CN107181803B/en
Publication of CN107181803A publication Critical patent/CN107181803A/en
Application granted granted Critical
Publication of CN107181803B publication Critical patent/CN107181803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • H04N21/4858End-user interface for client configuration for modifying screen layout parameters, e.g. fonts, size of the windows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a method and a device for playing videos. One embodiment of the method comprises: in response to the monitored event that the target application loads a webpage including a video to be played, adding a preset occupation map of the player on the webpage, wherein the occupation map is used for occupying a part of the webpage and reserving a position for the player; responding to an event of clicking the occupied bitmap, and acquiring the position of the occupied bitmap and a uniform resource locator of a video; displaying the player at the position of the placeholder map; and playing the video in the player according to the uniform resource locator. This embodiment enables the embedding of a custom player within a web page.

Description

Method and device for playing video
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of browser technologies, and in particular, to a method and an apparatus for playing a video.
Background
Although a plurality of browsing kernels are popular in the mobile terminal at present, the browser kernels except the system own browser kernel are not allowed to enter on an iOS (apple mobile operating system) platform, so that the development of each browser is carried out for the second time on the basis of the Safari (browser in an operating system of an apple computer) or IE (web browser produced by Microsoft corporation) kernels, and functions and user interfaces are optimized. Developing web page related functionality in mobile applications requires a webview component based on the system browsing kernel.
When a video playing button in a webpage (for example, a HyperText Markup Language 5 (html 5) page) with video playing is clicked to play, a default player of a system is called up, if a user-defined player needs to be called up, the user-defined player needs to be interacted with the webview through Javascript (an transliterated script Language which is a dynamic type, a weak type, a Language based on a prototype, and a built-in support type), so that a click event of the webpage is obtained, and meanwhile, the default player of the system is cancelled, and the user-defined player is called up. However, because the webview content can slide at will and be refreshed at will, when the positions, sizes, and display statuses of the video after refreshing are all likely to change, and the player stops playing in an asynchronous thread, the custom player can only be added to the designated position of the screen at present and is displayed in the screen in a full-screen, ceiling-mounted, or small-window manner. It is not possible to embed custom players in web pages.
Disclosure of Invention
It is an object of the present application to provide an improved method and apparatus for playing video to solve the above technical problems.
In a first aspect, an embodiment of the present application provides a method for playing a video, where the method includes: in response to the monitored event that the target application loads a webpage including a video to be played, adding a preset occupation map of the player on the webpage, wherein the occupation map is used for occupying a part of the webpage and reserving a position for the player; responding to an event of clicking the occupied bitmap, and acquiring the position of the occupied bitmap and a uniform resource locator of a video; displaying the player at the position of the placeholder map; and playing the video in the player according to the uniform resource locator.
In some embodiments, the method further comprises: and closing the player in response to monitoring the event for refreshing the webpage.
In some embodiments, the method further comprises: and in response to detecting that the webpage page is refreshed, displaying the player again at the position occupying the bitmap and continuing to play the video in the player.
In some embodiments, prior to shutting down the player, the method further comprises: recording the playing progress of the video; continuing to play the video in the player, including: if the playing progress is smaller than a preset threshold value, starting to play the video from the beginning in the player; otherwise, the video is continuously played in the player according to the playing progress.
In some embodiments, after obtaining the position of the occupancy bitmap, the method further comprises: acquiring the size of a occupied bitmap; and displaying the player at the position occupying the bitmap, comprising: and displaying the player at the position of the occupying bitmap according to the size of the occupying bitmap.
In some embodiments, the player presents at least one of the following: playing progress information, loading progress information, user behavior statistical information, barrage information and playlist information.
In some embodiments, adding a preset player placeholder map on a webpage includes: determining the size of a occupied bitmap to be added according to the number of characters of a webpage; and selecting a placeholder with the same picture size as the determined placeholder from a preset candidate placeholder set, and adding the placeholder to the webpage.
In a second aspect, an embodiment of the present application provides an apparatus for playing a video, where the apparatus includes: the device comprises a loading unit, a display unit and a display unit, wherein the loading unit is used for responding to an event that a target application loads a webpage including a video to be played, and adding a preset occupation map of a player on the webpage, wherein the occupation map is used for occupying a part of the webpage and reserving a position for the player; the acquisition unit is used for responding to the event of clicking the occupation bitmap and acquiring the position of the occupation bitmap and the uniform resource locator of the video; the display unit is used for displaying the player at the position of the placeholder map; and the playing unit is used for playing the video in the player according to the uniform resource locator.
In some embodiments, the display unit is further to: and closing the player in response to monitoring the event for refreshing the webpage.
In some embodiments, the display unit is further configured to, in response to detecting that the webpage page is refreshed, display the player again at the position occupying the bitmap; and the playing unit is further used for continuing to play the video in the player.
In some embodiments, the apparatus further comprises: the recording unit is used for recording the playing progress of the video before the player is closed by the display unit; the playing unit is further used for playing the video from the beginning in the player when the playing progress is smaller than a preset threshold value; otherwise, the video is continuously played in the player according to the playing progress.
In some embodiments, after the obtaining unit is further configured to obtain the position of the occupancy bitmap, the method further includes: acquiring the size of a occupied bitmap; and displaying the player at the position occupying the bitmap, comprising: and displaying the player at the position of the occupying bitmap according to the size of the occupying bitmap.
In some embodiments, the player presents at least one of the following: playing progress information, loading progress information, user behavior statistical information, barrage information and playlist information.
In a third aspect, an embodiment of the present application provides a terminal, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method according to any one of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method according to any one of the first aspect.
According to the method and the device for playing the video, the user-defined player is embedded in the webpage page by adding the preset placeholder map of the player on the webpage page.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for playing a video according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for playing video according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for playing a video according to the present application;
FIG. 5 is a schematic block diagram illustrating an embodiment of an apparatus for playing video in accordance with the present application;
fig. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the present method for playing video or apparatus for playing video may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and servers 105, 106. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the servers 105, 106. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user 110 may use the terminal devices 101, 102, 103 to interact with the servers 105, 106 via the network 104 to receive or send messages or the like. Various client applications, such as a browser-type application, a video playing-type application, a search engine-type application, a shopping-type application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting the iOS system, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The servers 105, 106 may be servers providing various services, such as background servers providing support for the terminal devices 101, 102, 103. The background server may perform processing such as analysis based on web page request data collected from the terminal, and feed back a processing result (e.g., a web page containing a video) to the terminal device.
It should be noted that the method for playing back the video provided in the embodiments of the present application is generally executed by the terminal devices 101, 102, 103, and accordingly, the apparatus for playing back the video is generally disposed in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for playing a video in accordance with the present application is shown. The method for playing the video comprises the following steps:
step 201, in response to monitoring an event that the target application loads a webpage including a video to be played, adding a preset placeholder map of the player on the webpage.
In this embodiment, an electronic device (for example, the terminal shown in fig. 1) on which the method for playing a video operates may receive a web page from a server through a wired connection manner or a wireless connection manner, where the web page may be, for example, an asp page, an aspx page, a jsp page, an htm page, an html (which may include html4, html5, and the like) page, a html page, and the like. For example, an event of a web page including a video to be played may be loaded on a contentview in the webview where the web page is located by listening to the webview. The occupation bitmap is used for occupying a part of the webpage page to reserve a position for the player. When the webpage is loaded, the placeholder map can be displayed on a screen of the terminal. When the page loading is complete, the webview is passed the size, location, video information (e.g., uniform resource locator), etc. of the occupied bitmap through the script (e.g., javascript) of the web page.
In some optional implementations of this embodiment, adding a preset placeholder map of the player on the webpage includes: determining the size of a occupied bitmap to be added according to the number of characters of a webpage; and selecting a placeholder with the same picture size as the determined placeholder from a preset candidate placeholder set, and adding the placeholder to the webpage. The content, location, and size of the occupied bitmap may be defined in accordance with the web page content when generating the script for the web page. The placeholder map may be a clickable play button picture, and is pre-stored in the terminal. This placeholder map is a portion of the web page that changes as the content of the web page changes. For example, the number of characters of the webpage to be displayed is counted, and if the number of characters is smaller than a preset character threshold, a larger occupied bitmap can be selected. The ratio of text area to footprint area can also be set, for example, 3: and 1, adjusting the size of the placeholder map according to the word size of the webpage.
Step 202, in response to monitoring the event of clicking the occupation bitmap, acquiring the position of the occupation bitmap and the uniform resource locator of the video.
In this embodiment, the user may click on the placeholder map displayed on the screen of the terminal. Once the terminal monitors the event of clicking the placeholder map, the location of the placeholder map and a Uniform Resource Locator (URL) of the video can be acquired through webview. The video may be downloaded from a server via a URL.
In some optional implementations of this embodiment, the method further includes: the size of the occupying bitmap is acquired so that the player is displayed at the position of the occupying bitmap according to the size of the occupying bitmap in step 203.
Step 203, displaying the player at the position occupying the bitmap.
In this embodiment, the player displayed after clicking the occupation bitmap is a preset player, that is, a custom player, rather than a system default player. Therefore, the expandability of the user-defined player can be fully utilized, and the user-defined functions of user behavior statistics, barrage, episode list, automatic switching of the next episode and the like are increased.
In some optional implementations of this embodiment, the preset player presents at least one of the following information: playing progress information, loading progress information, user behavior statistical information, barrage information and playlist information. The playing progress information may display the length and percentage of time that has been played in a progress bar manner. The loading progress information may display the length of the video that has been downloaded in a percentage manner. The user behavior statistical information may include information on the number of times the user repeatedly plays, the number of fast-forwards, the pause time, and the like. The player also supports the function of barrage, and the user can input barrage information. Videos that are not played or have already been played by the player may be displayed in a playlist.
And step 204, playing the video in the player according to the uniform resource locator.
In the present embodiment, a predetermined player loads a play screen by setting a video play address (e.g., URL) based on the AVFoundation framework of the iOS system. The AVFoundation is a framework that can be used to use and create time-based audiovisual media and provides a level of detail interface that can use time-based audiovisual data. For example: it can be used to examine, create, edit or re-encode media files. The input stream can also be obtained from the device, and operated and played back when the video is played in real time. The start and stop of playback are done in different threads. It is an asynchronous operation because the process of starting playback, stopping playback includes informing the network to start, stop loading video playback resources, etc.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for playing a video according to the present embodiment. In the application scenario of fig. 3, a user opens a web page including a video using a target application (e.g., Safari browser) on the terminal 300. When the terminal monitors an event that a target application loads a webpage including a video to be played, a preset placeholder map (for example, a play button picture) of a player is added to the webpage. After the user clicks the occupation bitmap, the terminal monitors an event clicking the occupation bitmap, and acquires the position of the occupation bitmap (for example, the middle position of a webpage page) and a uniform resource locator (for example, http:// www.letv.com/ptv/vplay/822277.html) of the video. The terminal then displays the player 301 at the location of the placeholder. Finally, the terminal plays the video in the player 301 according to the uniform resource locator. The terminal can adopt a player which is pre-defined by a user instead of a player which is default by the system. And the player is embedded in the web page.
According to the method provided by the embodiment of the application, the player is embedded into the webpage by adopting the method of occupying the bitmap, and the user-defined player can be added at any position of the webpage, so that the consistency of the content display of the webpage and various user-defined functions supported by the user-defined player are ensured.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for playing a video is shown. The process 400 of the method for playing a video includes the following steps:
step 401, in response to monitoring an event that the target application loads a webpage including a video to be played, adding a preset placeholder map of the player on the webpage.
And 402, responding to the event of clicking the occupation bitmap, and acquiring the position of the occupation bitmap and the uniform resource locator of the video.
And step 403, displaying the player at the position occupying the bitmap.
And step 404, playing the video in the player according to the uniform resource locator.
The steps 401 and 404 are substantially the same as the steps 201 and 204, and therefore, the description thereof is omitted.
Step 405, in response to monitoring the event of refreshing the webpage, closing the player.
In this embodiment, a user may manually refresh a page, and the positions, sizes, and display states of the refreshed videos may change, so that the current player needs to be closed, and after the refreshing, whether the player is opened is determined according to the content of the refreshed page.
And step 406, in response to detecting that the webpage page is refreshed, displaying the player again at the position occupying the bitmap and continuing to play the video in the player.
In this embodiment, if the video address played last time still exists in the refreshed page script, the player is displayed again at the position occupying the bitmap, and the video is continuously played in the player. The placeholder map at this time can be adjusted in position or size according to the refreshed page content. The replay video can be played again, or can be played continuously from the last watching position. The user can preset the conditions for starting and continuing the playing again, so that the player can select the playing mode according to the preference of the user.
In some optional implementations of this embodiment, before turning off the player, the method further includes: recording the playing progress of the video; continuing to play the video in the player, including: if the playing progress is smaller than a preset threshold value, starting to play the video from the beginning in the player; otherwise, the video is continuously played in the player according to the playing progress. The threshold may be a percentage of what has been played or a duration. For example, for more than 10 minutes, or more than 10% of the video that has been played, the playback may be continued without resuming the playback.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for playing a video in the present embodiment highlights the steps of the processing of the webpage refresh operation. Therefore, the scheme described in this embodiment can monitor the event of page refreshing, close the player when the player exists on the page, maintain the consistency between the player and the refreshed webpage, and prevent the player from blocking the content of the refreshed webpage.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for playing a video, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for playing a video of the present embodiment includes: a loading unit 501, an acquisition unit 502, a display unit 503, and a playback unit 504. The loading unit 501 is configured to add a preset occupation map of a player on a webpage page in response to monitoring an event that a target application loads the webpage page including a video to be played, where the occupation map is used to occupy a part of the webpage page and reserve a position for the player; the obtaining unit 502 is configured to obtain a position of the occupied bitmap and a uniform resource locator of the video in response to monitoring an event that the occupied bitmap is clicked; the display unit 503 is used for displaying the player at the position of the placeholder map; the playing unit 504 is used for playing the video in the player according to the uniform resource locator.
In this embodiment, the specific processing of the loading unit 501, the obtaining unit 502, the displaying unit 503 and the playing unit 504 of the apparatus 500 for playing video may refer to step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2.
In some optional implementations of this embodiment, the display unit 503 is further configured to: and closing the player in response to monitoring the event for refreshing the webpage.
In some optional implementations of this embodiment, the display unit 503 is further configured to, in response to detecting that the webpage page is refreshed, display the player again at the position occupying the bitmap; and the playing unit is further used for continuing to play the video in the player.
In some optional implementations of this embodiment, the apparatus 500 further includes: the recording unit is used for recording the playing progress of the video before the player is closed by the display unit; the playing unit is further used for playing the video from the beginning in the player when the playing progress is smaller than a preset threshold value; otherwise, the video is continuously played in the player according to the playing progress.
In some optional implementations of the present embodiment, after the obtaining unit 502 is further configured to obtain the position of the occupancy bitmap, the method further includes: acquiring the size of a occupied bitmap; and displaying the player at the position occupying the bitmap, comprising: and displaying the player at the position of the occupying bitmap according to the size of the occupying bitmap.
In some optional implementations of this embodiment, the player presents at least one of the following information: playing progress information, loading progress information, user behavior statistical information, barrage information and playlist information.
Referring now to FIG. 6, a block diagram of a terminal device computer system 600 suitable for use in implementing embodiments of the present application is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, a touch screen, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a loading unit, an acquisition unit, a display unit, and a playback unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, a playback unit may also be described as a "unit playing video in a player according to a uniform resource locator".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: in response to the monitored event that the target application loads a webpage including a video to be played, adding a preset occupation map of the player on the webpage, wherein the occupation map is used for occupying a part of the webpage and reserving a position for the player; responding to an event of clicking the occupied bitmap, and acquiring the position of the occupied bitmap and a uniform resource locator of a video; displaying the player at the position of the placeholder map; and playing the video in the player according to the uniform resource locator.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (7)

1. A method for playing a video, the method comprising:
in response to an event that a target application loads a webpage including a video to be played is monitored, adding a preset occupation bitmap of a player on the webpage, wherein the occupation bitmap is used for occupying a part of the webpage and reserving a position for the player;
responding to an event of clicking the occupation bitmap, and acquiring the position of the occupation bitmap and a uniform resource locator of the video;
displaying the player at the position of the occupation map;
playing the video in the player according to the uniform resource locator;
in response to monitoring an event for refreshing the webpage, recording the playing progress of the video and then closing the player;
responding to the detection that the webpage page is refreshed completely, and displaying the player again at the position of the occupied bitmap;
if the playing progress is smaller than a preset threshold value, the video is played in the player from the beginning; otherwise, continuing to play the video in the player according to the playing progress.
2. The method of claim 1, wherein after the obtaining the position of the occupancy bitmap, the method further comprises:
acquiring the size of the occupation bitmap; and
the displaying the player at the position of the occupation map comprises:
and displaying the player at the position of the occupation bitmap according to the size of the occupation bitmap.
3. The method of claim 1, wherein the player presents at least one of the following:
playing progress information, loading progress information, user behavior statistical information, barrage information and playlist information.
4. The method of claim 1, wherein adding a preset player placeholder map to the webpage page comprises:
determining the size of the occupied bitmap to be added according to the number of the characters of the webpage;
and selecting a placeholder with the same picture size as the determined placeholder from a preset candidate placeholder set, and adding the placeholder to the webpage.
5. An apparatus for playing video, the apparatus comprising:
the device comprises a loading unit, a display unit and a display unit, wherein the loading unit is used for responding to an event that a target application loads a webpage including a video to be played, and adding a preset occupation bitmap of a player on the webpage, wherein the occupation bitmap is used for occupying a part of the webpage and reserving a position for the player;
the acquisition unit is used for responding to an event of clicking the occupation bitmap and acquiring the position of the occupation bitmap and the uniform resource locator of the video;
the display unit is used for displaying the player at the position of the occupation bitmap;
a playing unit, configured to play the video in the player according to the uniform resource locator;
the recording unit is used for recording the playing progress of the video before the display unit closes the player;
the display unit is further configured to: in response to monitoring an event for refreshing the webpage, closing the player; responding to the detection that the webpage page is refreshed completely, and displaying the player again at the position of the occupied bitmap; and
the playing unit is further used for playing the video from the beginning in the player when the playing progress is smaller than a preset threshold; otherwise, continuing to play the video in the player according to the playing progress.
6. A terminal, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201710367189.1A 2017-05-23 2017-05-23 Method and device for playing video Active CN107181803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710367189.1A CN107181803B (en) 2017-05-23 2017-05-23 Method and device for playing video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710367189.1A CN107181803B (en) 2017-05-23 2017-05-23 Method and device for playing video

Publications (2)

Publication Number Publication Date
CN107181803A CN107181803A (en) 2017-09-19
CN107181803B true CN107181803B (en) 2020-04-10

Family

ID=59831340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710367189.1A Active CN107181803B (en) 2017-05-23 2017-05-23 Method and device for playing video

Country Status (1)

Country Link
CN (1) CN107181803B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020317B (en) * 2017-12-25 2021-12-14 北京京东尚科信息技术有限公司 Webpage container bottom supporting file determining method, device, equipment and readable storage medium
CN108427622A (en) * 2018-04-08 2018-08-21 平安普惠企业管理有限公司 A kind of EMS memory management process, device, computer equipment and storage medium
CN108650557A (en) * 2018-04-27 2018-10-12 Oppo广东移动通信有限公司 A kind of method, device and mobile terminal of display barrage
CN108848401B (en) * 2018-07-26 2021-01-19 聚好看科技股份有限公司 Video playing starting method and device
CN110636366A (en) * 2019-10-25 2019-12-31 百度在线网络技术(北京)有限公司 Video playing processing method and device, electronic equipment and medium
CN110996154B (en) * 2019-12-13 2022-09-02 北京爱奇艺科技有限公司 Video playing method and device and electronic equipment
CN111314791B (en) * 2020-03-19 2022-04-05 杭州小影创新科技股份有限公司 Seamless jump method in video playing based on Android
CN111708522B (en) * 2020-06-23 2023-01-31 西安雷风电子科技有限公司 Video playing component development method and device
CN113779306A (en) * 2020-08-25 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for determining playing progress
CN113286189A (en) * 2021-04-23 2021-08-20 北京奇艺世纪科技有限公司 Video playing method, device, server and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077191A (en) * 2012-12-21 2013-05-01 中金数据系统有限公司 Self-adaptive Web platform audio playing method and device
CN104125490A (en) * 2013-04-28 2014-10-29 腾讯科技(深圳)有限公司 Online video playing method and device
CN104809120A (en) * 2014-01-24 2015-07-29 腾讯科技(深圳)有限公司 Information processing method and device
CN105430498A (en) * 2015-11-24 2016-03-23 天脉聚源(北京)传媒科技有限公司 Playing control method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110113354A1 (en) * 2009-11-12 2011-05-12 Sling Media Pvt Ltd Always-on-top media player launched from a web browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077191A (en) * 2012-12-21 2013-05-01 中金数据系统有限公司 Self-adaptive Web platform audio playing method and device
CN104125490A (en) * 2013-04-28 2014-10-29 腾讯科技(深圳)有限公司 Online video playing method and device
CN104809120A (en) * 2014-01-24 2015-07-29 腾讯科技(深圳)有限公司 Information processing method and device
CN105430498A (en) * 2015-11-24 2016-03-23 天脉聚源(北京)传媒科技有限公司 Playing control method and device

Also Published As

Publication number Publication date
CN107181803A (en) 2017-09-19

Similar Documents

Publication Publication Date Title
CN107181803B (en) Method and device for playing video
US11470406B2 (en) Methods, systems, and media for providing personalized notifications to video viewers
CN106998486B (en) Video playing method and device
US20200201490A1 (en) Providing content via multiple display devices
CN110062284B (en) Video playing method and device and electronic equipment
US11579902B2 (en) User interface rendering performance
US20140325323A1 (en) Online video playing method and apparatus and computer readable medium
CN111436005B (en) Method and apparatus for displaying image
CN110362304B (en) Webpage display method and device
WO2015051716A1 (en) Method and apparatus for playing back data
CN110730384B (en) Webpage control method and device, terminal equipment and computer storage medium
US20160359989A1 (en) Recording And Triggering Web And Native Mobile Application Events With Mapped Data Fields
US11490147B2 (en) Methods and systems for displaying a (payment) form associated with a video
WO2016207735A1 (en) A system and methods thereof for auto-playing video content on mobile devices
CN111163348A (en) Searching method and device based on video playing
US20180285148A1 (en) Automate control of media playback based on visibility
US11750879B2 (en) Video content display method, client, and storage medium
EP3125541A1 (en) Data acquisition and interaction method, set top box, server and multimedia system
CN109714626B (en) Information interaction method and device, electronic equipment and computer readable storage medium
US11902341B2 (en) Presenting links during an online presentation
US20140026050A1 (en) Method and server for storing, encoding and uploading video or object captured from a webpage using a toolbar
CN106462878B (en) Methods, systems, and media for presenting advertisements during background presentation of media content
US20150113400A1 (en) Serving content via an embedded content player with a looping function
US10328336B1 (en) Concurrent game functionality and video content
US20170199634A1 (en) Methods and systems for managing media content of a webpage

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