WO2014183487A1 - 一种网页中视频的播放方法和装置 - Google Patents

一种网页中视频的播放方法和装置 Download PDF

Info

Publication number
WO2014183487A1
WO2014183487A1 PCT/CN2014/071540 CN2014071540W WO2014183487A1 WO 2014183487 A1 WO2014183487 A1 WO 2014183487A1 CN 2014071540 W CN2014071540 W CN 2014071540W WO 2014183487 A1 WO2014183487 A1 WO 2014183487A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
script
browser
video playback
web page
Prior art date
Application number
PCT/CN2014/071540
Other languages
English (en)
French (fr)
Inventor
陈志�
李锦伟
纪尚越
贺跃松
任寰
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
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 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2014183487A1 publication Critical patent/WO2014183487A1/zh

Links

Classifications

    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for playing video in a webpage. Background technique
  • a browser is a piece of software that can display the contents of an HTML (Hypertext Markup Language) file of a web server or file system and allow users to interact with these files.
  • HTML Hypertext Markup Language
  • the browser mainly interacts with the web server through the HTTP (Hypertext Transfer Protocol) protocol and acquires a web page.
  • a web page can include multiple documents, and each document is separately obtained from the server.
  • Most browsers natively support a wide range of formats besides HTML, such as JPEG, PNG-GIF, etc., and can be extended to support a large number of plug-ins.
  • the current browser web page already supports the video playback function.
  • the general video provider such as potato video
  • the browser will first perform the playback of the advertisement, and then play the subsequent video content after the advertisement is played.
  • the present invention has been made in order to provide a method and apparatus for playing video in a web page that overcomes the above problems or at least partially solves the above problems.
  • an embodiment of the present invention provides a method for playing video in a webpage, including:
  • Blocking the script that plays the first video class webpage element setting the video playback fast forward multiple information
  • the first video type webpage element is played by using the browser video plugin
  • the second video type webpage element is played using the browser video plugin according to the reset video playback fast forward multiple information.
  • the webpage loaded with the webpage element of the video category in the browser includes:
  • Multi-function webmail augmentation MIME type information for detecting resources in the loaded webpage, when the MIME type information indicates When the frequency type is known, the web page is known as a web page with a video page element.
  • the foregoing step of intercepting the script for playing the first video type webpage element, setting the video playback fast forward multiple information includes: when intercepting the browser loading and running the script including the first name information, confirming interception to play the first video class webpage element Script, and set the video playback fast forward multiple information;
  • the above intercepting the script for playing the second video type webpage element, resetting the video playback fast forward multiple information includes: when intercepting the browser loading and running the script including the second name information, confirming that the second video type webpage element is intercepted and played Script, and reset the video playback fast forward multiple information.
  • the first name information and the second name information are saved in a script name information list on the browser side;
  • the script name information list including the above name information is provided by the browser, and/or configured by the browser user, and/or periodically downloaded from the network server side, and downloaded to the new script name from the network server side.
  • the existing script name information list is updated with the newly downloaded script name information list.
  • the step of confirming the interception of the script for playing the first video class webpage element further comprises:
  • the first video URL is obtained from the running of the script; and the script for intercepting the first video class webpage element is confirmed according to the first video URL;
  • the step of confirming the interception of the script for playing the second video type webpage element further includes:
  • the second video URL is learned from the running of the script; and the script for intercepting the playing of the second video class webpage element is confirmed according to the second video URL.
  • playing the first video webpage element by using the browser video plugin includes: obtaining the adjustment multiple according to the set video playback fast forward multiple information; modifying the video playback speed of the browser video plugin to the original The product of the playback speed and the adjustment multiplier; using the browser video plug-in to play the first video-type webpage element according to the modified video playback speed;
  • playing the second video webpage element by using the browser video plugin includes: obtaining the original value of the video playback speed according to the reset video playback fast forward multiple information; using the browser video plugin according to The original value of the video playback speed after reset, playing the second video class web page element.
  • the adjustment factor indicated by the video playback fast forward multiple information is set to a value greater than 1.
  • the above-mentioned setting video playback fast forward multiple information includes: intercepting the system running time in the browser video plug-in to obtain a call of the timeGetTime function, and modifying the return value of the system running time obtaining function to the video playing fast forward multiple information, so as to set the video playback fast. Multiplier information;
  • the above-mentioned reset video playback fast forward multiple information includes: by restoring the return value of the system runtime acquisition function to the original value, To reset the video playback fast forward multiple information.
  • the above-mentioned setting video playback fast forward multiple information includes: intercepting a call of a specified waveform output device speed waveOutSetPlaybackRate function in the browser video plug-in, and modifying a play frame frequency used by a function for setting a waveform output device speed to a video playback fast forward multiple Information to set the video playback fast forward multiple information;
  • the above-mentioned reset video playback fast forward multiple information includes: resetting the video playback fast forward multiple information by restoring the playback frame frequency used by the function of setting the specified waveform output device speed to the original value.
  • the script for intercepting the playing of the first video type webpage element includes: selecting, according to the URL of the first video type webpage element, logic used to perform script interception for playing the first video class webpage element.
  • the video data included in the first video type webpage element is advertisement video data
  • the video data included in the second video type webpage element is video and video data.
  • the video webpage element includes at least one type of video as follows: a dynamic image expert group mpg format video, an rm format video, an audio and video interlaced avi format video, a Microsoft media video wmv format video, a Flash video format. Video.
  • the script for playing the first video class webpage element is loaded and intercepted during the buffering phase of the second video class webpage element;
  • the above script for playing the second video type webpage element is loaded and intercepted after the end of the playback of the first video type webpage element.
  • an embodiment of the present invention provides a video playback device for a webpage, including: a webpage loading unit, configured to load a webpage with a video-like webpage element in a browser;
  • a video playback speed modification unit configured to intercept a script for playing a first video type webpage element, and set a video playback fast forward multiple information
  • the video playback speed reset unit is adapted to intercept a script for playing a second video type webpage element, and reset the video playback fast forward multiple information
  • the video playback control unit is adapted to play the first video type webpage element by using the browser video plug-in according to the video playback fast forward multiple information; and, according to the reset video playback fast forward multiple information, use the browser video plug-in to play the second video Class page element.
  • the webpage loading unit is configured to detect the MIME type information of the multi-function webmail of the resource in the loaded webpage.
  • the MIME type information indicates the video type
  • the webpage is known as a webpage with a video-type webpage element.
  • the video playing speed modifying unit is adapted to, when intercepting the browser loading and running the script including the first name information, confirming that the script for playing the first video type webpage element is intercepted, and setting the video playback fast forward multiple information;
  • the video playback speed reset unit is adapted to, when intercepting the browser loading the script including the second name information, confirming the script intercepting the playing of the second video type webpage element, and resetting the video playback fast forward multiple information.
  • the first name information and the second name information are saved in a script name information list on the browser side
  • the device further includes a list obtaining unit, configured to obtain a script name information list from the information provided by the browser, and/or Information configured from the browser user Obtaining a list of script name information, and/or periodically downloading a list of script name information from the web server side, and when downloading from the web server side to the new script name information list, updating the existing one with the newly downloaded script name information list A list of script name information.
  • the video playback speed modification unit is further adapted to: when intercepting the browser loading and running the script including the first name information, learn the first video URL from the running of the script; and confirm the interception to play according to the first video URL.
  • a script for a video class web page element
  • the video playback speed reset unit is further adapted to: when intercepting the browser loading and running the script including the second name information, learning the second video URL from the running of the script; confirming interception to play the second video according to the second video URL A script for a class web page element.
  • the video playback control unit is adapted to learn the adjustment multiple according to the video playback fast forward multiple information; modify the video playback speed of the browser video plug-in to the product of the original playback speed and the adjustment multiple; use the browser video plug-in according to the modified video Play speed, play the first video class webpage element;
  • the video playback control unit is adapted to learn the original value of the video playback speed according to the reset video playback fast forward multiple information; and use the browser video plug-in to play the second video webpage element according to the original value of the reset video playback speed.
  • the video playback speed modifying unit is adapted to set the video playback fast forward multiple information by using a global variable in the browser.
  • the video playback speed modifying unit is adapted to set the adjustment multiple indicated by the video playback fast forward multiple information to a value greater than 1.
  • the video playback speed modification unit is adapted to intercept the system running time of the browser video plug-in to obtain a call of the timeGetTime function, and modify the return value of the system running time acquisition function to the video playback fast forward multiple information to set the video playback fast forward multiple.
  • the video playback speed reset unit is adapted to reset the video playback fast forward multiple information by restoring the return value of the system runtime acquisition function to the original value.
  • the video playing speed modifying unit is adapted to intercept the call of the waveoutSetPlaybackRate function of setting the specified waveform output device speed in the browser video plug-in, and modifying the playing frame rate used by the function for setting the speed of the specified waveform output device to the video playing fast forward multiple information. To set the video playback fast forward multiple information;
  • the video playback speed reset unit is adapted to reset the video playback fast forward multiple information by restoring the playback frame rate used by the function of setting the specified waveform output device speed to the original value.
  • the video playing speed modifying unit is further adapted to select, according to the URL of the first video type webpage element, logic used to perform script interception on playing the first video class webpage element.
  • the video data included in the first video type webpage element is advertisement video data
  • the video data included in the second video type webpage element is video and video data.
  • the video class webpage element includes at least one type of video as follows: Motion Picture Experts Group mpg format video, rm format video, audio and video interlaced avi format video, Microsoft Media Video wmv format video, Flash video format video.
  • the video playback speed modifying unit is adapted to load and intercept a script for playing the first video class webpage element in a buffering phase of the second video class webpage element;
  • the video playback speed reset unit is adapted to load and intercept a script for playing the second video class webpage element after the playback end phase of the first video type webpage element.
  • an embodiment of the present invention provides a computer program, comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to execute the video in the webpage described above Play method.
  • an embodiment of the present invention provides a computer readable medium.
  • the computer readable medium stores the above computer program.
  • the embodiment of the present invention determines that the video starts playing and starts the setting or resetting of the video playback fast forward multiple information by intercepting the corresponding script, so that the browser video plug-in can play the video quickly or normally, and the implementation is completed.
  • the browser controls the in-page advertisement part of the webpage fast-casting video, minimizes the time for the advertisement to be played, and satisfies the needs of the user.
  • the scheme also enables the advertisement to be played to a certain extent, which satisfies the operation requirements of the video provider.
  • FIG. 1 is a schematic structural diagram of a video playback device in a webpage according to an embodiment of the present invention
  • FIG. 2 is a diagram showing a structural relationship between a playback device, a browser, and a web page of a video in a web page according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for playing video in a webpage according to an embodiment of the present invention
  • FIG. 4 shows a block diagram of a computing device for performing a method of playing video in a web page according to the present invention
  • FIG. 5 shows a program for holding or carrying a playback method for implementing video in a web page according to the present invention.
  • the storage unit of the code DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood, and the scope of the disclosure may be fully disclosed to those skilled in the art.
  • An embodiment of the present invention provides a video playback device 100 for a webpage.
  • a webpage loading unit 110 a video playback speed modifying unit 11, a video playback speed reset unit 12, and a video playback control unit are provided.
  • the webpage loading unit 1 10 is adapted to load a webpage with a video-like webpage element in a browser.
  • the web browser mainly interacts with the web server through the HTTP (Hypertext Transfer Protocol) protocol and obtains web pages. These web pages are specified by a URL (Uniform Resource Locator), and the file format is usually HTML (hypertext mark). Language, Hypertext Markup Language) files, as indicated by the MIME (Multipurpose Internet Mail Extensions) in the HTTP protocol. In addition, many browsers support other URL types and their corresponding protocols, such as FTP. Gopher. HTTPS (encrypted version of the HTTP protocol).
  • HTTP content type and URL protocol specification allows web designers to embed images, animations, videos, sounds, streaming media, and more in web pages.
  • the webpage loading unit 1 10 is adapted to detect the MIME type information of the resource in the loaded webpage.
  • the MIME type information indicates the video type
  • the webpage is known as a webpage with a video-type webpage element.
  • the playing device of the video in the webpage provided by the solution may be implemented in the form of a browser component by a playing component of the video set in the webpage in the browser.
  • FIG. 2 a structural relationship diagram of the video playback component 202, the browser 200, and the webpage 204 in the webpage provided by the embodiment is shown.
  • the play component 202 of the video in the webpage can be installed in the browser 200.
  • the browser 200 can load one or more webpages 204, and the browser 200 can invoke the browser video plugin 206 (such as FlashPlayer) in the webpage 204 to play the webpage 204.
  • Video The webpage 204 includes a first video class webpage element 208 and a second video class webpage element 210.
  • the video playback component 202 of the webpage uses the browser video plugin 206 to play the first video class webpage element 208 according to the set video playback fast forward multiple information. And the playing component 202 of the video in the webpage uses the browser video plugin 206 to play the second video class webpage element 210 according to the reset video playing fast forward multiple information.
  • This solution can be applied to a variety of web browsers, such as Microsoft Internet Explorer, Mozilla Firefox, Apple's Safari. Opera. Google Chrome, GreenBrowser, 360 Secure Browser, Sogou High Speed Browser, Tencent TT, Maxthon Tour , Baidu browser and / or Tencent QQ browser.
  • Flash Player is a high-performance, lightweight and expressive client runtime video player that delivers a powerful and consistent user experience across a wide range of mainstream operating systems, browsers, mobile phones and mobile devices. .
  • Flash Player In order to facilitate the understanding of the solution, the following describes the operation of the Flash Player to play the video.
  • video files such as the SWF (ShockWaveFlash) format file, it consists of a sequence of "frames" containing the compiled ActionScript script bytecode and the required data, such as images, sounds, and video. FlashPlayer executes the code on each frame at a fixed frequency in the order of "frames,” to display graphics or play animations and voices.
  • SWF shockWaveFlash
  • Flash Player emits an event (Event).
  • Event include events emitted by objects such as Timer, Mouse, ENTER-FRAMES, and URLLoader.
  • the user code is executed.
  • the first step of all the snooping is performed.
  • the third step of the event emitted by the FlashPlayer the rendering (RENDER) event is dispatched.
  • the dispatch of the RENDER event is caused by the invalidate invalidate() method of the video display stage flash.display.Stage object in the user code.
  • the Stage is the root container of the display object in Flash. invalidateO simply tells the FlashPlayer that the current display list has changed or has expired. Instead of dispatching the RENDER event directly, Flash Player checks to see if the display list has failed before rendering the display list. If the display list has expired, a RENDER event is dispatched before the new display list is rendered, giving the user code the last chance to execute.
  • the fourth step the last user code is executed.
  • the third step of the RENDER event is executed here, which is the chance that the user code will last change the display list before rendering the display list.
  • the user code calls the invalidateO method of the Stage object and no new RENDER events are dispatched.
  • a user accesses Flash (such as a SWF format file) through an HTML page.
  • the web server notifies the browser of the type of the transmitted multimedia data, and the notification means by declaring the MIME type of the multimedia data, so that the browser (and the video playback device 100 in the webpage) can know the type of the received information. And the corresponding plugin required for this type of information is called accordingly.
  • the SWF file exists in the HTML page with the MIME type of "application/x-shockwave-flash".
  • Flash Player When the browser reads the information type "application/x-shockwave-flash", it knows that the type of the information is a video file, and the plug-in Flash Player is automatically called to run the SWF file. Flash Player renders and displays the SWF, where the embedded AVM performs ActionScript binary encoding.
  • Video playback speed modification unit 1 1 1 Blocks the script that plays the first video class web page element, and sets the video playback fast forward multiple information.
  • the video playback fast forward multiple information is a new control information set in the browser in this embodiment.
  • the first video type webpage element is a webpage element that needs to perform a playback speed adjustment, that is, the first video type webpage element is not played according to the original playback speed of the browser video plugin, but the original playback speed needs to be adjusted faster or slower. Then execute the web page element that is played.
  • the scenario in which the first video type webpage element needs to be quickly broadcasted is described.
  • the video data included in the first video webpage element is advertisement video data or other video data that needs to perform fast broadcast.
  • the above intercepted script is used to judge the start of the advertisement video playback, and starts the setting of the video playback fast forward multiple information.
  • the video playback speed modifying unit 1 1 1 of the embodiment can intercept the p-book of the first video-type webpage element by using at least the following three ways:
  • Video Playback Speed Modification Unit 1 1 1 When intercepting the browser to load and run the script including the first name information, confirm the interception of the script for playing the first video class webpage element, and set the video playback fast forward multiple information.
  • the scripts that need to be intercepted can be judged based on the names of specific scripts found after testing by various mainstream video websites (video providers). For example: a script used by a video provider named AppStarUs is sent by the video provider to the browser side when the web page is sent. The script mainly reports that an advertisement video is loaded and played. Make the corresponding page display configuration in the page. Then, when the video playback speed modification unit 1 1 1 intercepts the script that the browser loads and runs the AppStarUs, it confirms that the script that intercepts the first video type webpage element is intercepted, and starts the video playback fast forward multiple information setting.
  • video providers for example: a script used by a video provider named AppStarUs is sent by the video provider to the browser side when the web page is sent. The script mainly reports that an advertisement video is loaded and played. Make the corresponding page display configuration in the page. Then, when the video playback speed modification unit 1 1 1 intercepts the script that the browser loads and runs the AppStarUs, it confirms that the
  • the video playback speed modifying unit 1 1 1 obtains the first video URL from the running of the script when intercepting the browser loading the script including the first name information; according to the first video URL (such as the name and/or content of the URL) Etc.
  • the first video URL is known from the running of the script as http: ⁇ www.tudou.com/albumplay/ Ad/beforeplaying.flv, according to the judgment of the operator, it can be known that the name of the URL of the advertisement video played by the potato contains ad, and it can be confirmed that the first video URL to be loaded as an advertisement is confirmed, that is, the first video page is intercepted and played.
  • the script for the element when the video file provided by the potato website is intercepted and the browser is loaded and run including the script named AppStarUs, the first video URL is known from the running of the script as http: ⁇ www.tudou.com/albumplay/ Ad/beforeplaying.flv, according to the judgment of the operator, it can be known that the name of the
  • the script for intercepting the first video type webpage element is confirmed according to the name information of the script and the name or content of the URL in the script.
  • Video playback speed modification unit 1 1 1 When intercepting the browser loading and running script, the first video URL is obtained from the running of the script, and the interception is confirmed according to the first video URL (such as the name and/or content of the first video URL). A script to play the first video class web page element.
  • the script that intercepts the element of the first video class is simply confirmed based on the URL of the script.
  • the video playback speed modifying unit 1 1 1 realizes the video playback fast forward multiple information by setting a global variable on the browser side.
  • Flash controls the time mainly through timers and sounds.
  • Flash animations such as game screens, are mainly controlled by timers.
  • the threshold of the timer can be set to 50 milliseconds, and each timer will play the next frame when it reaches the threshold.
  • Another way to control the time is sound.
  • the flash playback acceleration can be achieved by intercepting the timer and the sound function.
  • the video playback fast forward multiple information is set by at least the following two ways:
  • Video playback speed modification unit 1 1 1 Intercept the system runtime acquisition (timeGetTime) function in the browser video plug-in, and modify the return value of the timeGetTime function to the video playback fast forward multiple information to set the video playback fast forward multiple information.
  • timeGetTime system runtime acquisition
  • the Flash timer is implemented by the timeGetTime function.
  • the return value of this function is the time from the system startup to the present time. You can get the time interval by the function return value, so that you can know which timers are available. carried out. Therefore, the time acceleration can be realized by modifying the return value of the function. For example, the function value of the first call is 1 and the return value of the second function is 2, and the time interval is 1, if the function called the second time is set. The return value is 1 1, and the time interval is 10, which is equivalent to 10 times acceleration.
  • Video playback speed modification unit 1 1 1 Intercept the call of the specified waveform output device speed ( waveOutSetPlaybackRate ) function in the browser video plug-in, and modify the playback frame rate used by the waveOutSetPlaybackRate function to the video playback fast forward multiple information to set the video playback fast forward. Multiple information.
  • the playback frame rate of the waveOutSetPlaybackRate function is used in this way to realize the video playback fast forward multiple information.
  • the main reason for adopting this approach is:
  • the time required to play a sound is the length of the sound divided by the frame rate per second, so you can change the playback time by modifying the length of the sound or playing the frame rate. For example, you can modify the playback frame rate by waveOutSetPlaybackRate. Play the frame rate to shorten the sound playback time, and also modify the sound length to achieve the time reduction effect.
  • the video playback speed modification unit 1 1 1 indicates the adjustment multiplier by the video playback fast forward multiple information set by the above path, and is required to set the video playback fast forward multiple information for the scene in which the video fast broadcast is required. Adjust the multiple to be large The value at 1.
  • the video playing speed modifying unit 1 1 1 is also adapted to be based on the first video class webpage element.
  • the URL selects the logic used to execute the script interception of playing the first video class webpage element, and uses the selected logic to intercept the script, and then performs the setting operation of the video playback fast forward multiple information.
  • the video playback control unit 1 13 plays the first video type webpage element using the browser video plugin according to the video playback fast forward multiple information. Specifically, the video playback control unit 1 13 learns the adjustment multiple according to the video playback fast forward multiple information, and changes the video playback speed of the browser video plug-in to the product of the original playback speed and the adjustment multiple, and uses the browser video plug-in according to the modified video. Play speed, play the first video class web page elements.
  • the video playback speed modifying unit 1 1 1 loads and intercepts a script for playing the first video class webpage element in the buffering phase of the second video class webpage element, and the video playback speed resetting unit 1 12 plays the first video class webpage element.
  • the script that plays the second video class web page element is loaded and intercepted after the end phase.
  • the video playback speed reset unit 1 12 intercepts the script for playing the second video type webpage element, and resets the video playback fast forward multiple information.
  • the second video type webpage element is a webpage element that does not need to perform the playback speed adjustment, that is, the second video type webpage element can be played according to the original playback speed of the browser video plugin.
  • the video data included in the second video type webpage element may be video data.
  • the video playback speed resetting unit 1 12 of the embodiment can intercept the p-book of the second video-type webpage element by at least the following three methods:
  • Video Playback Speed Resetting Unit 1 12 When intercepting the browser loading and running the script including the second name information, confirm the interception of the script for playing the second video type webpage element, and reset the video playback fast forward multiple information.
  • the above second name information can be obtained after pre-testing and counting on the network server side. In this way, the script that intercepts the element of the second video class is confirmed according to the name information of the script.
  • the video playback speed reset unit 1 when intercepting the browser loading and running the script including the second name information, and learning the second video URL from the running of the script; confirming the interception to play the second video class according to the second video URL Script for web page elements.
  • the indication is included in the name of the URL.
  • the video is the tv identifier of the video and video, and according to the name of the URL, the second video URL of the video and video can be confirmed, and then the script for intercepting the second video-type webpage element is confirmed.
  • the script for intercepting the second video type webpage element is confirmed according to the name information of the script and the name or content of the URL in the script.
  • the video playback speed reset unit 1 when intercepting the browser loading the running script, learns the second video URL from the running of the script, and confirms the interception according to the second video URL (such as the name and/or content of the second video URL).
  • a script to play the second video class web page element when intercepting the browser loading the running script, learns the second video URL from the running of the script, and confirms the interception according to the second video URL (such as the name and/or content of the second video URL).
  • a script to play the second video class web page element when intercepting the browser loading the running script, learns the second video URL from the running of the script, and confirms the interception according to the second video URL (such as the name and/or content of the second video URL).
  • the script that intercepts the element of the second video class is simply confirmed based on the URL of the script.
  • the first name information used by the video playback speed modifying unit 112 and the second name information used by the video playback speed reset unit 112 are stored in the script name information list on the browser side.
  • the above device 100 further includes a list obtaining unit 1 14
  • the list obtaining unit 1 14 is adapted to obtain a list of script name information from the information provided by the browser, for example, including a list of script name information in the browser installation package; and/or,
  • the list obtaining unit 1 14 obtains a script name information list from the information configured by the browser user, and the list obtaining unit 14 receives at least one of the first name information and the second name information configured by the user, and records the information in the script.
  • the name information list and/or,
  • the list obtaining unit 1 14 periodically downloads the script name information list from the web server side, and updates the existing script name information using the newly downloaded script name information list.
  • the first URL used by the video playback speed modifying unit 112 may be obtained by using the first URL used by the video playback speed reset unit 112, and may be obtained in the same manner as the first name information and the second name information, and Saved in the list of script name information.
  • the video playback speed reset unit 1 12 can reset the video playback fast forward multiple information by at least the following two ways:
  • the video playback speed reset unit 1 12 resets the video playback fast forward multiple information by restoring the return value of the timeGetTime function to the original value (ie, the function returns the value of the value before setting the video playback fast forward multiple information).
  • the video playback speed reset unit 1 12 resets the video playback fast forward multiple information by restoring the playback frame rate used by the waveOutSetPlaybackRate function to the original value (ie, the value of the playback frame rate before setting the video playback fast forward multiple information). .
  • the video playback control unit 1 13 plays the second video type web page element using the browser video plugin according to the reset video playback fast forward multiple information.
  • the video playback control unit 1 13 knows the original value of the video playback speed according to the reset video playback fast forward multiple information; using the browser video plug-in according to the weight The original value of the video playback speed is set, and the second video class web page element is played.
  • the video class webpage elements of this embodiment include, but are not limited to, at least one type of video described below:
  • Mpg Motion Picture Experts Group
  • rm Motion Picture Experts Group
  • avi audio video interleaved
  • wmv Microsoft Media Video
  • Windows Media Video Video in Flash video format
  • a further embodiment of the present invention further provides a method for playing video in a webpage.
  • the method begins in step S300 and includes:
  • S302 intercepting a script for playing a first video type webpage element, and setting a video playback fast forward multiple information
  • S306 intercepting a script for playing a second video type webpage element, and resetting the video playback fast forward multiple information
  • step S308 Play the second video type webpage element by using the browser video plugin according to the reset video playback fast forward multiple information.
  • the above steps S300 to S308 are performed on the browser side, as performed by the playback device of the video in the web page set in the browser.
  • the foregoing step S300 includes: detecting MIME type information of a resource in the loaded webpage, and when the MIME type information indicates a video type, knowing that the webpage is a webpage with a video-type webpage element.
  • the step S302 includes: when intercepting a script that loads and runs the first name information by the browser, confirming that the script for playing the first video type webpage element is intercepted, and setting the video playback fast forward multiple information; specifically, the step S302 further includes: when intercepting the browser loading and running the script including the first name information, obtaining the first video URL from the running of the script; confirming, according to the first video URL, the script intercepting the playing of the first video class webpage element; Then
  • the above step S306 includes: when intercepting the browser loading and running the script including the second name information, confirming the interception of the script for playing the second video type webpage element, and resetting the video playback fast forward multiple information. And, the step S306 further includes: when intercepting the browser loading and running the script including the second name information, and learning the second video URL from the running of the script; confirming interception to play the second video class according to the second video URL Script for web page elements.
  • the first name information and the second name information are saved in a script name information list on the browser side; the script name information list including the script name information is provided by the browser, and/or configured by the browser user, and / Or periodically downloaded from the network server side, and use the newly downloaded script name information list to update the existing script name information.
  • the step S304 includes: determining the adjustment multiple according to the set video playback fast forward multiple information; modifying the video playback speed of the browser video plug-in to the product of the original playback speed and the adjustment multiple; using the browser video plug-in according to the modified video Play speed, play the first video class webpage element;
  • the step S308 includes: obtaining the original value of the video playing speed according to the reset video playback fast forward multiple information; playing the second video type webpage element according to the original value of the reset video playing speed by using the browser video plugin.
  • step S302 the video playback fast forward multiple information is set by using a global variable in the browser. And, set up the video
  • the adjustment factor indicated by the playback fast forward multiple information is a value greater than one.
  • the setting of the video playback fast forward multiple information in the foregoing step S302 includes: intercepting a call of a system runtime acquisition (timeGetTime) function in the browser video plug-in, and modifying a return value of the system runtime acquisition function to a video playback.
  • the fast forward multiple information is set to set the video playback fast forward multiple information; then, the resetting the video playback fast forward multiple information in step S304 includes: restoring the video playback fast by restoring the return value of the system running time acquisition function to the original value Multiply information.
  • the setting of the video playback fast forward multiple information in the step S302 includes: intercepting a call of a specified waveform output device speed (waveOutSetPlaybackRate) function in the browser video plug-in, and setting a function for setting a waveform output device speed.
  • the frame rate is modified into a video playback fast forward multiple information to set the video playback fast forward multiple information; then, in step S306, the reset video playback fast forward multiple information includes: a playback frame rate used by setting a function of setting a specified waveform output device speed Revert to the original value to reset the video playback fast forward multiple information.
  • the script for intercepting the playing of the first video type webpage element in the step S302 includes: selecting, according to the URL of the first video type webpage element, logic used to perform script interception on playing the first video type webpage element.
  • the video data included in the first video type webpage element is advertisement video data
  • the video data included in the second video type webpage element is video and video data.
  • the video class webpage element includes at least one type of video as follows: mpg format video, rm format video, avi format video, wmv format video, video in flash video format.
  • the script for playing the first video class webpage element is loaded and intercepted during the buffering phase of the second video class webpage element; and the script for playing the second video class webpage element is the first video class webpage element. After the end of the playback phase is loaded and intercepted.
  • the video files to be played in the scenario include an advertisement video with a URL of URL1 and an officially played video with a URL of URL2.
  • the playback order of the advertisement video is located at the beginning of the video, and the Flash Player is used as the browsing.
  • Video plugin is used as the browsing.
  • the ad video is loaded and played in FlashPlayer during the buffering phase of the officially played video.
  • a script After the advertisement video corresponding to URL1 is played, a script will be loaded and run.
  • the browser intercepts the script to know the end of the advertisement and resets the video playback fast forward multiple information.
  • the browser intercepts the script to know that the official play video is about to start, and reset the video playback fast forward multiple information.
  • the reset operation is implemented by restoring the return value of the timeGetTime function or restoring the playback frame rate of the waveOutSetPlaybackRate function.
  • the embodiment of the present invention determines that the video starts playing and starts the setting or resetting of the video playback fast forward multiple information by intercepting the corresponding script, so that the browser video plug-in can play the video quickly or normally, and the implementation is completed.
  • the browser controls the in-page advertisement part of the webpage fast-casting video, minimizes the time for the advertisement to be played, and satisfies the needs of the user.
  • the scheme also enables the advertisement to be played to a certain extent, which satisfies the operation requirements of the video provider.
  • the solution of the embodiment of the present invention does not need to modify the original data source downloaded from the video provider, and the operation is simple, convenient, and easy to implement.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • the present invention may be employed in any combination (including accompanying claims, not otherwise explicitly stated, the present specification (including accompanying claims, abstracts and Each feature disclosed in the figures can be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a processor DSP
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
  • Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • FIG. 4 illustrates a computing device, such as a client, that can implement a method of playing video in a web page in accordance with the present invention.
  • the computing device conventionally includes a processor 410 and a computer program product or computer readable medium embodied in the form of a memory 420.
  • Memory 420 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above.
  • the storage space 430 for the program code may include respective program codes 431 for respectively implementing various steps in the playback method of the video in the web page described above.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Fig. 5 shows a storage unit 500 for holding or carrying program code for implementing a playback method of video in a web page according to the present invention.
  • the storage unit 500 is an implementation of a computer readable medium storing a method of playing video in a web page of the present invention.
  • the storage unit 500 can be a portable or fixed storage unit.
  • the storage unit 500 can have storage segments, storage spaces, and the like that are similarly arranged to the storage 420 in the computing device of FIG.
  • the program code in the storage unit 500 can be compressed in an appropriate form.
  • the storage unit 500 includes computer readable program code 510 corresponding to the program code 431 of FIG.
  • the computer readable program code 510 is Code that is read by a processor, such as processor 410.
  • program code 510 is run by the computing device, the computing device is caused by program code 510 to perform various steps in the method of playing video in the web page described above.
  • an embodiment or “an embodiment,” or “one or more embodiments” as used herein means that the particular features, structures, or characteristics described in connection with the embodiments are included in at least one embodiment of the invention.
  • the examples of the words “in one embodiment” are not necessarily all referring to the same embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种网页中视频的播放方法和装置,该方法包括:在浏览器中加载带有视频类网页元素的网页(S300);拦截到播放第一视频类网页元素的脚本设置视频播放快进倍数信息(S302);依据视频播放快进倍数信息,使用浏览器视频插件播放第一视频类网页元素(S304);拦截到播放第二视频类网页元素的脚本,重置视频播放快进倍数信息(S306);依据重置的视频播放快进倍数信息,使用浏览器视频插件播放第二视频类网页元素(S308)。

Description

一种网页中视频的播放方法和装置 技术领域 本发明涉及互联网技术领域, 特别涉及一种网页中视频的播放方法和装置。 背景技术
浏览器是指可以显示网页服务器或者文件系统的 HTML (超文本标记语言, Hypertext Markup Language ) 文件内容, 并让用户与这些文件交互的一种软件。
浏览器主要通过 HTTP (超文本传输协议, Hypertext Transfer Protocol )协议与网页服务器交互并 获取网页, 一个网页中可以包括多个文档, 每个文档都是分别从服务器获取的。 大部分的浏览器本 身支持除了 HTML之外的广泛的格式, 例如 JPEG、 PNG- GIF等图像格式, 并且能够扩展支持众多 的插件 ( plug-ins ) 。
目前的浏览器网页已经能支持视频播放功能, 在 Flash (视频) 文件下载后进行播放, 一般的视 频提供方 (例如土豆视频)会在视频的开头加载有一段 10~30秒钟的广告视频。 浏览器会先执行广 告的播放, 在广告播放完毕后再播放后续的视频内容。
现有的浏览器网页播放视频中存在广告播放时间过长, 用户体验较差的问题, 用户希望能少播 放广告, 甚至跳过片头不要播放广告, 然而, 广告视频是包含在浏览器下载到的视频文件本身中的, 将广告视频从整个视频文件中分离出来以避免广告播放的难度较大, 且许多片头广告对视频提供方 来说是为满足运营需求而需要进行强制播放的, 现有的浏览器网页视频播放方案无法在满足用户少 放广告的需求的同时兼顾视频提供方的运营需求。 发明内容 鉴于上述问题, 提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种 网页中视频的播放方法和装置。
依据本发明的一个方面, 本发明实施例提供了一种网页中视频的播放方法, 包括:
在浏览器中加载带有视频类网页元素的网页;
拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数信息;
依据视频播放快进倍数信息, 使用浏览器视频插件播放第一视频类网页元素;
拦截到播放第二视频类网页元素的脚本, 重置视频播放快进倍数信息;
依据重置的视频播放快进倍数信息, 使用浏览器视频插件播放第二视频类网页元素。
其中, 上述在浏览器中加载带有视频类网页元素的网页包括:
检测所加载的网页中资源的多功能网络邮件扩充 MIME类型信息, 当该 MIME类型信息指示视 频类型时, 获知网页为带有视频类网页元素的网页。
其中, 上述拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数信息包括: 当拦截 到浏览器加载运行包括第一名称信息的脚本时, 确认拦截到播放第一视频类网页元素的脚本, 并设 置视频播放快进倍数信息; 则
上述拦截到播放第二视频类网页元素的脚本, 重置视频播放快进倍数信息包括: 当拦截到浏览 器加载运行包括第二名称信息的脚本时, 确认拦截到播放第二视频类网页元素的脚本, 并重置视频 播放快进倍数信息。
其中, 上述第一名称信息、 第二名称信息保存在浏览器侧的脚本名称信息列表中;
其中, 包括上述名称信息的脚本名称信息列表由浏览器自带, 和 /或由浏览器用户进行配置, 和 / 或从网络服务器侧定期下载得到, 并当从网络服务器侧下载到新的脚本名称信息列表时, 利用新下 载的脚本名称信息列表更新已有的脚本名称信息列表。
其中, 上述当拦截到浏览器加载运行包括第一名称信息的脚本时, 确认拦截到播放第一视频类 网页元素的脚本的步骤进一步包括:
当拦截到浏览器加载运行包括第一名称信息的脚本时, 从该脚本的运行中获知第一视频 URL; 根据第一视频 URL确认拦截到播放第一视频类网页元素的脚本; 则
上述当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截到播放第二视频类网页元 素的脚本的步骤进一步包括:
当拦截到浏览器加载运行包括第二名称信息的脚本时, 从该脚本的运行中获知第二视频 URL; 根据第二视频 URL确认拦截到播放第二视频类网页元素的脚本。
其中, 上述依据视频播放快进倍数信息, 使用浏览器视频插件播放第一视频类网页元素包括: 根据设置的视频播放快进倍数信息获知调整倍数; 将浏览器视频插件的视频播放速度修改为原始播 放速度与调整倍数的乘积; 使用浏览器视频插件按照修改后的视频播放速度, 播放第一视频类网页 元素;
上述依据重置的视频播放快进倍数信息, 使用浏览器视频插件播放第二视频类网页元素包括: 根据重置的视频播放快进倍数信息获知视频播放速度的原始值; 使用浏览器视频插件按照重置后的 视频播放速度的原始值, 播放第二视频类网页元素。
其中, 利用浏览器中的全局变量设置视频播放快进倍数信息。
其中, 设置视频播放快进倍数信息指示的调整倍数为大于 1的数值。
其中, 上述设置视频播放快进倍数信息包括: 拦截浏览器视频插件中系统运行时间获取 timeGetTime函数的调用, 将系统运行时间获取函数的返回值修改为视频播放快进倍数信息, 以设置 视频播放快进倍数信息;
上述重置视频播放快进倍数信息包括: 通过将系统运行时间获取函数的返回值恢复为原始值, 以重置视频播放快进倍数信息。
其中, 上述设置视频播放快进倍数信息包括: 拦截浏览器视频插件中设置指定波形输出设备速 度 waveOutSetPlaybackRate 函数的调用, 将设置指定波形输出设备速度的函数使用的播放帧频修改 为视频播放快进倍数信息, 以设置视频播放快进倍数信息;
上述重置视频播放快进倍数信息包括: 通过将设置指定波形输出设备速度的函数使用的播放帧 频恢复为原始值, 以重置视频播放快进倍数信息。
其中, 上述拦截到播放第一视频类网页元素的脚本包括: 根据第一视频类网页元素的 URL, 选 取执行对播放第一视频类网页元素的脚本拦截时使用的逻辑。
其中, 第一视频类网页元素包括的视频数据为广告视频数据, 第二视频类网页元素包括的视频 数据为影视视频数据。
其中, 视频类网页元素包括下述的至少一种类型的视频: 动态图像专家组 mpg格式的视频、 rm 格式的视频、 音视频交错 avi格式的视频、 微软媒体视频 wmv格式的视频、 Flash视频格式的视频。
其中, 上述播放第一视频类网页元素的脚本是在第二视频类网页元素的緩冲阶段时被加载和被 拦截; 则
上述播放第二视频类网页元素的脚本是在第一视频类网页元素的播放结束阶段后被加载和被拦 截。
依据本发明的另一个方面, 本发明实施例提供了一种网页中视频的播放装置, 包括: 网页加载单元, 适于在浏览器中加载带有视频类网页元素的网页;
视频播放速度修改单元, 适于拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数 信息;
视频播放速度重置单元, 适于拦截到播放第二视频类网页元素的脚本, 重置视频播放快进倍数 信息;
视频播放控制单元, 适于依据视频播放快进倍数信息, 使用浏览器视频插件播放第一视频类网 页元素; 以及, 依据重置的视频播放快进倍数信息, 使用浏览器视频插件播放第二视频类网页元素。
其中, 网页加载单元, 适于检测所加载的网页中资源的多功能网络邮件扩充 MIME类型信息, 当该 MIME类型信息指示视频类型时, 获知网页为带有视频类网页元素的网页。
其中, 视频播放速度修改单元, 适于当拦截到浏览器加载运行包括第一名称信息的脚本时, 确 认拦截到播放第一视频类网页元素的脚本, 并设置视频播放快进倍数信息;
视频播放速度重置单元, 适于当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截 到播放第二视频类网页元素的脚本, 并重置视频播放快进倍数信息。
其中, 第一名称信息、 第二名称信息保存在浏览器侧的脚本名称信息列表中, 上述装置还包括 列表获取单元, 适于从浏览器自带的信息中获取脚本名称信息列表, 和 /或从浏览器用户配置的信息 中获取脚本名称信息列表, 和 /或从网络服务器侧定期下载得到脚本名称信息列表, 并当从网络服务 器侧下载到新的脚本名称信息列表时, 利用新下载的脚本名称信息列表更新已有的脚本名称信息列 表。
其中, 视频播放速度修改单元, 进一步适于当拦截到浏览器加载运行包括第一名称信息的脚本 时, 从该脚本的运行中获知第一视频 URL; 根据第一视频 URL确认拦截到播放第一视频类网页元素 的脚本;
视频播放速度重置单元, 进一步适于当拦截到浏览器加载运行包括第二名称信息的脚本时, 从 该脚本的运行中获知第二视频 URL;根据第二视频 URL确认拦截到播放第二视频类网页元素的脚本。
其中, 视频播放控制单元, 适于根据视频播放快进倍数信息获知调整倍数; 将浏览器视频插件 的视频播放速度修改为原始播放速度与调整倍数的乘积; 使用浏览器视频插件按照修改后的视频播 放速度, 播放第一视频类网页元素;
视频播放控制单元, 适于根据重置的视频播放快进倍数信息获知视频播放速度的原始值; 使用 浏览器视频插件按照重置后的视频播放速度的原始值, 播放第二视频类网页元素。
其中, 视频播放速度修改单元, 适于利用浏览器中的全局变量设置视频播放快进倍数信息。 其中, 视频播放速度修改单元, 适于设置视频播放快进倍数信息指示的调整倍数为大于 1 的数 值。
其中, 视频播放速度修改单元, 适于拦截浏览器视频插件中系统运行时间获取 timeGetTime函数 的调用, 将系统运行时间获取函数的返回值修改为视频播放快进倍数信息, 以设置视频播放快进倍 数信息;
视频播放速度重置单元, 适于通过将系统运行时间获取函数的返回值恢复为原始值, 以重置视 频播放快进倍数信息。
其中, 视频播放速度修改单元, 适于拦截浏览器视频插件中设置指定波形输出设备速度 waveOutSetPlaybackRate函数的调用,将设置指定波形输出设备速度的函数使用的播放帧频修改为视 频播放快进倍数信息, 以设置视频播放快进倍数信息;
视频播放速度重置单元, 适于通过将设置指定波形输出设备速度的函数使用的播放帧频恢复为 原始值, 以重置视频播放快进倍数信息。
其中, 视频播放速度修改单元, 还适于根据第一视频类网页元素的 URL, 选取执行对播放第一 视频类网页元素的脚本拦截时使用的逻辑。 其中, 第一视频类网页元素包括的视频数据为广告视频数据, 第二视频类网页元素包括的视频 数据为影视视频数据。
其中, 视频类网页元素包括下述的至少一种类型的视频: 动态图像专家组 mpg格式的视频、 rm格式的视频、 音视频交错 avi格式的视频、 微软媒体视频 wmv格式的视频、 Flash视频格式的视频。
其中, 视频播放速度修改单元, 适于在第二视频类网页元素的緩冲阶段时加载和拦截播放第一 视频类网页元素的脚本;
视频播放速度重置单元, 适于在第一视频类网页元素的播放结束阶段后加载和拦截播放第二视 频类网页元素的脚本。
依据本发明的又一个方面, 本发明实施例提供了一种计算机程序, 包括计算机可读代码, 当所 述计算机可读代码在计算设备上运行时, 导致所述计算设备执行上述的网页中视频的播放方法。
依据本发明的又一个方面, 本发明实施例提供了一种计算机可读介质。 该计算机可读介质存储 了上述计算机程序。
由上所述, 本发明实施例通过拦截相应脚本, 确定视频开始播放并启动视频播放快进倍数信息 的设置或重置等技术手段, 能够使浏览器视频插件快速或者正常播放视频, 实现了通过浏览器控制 网页快播视频的片头广告部分, 尽量缩短了广告播放的时间, 满足的用户的需求, 同时, 本方案也 使广告在一定程度上得到了播放, 满足了视频提供方的运营需求。
并且, 本发明实施例的方案不需要对从视频提供方下载到的原始数据源进行修改, 操作简单、 便捷, 易于实现。 上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的技术手段, 而可依照说明 书的内容予以实施, 并且为了让本发明的上述和其它目的、 特征和优点能够更明显易懂, 以下特举 本发明的具体实施方式。 附图说明 通过阅读下文优选实施方式的详细描述, 各种其他的优点和益处对于本领域普通技术人员将变 得清楚明了。 附图仅用于示出优选实施方式的目的, 而并不认为是对本发明的限制。 而且在整个附 图中, 用相同的参考符号表示相同的部件。 在附图中:
图 1示出了根据本发明一个实施例的一种网页中视频的播放装置结构示意图;
图 2 示出了根据本发明一个实施例的网页中视频的播放装置、 浏览器和网页的一种结构关系示 意图; 以及
图 3示出了根据本发明一个实施例的一种网页中视频的播放方法流程图;
图 4示出了用于执行根据本发明的网页中视频的播放方法的一种计算设备的框图; 以及 图 5示出了用于保持或者携带实现根据本发明的网页中视频的播放方法的程序代码的存储单元。 具体实施方式 下面将参照附图更详细地描述本公开的示例性实施例。 虽然附图中显示了本公开的示例性实施 例, 然而应当理解, 可以以各种形式实现本公开而不应被这里阐述的实施例所限制。 相反, 提供这 些实施例是为了能够更透彻地理解本公开, 并且能够将本公开的范围完整的传达给本领域的技术人 员。
本发明一个实施例提供了一种网页中视频的播放装置 100, 参见图 1, 包括网页加载单元 1 10、 视频播放速度修改单元 1 1 1、视频播放速度重置单元 1 12、视频播放控制单元 1 13和列表获取单元 1 14。 下面分别对这些器件进行说明。
网页加载单元 1 10适于在浏览器中加载带有视频类网页元素的网页。
网页浏览器主要通过 HTTP (超文本传输协议, Hypertext Transfer Protocol )协议与网页服务器交 互并获取网页, 这些网页由 URL (统一资源定位符, Uniform Resource Locator )指定, 文件格式通常 为 HTML (超文本标记语言, Hypertext Markup Language ) 文件, 并由 MIME (多功能网络邮件扩充, Multipurpose Internet Mail Extensions) 在 HTTP协议中指明。 另外, 许多浏览器还支持其他的 URL类 型及其相应的协议, 如 FTP. Gopher. HTTPS ( HTTP协议的加密版本) 。 HTTP 内容类型和 URL 协议规范允许网页设计者在网页中嵌入图像、 动画、 视频、 声音、 流媒体等。
本实施例中, 网页加载单元 1 10适于检测所加载的网页中资源的 MIME类型信息, 当该 MIME 类型信息指示视频类型时, 获知网页为带有视频类网页元素的网页。
示例性的, 本方案提供的网页中视频的播放装置可以浏览器组件的形式, 通过设置在浏览器中 的网页中视频的播放组件实现。 参见图 2, 示出了本实施例提供的网页中视频的播放组件 202、 浏览 器 200和网页 204的一种结构关系示意图。 网页中视频的播放组件 202可以安装在浏览器 200中, 浏览器 200可以加载一个或多个网页 204,浏览器 200可以在网页 204中调用浏览器视频插件 206(如 FlashPlayer )来播放网页 204中的视频。 网页 204中包括第一视频类网页元素 208和第二视频类网页 元素 210, 网页中视频的播放组件 202使用浏览器视频插件 206依据设置的视频播放快进倍数信息播 放第一视频类网页元素 208 , 以及, 网页中视频的播放组件 202使用浏览器视频插件 206依据重置的 视频播放快进倍数信息播放第二视频类网页元素 210。
本方案可以应用在多种网页浏览器中, 例如微软的 Internet Explorer, Mozilla的 Firefox、 Apple的 Safari . Opera. Google Chrome、 GreenBrowser浏览器、 360安全浏览器、 搜狗高速浏览器、 腾讯 TT、 傲游浏览器、 百度浏览器和 /或腾讯 QQ浏览器等。
本实施例可以采用 FlashPlayer (视频播放器) 来实现上述浏览器视频插件。 FlashPlayer是一款 高性能的、 轻量型且极具表现力的客户端运行时视频播放器, 能够在各种主流操作系统、 浏览器、 移动电话和移动设备上提供功能强大且一致的用户体验。
为了便于理解本方案, 下面对 FlashPlayer播放视频的相关操作进行说明。 对于视频文件, 如 SWF ( ShockWaveFlash ) 格式文件, 其由一系列有顺序的 "帧"构成, "帧"中 包含编译后的 ActionScript脚本字节码以及所需的数据,比如图像、声音和视频。 FlashPlayer按照"帧,, 的先后顺序, 以固定的频率执行每一帧上的代码, 以显示图形或者播放动画及语音。
FlashPlayer播放每一帧时, 都按以下步骤进行:
第一步、 Flash Player发出事件 (Event ) 。 这些事件包括由定时器 (Timer ) 、 鼠标 (Mouse ) 、 进入框架 ( ENTER— FRAMES ) 、 URL下载器 (URLLoader ) 等对象所发出的事件。
第二步、 用户代码被执行。 在这个阶段执行所有侦听到的第一步中 FlashPlayer发出的事件的代 第三步、 渲染 (RENDER ) 事件被派发。 RENDER 事件的派发是由用户代码中调用视频显示舞 台 flash.display.Stage对象的失效 invalidate()方法所引起的, Stage (舞台)是 Flash中显示对象的根 容器。 invalidateO只是告知 FlashPlayer 当前的显示列表已经发生变化或者说已经失效, 该方法不直 接派发 RENDER事件, 而是由 Flash Player在渲染显示列表之前检查显示列表是否失效。 如果显示 列表已经失效, 则会在渲染新显示列表前派发 RENDER事件, 给用户代码最后的执行机会。
第四步、 最后的用户代码被执行。 侦听到的第三步 RENDER事件的代码在此处被执行, 这是用 户代码在渲染显示列表前最后更改显示列表的机会。在此阶段,用户代码调用 Stage对象的 invalidateO 方法则不会再派发新的 RENDER事件。
在一个应用场景中, 用户通过 HTML页面访问 Flash (如 SWF格式文件) 。 网络服务器将发送 的多媒体数据的类型通知给浏览器, 而通知手段就是通过声明该多媒体数据的 MIME类型, 这样就 可以让浏览器(以及网页中视频的播放装置 100 )知道所接收信息的类型, 并依此调用该类型信息所 需的对应插件。 SWF文件在 HTML页面中以" application/x-shockwave-flash"的 MIME类型存在。
当浏览器读取到 "application/x-shockwave-flash"这种信息类型时,获知该信息的类型为视频文件, 会自动调用插件 Flash Player来运行 SWF文件。 Flash Player对 SWF进行渲染并显示, 其中内嵌的 AVM会执行 ActionScript二进制编码。
一个视频文件的示例可以参见如下:
<object classid="clsid:D27CDB6E-AE6D- l lcf-96B8-444553540000" codebase="http:〃 download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="宽度" height= "高度 "> //对象的基本信息
<param name="movie" value="文件名 .swf > 〃对象参数定义
<param name="quality" value="high"> 〃对象参数定义
<param name="wmode" value="transparent"> 〃对象参数定义
<embed src=" 文件 名 .swf width=" 宽 度 " height=" 高 度 " quality="high' pluginspage 'http://www.macromedia.com/go/getflashplayer' type="application/x-shockwave-flash' wmode="transparent"x/embed> 〃对象的 MIME参数的定义, 该 MIME参数指示对象的类型 type 为视频文件
</object>
视频播放速度修改单元 1 1 1 拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数信 息。 视频播放快进倍数信息为本实施例在浏览器中新设置的一种控制信息。
第一视频类网页元素为需要执行播放速度调整的网页元素, 即不按照浏览器视频插件的原始播 放速度对第一视频类网页元素进行播放, 而是需要将原始播放速度调快或者调慢后再执行播放的网 页元素。 本实施例中主要以需要快播第一视频类网页元素的场景进行说明, 示例性, 第一视频类网 页元素包括的视频数据为广告视频数据或者其他需要执行快播的视频数据。
上述被拦截的脚本被用于判断开始进行了广告视频的播放, 并启动开始进行视频播放快进倍数 信息的设置。
其中, 本实施例的视频播放速度修改单元 1 1 1 至少可以通过下述三种方式拦截播放第一视频类 网页元素的 p本:
方式一、
视频播放速度修改单元 1 1 1 当拦截到浏览器加载运行包括第一名称信息的脚本时, 确认拦截到 播放第一视频类网页元素的脚本, 并设置视频播放快进倍数信息。
在网络服务器侧可以根据各个主流的视频网站 (视频提供方) 进行的测试后发现的特定脚本的 名称来判断需要拦截的脚本。 例如: 某一视频提供方使用的名称为 AppStarUs的脚本, 该脚本是由 该视频提供方下发网页时下发到浏览器侧进行运行, 该脚本主要是通知页面有一个广告视频会被加 载播放, 在页面中进行相应的页面显示配置。 则当视频播放速度修改单元 1 1 1 拦截到浏览器加载运 行包括 AppStarUs的脚本时, 确认拦截到播放第一视频类网页元素的脚本, 启动开始进行视频播放 快进倍数信息的设置。
这种方式下, 根据脚本的名称信息来确认拦截到播放第一视频类网页元素的脚本。
方式二、
视频播放速度修改单元 1 1 1 当拦截到浏览器加载运行包括第一名称信息的脚本时, 从该脚本的 运行中获知第一视频 URL; 根据第一视频 URL (如 URL的名称和 /或内容等, 例如, 对土豆网站提 供的视频文件, 当拦截到浏览器加载运行包括名称为 AppStarUs的脚本时, 从该脚本的运行中获知 第一视频 URL为 http:〃 www.tudou.com/albumplay/ad/beforeplaying.flv,依据运营人员的判断可知在土 豆的广告视频播放的 URL的名称中都含有 ad的, 可以确认要加载作为广告的第一视频 URL, 即确 认拦截到播放第一视频类网页元素的脚本。
这种方式下, 在方式一通过脚本名称来拦截脚本的基础上, 进一步根据脚本的名称信息结合脚 本中的 URL的名称或内容, 来确认拦截到播放第一视频类网页元素的脚本。 方式二、
视频播放速度修改单元 1 1 1 当拦截到浏览器加载运行脚本时, 从该脚本的运行中获知第一视频 URL, 根据第一视频 URL (如第一视频 URL的名称和 /或内容)确认拦截到播放第一视频类网页元 素的脚本。
这种方式下, 仅仅根据脚本的 URL来确认拦截到播放第一视频类网页元素的脚本。 对浏览器加 载的一个或多个脚本进行解析, 从这些脚本的运行中提取出视频 URL, 当提取出的 URL中存在第一 视频 URL时, 例如, 存在 http:〃 www.tudou.com/albumplay/ad/beforeplaying.flv时, 根据该 URL的名 称中的 ad标识, 可以确认拦截到第一视频类网页元素的脚本。
其中, 视频播放速度修改单元 1 1 1 通过在浏览器侧设置一全局变量来实现视频播放快进倍数信 息。 考虑到 Flash对时间控制主要通过定时器和声音。 一般 Flash动画如游戏画面, 主要靠定时器控 制, 如一秒播放 20帧时, 定时器的阈值可以设置为 50毫秒, 则每一个定时器到达阈值时会播放下 一帧。 另一种控制时间的方式为声音, 声音播放时会有固定的播放速率, 因此播放一段声音的时间 是固定的, Flash通过声音来同步画面。 因此通过对定时器和声音函数进行拦截, 即可实现 Flash播 放加速, 则本实施例至少通过如下两种途径进行视频播放快进倍数信息的设置:
途径一、
视频播放速度修改单元 1 1 1拦截浏览器视频插件中系统运行时间获取 ( timeGetTime ) 函数的调 用, 将 timeGetTime函数的返回值修改为视频播放快进倍数信息, 以设置视频播放快进倍数信息。
即这一途径下采用 timeGetTime函数的返回值实现视频播放快进倍数信息。采用这一途径的主要 原因在于: Flash定时器通过 timeGetTime函数实现, 该函数返回值为从系统启动到现在的时间, 则 可以通过函数返回值来得到时间间隔, 这样即可知道哪些定时器已经可以执行。 因此通过修改函数 返回值即可实现时间加速, 如第一次调用的函数返回值为 1, 第二次调用的函数返回值为 2, 此时时 间间隔为 1, 若设置第二次调用的函数返回值为 1 1, 则时间间隔为 10, 相当于加速 10倍。
途径二、
视频播放速度修改单元 1 1 1 拦截浏览器视频插件中设置指定波形输出设备速度 ( waveOutSetPlaybackRate ) 函数的调用, 将 waveOutSetPlaybackRate函数使用的播放帧频修改为视 频播放快进倍数信息, 以设置视频播放快进倍数信息。
即这一途径下采用 waveOutSetPlaybackRate 函数的播放帧频实现视频播放快进倍数信息。 采用 这一途径的主要原因在于: 播放一段声音需要的时间为声音长度除以每秒帧频, 因此可以通过修改 声音长度或播放帧频改变播放时间, 如通过 waveOutSetPlaybackRate 可以修改播放帧频, 通过修改 播放帧频即可令声音播放时间缩短, 同样修改声音长度也可以达到时间缩短效果。
在本实施例中, 视频播放速度修改单元 1 1 1 通过上述途径设置的视频播放快进倍数信息指示调 整倍数, 且对于需要进行视频快播的场景, 要求设置的视频播放快进倍数信息指示的调整倍数为大 于 1的数值。
由于不同的视频提供方 (如广告公司 ) 提供的第一视频类网页元素 (如广告视频) 可能会具有 不同的运行逻辑, 视频播放速度修改单元 1 1 1还适于根据第一视频类网页元素的 URL, 选取执行对 播放第一视频类网页元素的脚本拦截时使用的逻辑, 采用选取的逻辑对该脚本进行拦截后, 执行视 频播放快进倍数信息的设置操作。
在视频播放速度修改单元 1 1 1设置了视频播放快进倍数信息之后, 视频播放控制单元 1 13依据 视频播放快进倍数信息, 使用浏览器视频插件播放第一视频类网页元素。 具体的, 视频播放控制单 元 1 13 根据视频播放快进倍数信息获知调整倍数, 将浏览器视频插件的视频播放速度修改为原始播 放速度与调整倍数的乘积, 使用浏览器视频插件按照修改后的视频播放速度, 播放第一视频类网页 元素。
视频播放速度修改单元 1 1 1 在第二视频类网页元素的緩冲阶段时加载和拦截播放第一视频类网 页元素的脚本, 视频播放速度重置单元 1 12 在第一视频类网页元素的播放结束阶段后加载和拦截播 放第二视频类网页元素的脚本。 视频播放速度重置单元 1 12拦截到播放第二视频类网页元素的脚本, 重置视频播放快进倍数信息。 第二视频类网页元素为无需执行播放速度调整的网页元素, 即按照浏 览器视频插件的原始播放速度对第二视频类网页元素进行播放即可。 例如, 第二视频类网页元素包 括的视频数据可以为影视视频数据。
其中, 本实施例的视频播放速度重置单元 1 12 至少可以通过下述三种方式拦截播放第二视频类 网页元素的 p本:
方式一、
视频播放速度重置单元 1 12 当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截到 播放第二视频类网页元素的脚本, 并重置视频播放快进倍数信息。
上述第二名称信息可以在网络服务器侧预先测试和统计后得到。 这种方式下, 根据脚本的名称 信息来确认拦截到播放第二视频类网页元素的脚本。
方式二、
视频播放速度重置单元 1 12 当拦截到浏览器加载运行包括第二名称信息的脚本时, 并从该脚本 的运行中获知第二视频 URL;根据第二视频 URL确认拦截到播放第二视频类网页元素的脚本。例如, 对 于 搜 狐 网 站 提 供 的 视 频 文 件 , 当 从 脚 本 的 运 行 中 获 知 如 http://tv.sohu.com/20130510/n375531590.shtml所示的第二视频 URL时, 由于该 URL的名称中包括指 示视频为影视视频的 tv标识, 则根据该 URL的名称可以确认要加载影视视频的第二视频 URL , 则 确认拦截到播放第二视频类网页元素的脚本。
这种方式下, 在方式一通过脚本名称来拦截脚本的基础上, 进一步根据脚本的名称信息结合脚 本中的 URL的名称或内容, 来确认拦截到播放第二视频类网页元素的脚本。 方式二、
视频播放速度重置单元 1 12 当拦截到浏览器加载运行脚本时, 从该脚本的运行中获知第二视频 URL, 根据第二视频 URL (如第二视频 URL的名称和 /或内容)确认拦截到播放第二视频类网页元 素的脚本。
这种方式下, 仅仅根据脚本的 URL来确认拦截到播放第二视频类网页元素的脚本。 对浏览器加 载的一个或多个脚本进行解析, 从这些脚本的运行中提取出视频 URL, 当提取出的 URL中存在第二 视频 URL时, 例如, 存在 http://tv.sohu.com/20130510/n375531590.shtml时, 根据该 URL的名称中的 tv标识, 可以确认拦截到第二视频类网页元素的脚本。
其中, 上述视频播放速度修改单元 1 1 1使用的第一名称信息、 视频播放速度重置单元 1 12使用 的第二名称信息保存在浏览器侧的脚本名称信息列表中, 参见图 1, 上述装置 100还包括列表获取单 元 1 14
列表获取单元 1 14 适于从浏览器自带的信息中获取脚本名称信息列表, 例如, 在浏览器的安装 包中包括有脚本名称信息列表; 和 /或,
列表获取单元 1 14从浏览器用户配置的信息中获取脚本名称信息列表, 列表获取单元 1 14接收 用户配置的第一名称信息和第二名称信息中的至少一种, 并将该信息记录在脚本名称信息列表中; 和 /或,
列表获取单元 1 14从网络服务器侧定期下载得到脚本名称信息列表, 并利用新下载的脚本名称 信息列表更新已有的脚本名称信息。
另外, 上述视频播放速度修改单元 1 1 1使用的第一 URL、 视频播放速度重置单元 1 12使用的第 二 URL也可以采用与获取第一名称信息和第二名称信息相同的方式获得, 并保存在脚本名称信息列 表中。
相应于视频播放速度修改单元 1 1 1 设置视频播放快进倍数信息的两种途径, 视频播放速度重置 单元 1 12可以至少通过下述两种途径重置视频播放快进倍数信息:
途径一、
视频播放速度重置单元 1 12通过将 timeGetTime函数的返回值恢复为原始值(即在设置视频播放 快进倍数信息之前, 该函数返回值的数值) , 以重置视频播放快进倍数信息。
途径二、
视频播放速度重置单元 1 12通过将 waveOutSetPlaybackRate函数使用的播放帧频恢复为原始值 (即在设置视频播放快进倍数信息之前, 该播放帧频的数值) , 以重置视频播放快进倍数信息。
视频播放速度重置单元 1 12对视频播放快进倍数信息进行重置之后, 视频播放控制单元 1 13依 据重置的视频播放快进倍数信息, 使用浏览器视频插件播放第二视频类网页元素。 视频播放控制单 元 1 13 根据重置的视频播放快进倍数信息获知视频播放速度的原始值; 使用浏览器视频插件按照重 置后的视频播放速度的原始值, 播放第二视频类网页元素。
本实施例视频类网页元素包括但不局限于下述的至少一种类型的视频:
mpg (动态图像专家组, Moving Pictures Experts Group ) 格式的视频、 rm格式的视频、 avi (音 频视频交错格式, AudioVideo Interleaved )格式的视频、 wmv (微软媒体视频, (Windows Media Video ) 格式的视频、 Flash视频格式的视频。
本发明又一个实施例还提供了一种网页中视频的播放方法, 参见图 3, 该方法始于步骤 S300, 包括:
S300: 在浏览器中加载带有视频类网页元素的网页;
S302: 拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数信息;
S304: 依据视频播放快进倍数信息, 使用浏览器视频插件播放第一视频类网页元素;
S306: 拦截到播放第二视频类网页元素的脚本, 重置视频播放快进倍数信息;
S308 : 依据重置的视频播放快进倍数信息, 使用浏览器视频插件播放第二视频类网页元素。 上述步骤 S300至 S308在浏览器侧执行, 如由浏览器中设置的网页中视频的播放装置执行。 其中, 上述步骤 S300包括: 检测所加载的网页中资源的 MIME类型信息, 当该 MIME类型信 息指示视频类型时, 获知网页为带有视频类网页元素的网页。
其中, 上述步骤 S302包括: 当拦截到浏览器加载运行包括第一名称信息的脚本时, 确认拦截到 播放第一视频类网页元素的脚本, 并设置视频播放快进倍数信息; 具体的, 该步骤 S302进一步包括: 当拦截到浏览器加载运行包括第一名称信息的脚本时, 从该脚本的运行中获知第一视频 URL; 根据 第一视频 URL确认拦截到播放第一视频类网页元素的脚本; 则
上述步骤 S306包括: 当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截到播放第 二视频类网页元素的脚本, 并重置视频播放快进倍数信息。 以及, 该步骤 S306进一步包括: 当拦截 到浏览器加载运行包括第二名称信息的脚本时, 并从该脚本的运行中获知第二视频 URL; 根据第二 视频 URL确认拦截到播放第二视频类网页元素的脚本。
其中, 上述第一名称信息、 第二名称信息保存在浏览器侧的脚本名称信息列表中; 包括脚本名 称信息的脚本名称信息列表由浏览器自带, 和 /或由浏览器用户进行配置, 和 /或从网络服务器侧定期 下载得到, 并利用新下载的脚本名称信息列表更新已有的脚本名称信息。
其中, 上述步骤 S304包括: 根据设置的视频播放快进倍数信息获知调整倍数; 将浏览器视频插 件的视频播放速度修改为原始播放速度与调整倍数的乘积; 使用浏览器视频插件按照修改后的视频 播放速度, 播放第一视频类网页元素;
上述步骤 S308包括: 根据重置的视频播放快进倍数信息获知视频播放速度的原始值; 使用浏览 器视频插件按照重置后的视频播放速度的原始值, 播放第二视频类网页元素。
其中, 在步骤 S302中, 利用浏览器中的全局变量设置视频播放快进倍数信息。 以及, 设置视频 播放快进倍数信息指示的调整倍数为大于 1的数值。
其中, 一种方式下, 上述步骤 S302中设置视频播放快进倍数信息包括: 拦截浏览器视频插件中 系统运行时间获取( timeGetTime ) 函数的调用, 将系统运行时间获取函数的返回值修改为视频播放 快进倍数信息,以设置视频播放快进倍数信息;则上述步骤 S304中重置视频播放快进倍数信息包括: 通过将系统运行时间获取函数的返回值恢复为原始值, 以重置视频播放快进倍数信息。
又一种方式下, 上述步骤 S302中设置视频播放快进倍数信息包括: 拦截浏览器视频插件中设置 指定波形输出设备速度 (waveOutSetPlaybackRate ) 函数的调用, 将设置指定波形输出设备速度的函 数使用的播放帧频修改为视频播放快进倍数信息, 以设置视频播放快进倍数信息; 则上述步骤 S306 中重置视频播放快进倍数信息包括: 通过将设置指定波形输出设备速度的函数使用的播放帧频恢复 为原始值, 以重置视频播放快进倍数信息。
其中, 上述步骤 S302中拦截到播放第一视频类网页元素的脚本包括: 根据第一视频类网页元素 的 URL, 选取执行对播放第一视频类网页元素的脚本拦截时使用的逻辑。
示例性的, 上述第一视频类网页元素包括的视频数据为广告视频数据, 第二视频类网页元素包 括的视频数据为影视视频数据。视频类网页元素包括下述的至少一种类型的视频: mpg格式的视频、 rm格式的视频、 avi格式的视频、 wmv格式的视频、 Flash视频格式的视频。
其中, 上述播放第一视频类网页元素的脚本是在第二视频类网页元素的緩冲阶段时被加载和被 拦截; 则上述播放第二视频类网页元素的脚本是在第一视频类网页元素的播放结束阶段后被加载和 被拦截。
下面结合一个具体的应用场景来说明本技术方案, 该场景中需要播放的视频文件包括 URL 为 URL1 的广告视频和 URL 为 URL2 的正式播放视频, 广告视频的播放次序位于片头位置, 采用 FlashPlayer作为浏览器视频插件。
广告视频在正式播放视频的緩冲阶段在 FlashPlayer中加载播放。
1 ) 开始播放 URL1对应的广告视频时会加载运行一脚本, 这一脚本被浏览器拦截, 同时在浏览 器侧设置一指示调整倍数的全局变量。
2 )拦截 timeGetTime函数, 调用上述全局变量修改该函数的返回值, 进行间隔调整, 实现视频 播放快进倍数信息的设置; 或者, 拦截 waveOutSetPlaybackRate 函数, 调用上述全局变量修改该函 数的播放帧频, 实现视频播放快进倍数信息的设置。
3 ) URL1 对应的广告视频播放完毕后, 会加载运行一脚本, 浏览器拦截该脚本可以获知广告播 放结束, 重置视频播放快进倍数信息; 或者, URL2对应的正式播放视频开始播放时, 会加载运行一 脚本, 浏览器拦截该脚本可以获知正式播放视频即将开始, 重置视频播放快进倍数信息。 通过恢复 timeGetTime函数的返回值或者恢复 waveOutSetPlaybackRate函数的播放帧频实现重置操作。
4 )按照 FlashPlayer的正常播放速度对緩冲结束的 URL2的视频进行播放。 由上所述, 本发明实施例通过拦截相应脚本, 确定视频开始播放并启动视频播放快进倍数信息 的设置或重置等技术手段, 能够使浏览器视频插件快速或者正常播放视频, 实现了通过浏览器控制 网页快播视频的片头广告部分, 尽量缩短了广告播放的时间, 满足的用户的需求, 同时, 本方案也 使广告在一定程度上得到了播放, 满足了视频提供方的运营需求。
并且, 本发明实施例的方案不需要对从视频提供方下载到的原始数据源进行修改, 操作简单、 便捷, 易于实现。
在此提供的算法和显示不与任何特定计算机、 虚拟系统或者其它设备固有相关。 各种通用系统 也可以与基于在此的示教一起使用。 根据上面的描述, 构造这类系统所要求的结构是显而易见的。 此外, 本发明也不针对任何特定编程语言。 应当明白, 可以利用各种编程语言实现在此描述的本发 明的内容, 并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中, 说明了大量具体细节。 然而, 能够理解, 本发明的实施例可以在没 有这些具体细节的情况下实践。 在一些实例中, 并未详细示出公知的方法、 结构和技术, 以便不模 糊对本说明书的理解。
类似地, 应当理解, 为了精简本公开并帮助理解各个发明方面中的一个或多个, 在上面对本发 明的示例性实施例的描述中, 本发明的各个特征有时被一起分组到单个实施例、 图、 或者对其的描 述中。 然而, 并不应将该公开的方法解释成反映如下意图: 即所要求保护的本发明要求比在每个权 利要求中所明确记载的特征更多的特征。 更确切地说, 如下面的权利要求书所反映的那样, 发明方 面在于少于前面公开的单个实施例的所有特征。 因此, 遵循具体实施方式的权利要求书由此明确地 并入该具体实施方式, 其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解, 可以对实施例中的设备中的模块进行自适应性地改变并且把它 们设置在与该实施例不同的一个或多个设备中。 可以把实施例中的模块或单元或组件组合成一个模 块或单元或组件, 以及此外可以把它们分成多个子模块或子单元或子组件。 除了这样的特征和 /或过 程或者单元中的至少一些是相互排斥之外, 可以采用任何组合对本说明书 (包括伴随的权利要求、 非另外明确陈述, 本说明书 (包括伴随的权利要求、 摘要和附图) 中公开的每个特征可以由提供相 同、 等同或相似目的的替代特征来代替。
此外, 本领域的技术人员能够理解, 尽管在此所述的一些实施例包括其它实施例中所包括的某 些特征而不是其它特征, 但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同 的实施例。 例如, 在下面的权利要求书中, 所要求保护的实施例的任意之一都可以以任意的组合方 式来使用。
本发明的各个部件实施例可以以硬件实现, 或者以在一个或者多个处理器上运行的软件模块实 现, 或者以它们的组合实现。 本领域的技术人员应当理解, 可以在实践中使用微处理器或者数字信 号处理器(DSP )来实现根据本发明实施例的网页中视频的播放装置中的一些或者全部部件的一些或 者全部功能。 本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程 序 (例如, 计算机程序和计算机程序产品) 。 这样的实现本发明的程序可以存储在计算机可读介质 上, 或者可以具有一个或者多个信号的形式。 这样的信号可以从因特网网站上下载得到, 或者在载 体信号上提供, 或者以任何其他形式提供。
例如, 图 4 示出了可以实现根据本发明的网页中视频的播放方法的计算设备, 例如客户端。 该 计算设备传统上包括处理器 410和以存储器 420形式实现的计算机程序产品或者计算机可读介质。 存储器 420 可以是诸如闪存、 EEPROM (电可擦除可编程只读存储器) 、 EPROM、 硬盘或者 ROM 之类的电子存储器。 存储器 420具有用于执行上述方法中的任何方法步骤的程序代码 431 的存储空 间 430。 例如, 用于程序代码的存储空间 430可以包括分别用于实现上述的网页中视频的播放方法中 的各种步骤的各个程序代码 431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入 到这一个或者多个计算机程序产品中。 这些计算机程序产品包括诸如硬盘, 紧致盘 ( CD ) 、 存储卡 或者软盘之类的程序代码载体。
图 5 示出了用于保持或者携带实现根据本发明的网页中视频的播放方法的程序代码的存储单元 500。 存储单元 500为存储了本发明的网页中视频的播放方法的计算机可读介质的一种实现方式。 存 储单元 500可以为便携式或者固定的存储单元。 存储单元 500可以具有与图 4的计算设备中的存储 器 420类似布置的存储段、 存储空间等。 存储单元 500中的程序代码可以适当形式进行压缩。 通常, 存储单元 500包括计算机可读程序代码 510,计算机可读程序代码 510对应于图 4中的用于执行网页 中视频的播放方法的步骤的程序代码 431,即计算机可读程序代码 510为可以由诸如处理器 410之类 的处理器读取的代码。 当由计算设备运行程序代码 510时, 通过程序代码 510使该计算设备执行上 述所描述的网页中视频的播放方法中的各个步骤。
本文中所称的 "一个实施例" 、 "实施例" 或者 "一个或者多个实施例" 意味着, 结合实施例 描述的特定特征、 结构或者特性包括在本发明的至少一个实施例中。 此外, 请注意, 这里 "在一个 实施例中 " 的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制, 并且本领域技术人员在 不脱离所附权利要求的范围的情况下可设计出替换实施例。 在权利要求中, 不应将位于括号之间的 任何参考符号构造成对权利要求的限制。单词"包含"不排除存在未列在权利要求中的元件或步骤。位 于元件之前的单词 "一"或"一个"不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件 的硬件以及借助于适当编程的计算机来实现。 在列举了若干装置的单元权利要求中, 这些装置中的 若干个可以是通过同一个硬件项来具体体现。 单词第一、 第二、 以及第三等的使用不表示任何顺序。 可将这些单词解释为名称。

Claims

权利 要求 书
1、 一种网页中视频的播放方法, 包括:
在浏览器中加载带有视频类网页元素的网页;
拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数信息;
依据所述视频播放快进倍数信息, 使用浏览器视频插件播放所述第一视频类网页元素; 拦截到播放第二视频类网页元素的脚本, 重置所述视频播放快进倍数信息;
依据所述重置的视频播放快进倍数信息, 使用浏览器视频插件播放所述第二视频类网页元素。
2、 根据权利要求 1所述的方法, 其中, 所述在浏览器中加载带有视频类网页元素的网页包括: 检测所加载的网页中资源的多功能网络邮件扩充 MIME类型信息, 当该 MIME类型信息指示视 频类型时, 获知所述网页为带有视频类网页元素的网页。
3、 根据权利要求 1所述的方法, 其中, 所述拦截到播放第一视频类网页元素的脚本, 设置视频 播放快进倍数信息包括:
当拦截到浏览器加载运行包括第一名称信息的脚本时, 确认拦截到播放第一视频类网页元素的 脚本, 并设置视频播放快进倍数信息;
则所述拦截到播放第二视频类网页元素的脚本, 重置所述视频播放快进倍数信息包括: 当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截到播放第二视频类网页元素的 脚本, 并重置所述视频播放快进倍数信息。
4、 根据权利要求 3所述的方法, 其中, 所述第一名称信息、 第二名称信息保存在浏览器侧的脚 本名称信息列表中;
其中包括所述名称信息的脚本名称信息列表由浏览器自带, 和 /或由浏览器用户进行配置, 和 / 或从网络服务器侧定期下载得到, 并当从网络服务器侧下载到新的脚本名称信息列表时, 利用新下 载的脚本名称信息列表更新已有的脚本名称信息列表。
5、 根据权利要求 3所述的方法, 其中, 所述当拦截到浏览器加载运行包括第一名称信息的脚本 时, 确认拦截到播放第一视频类网页元素的脚本的步骤进一步包括:
当拦截到浏览器加载运行包括第一名称信息的脚本时, 从该脚本的运行中获知第一视频 URL; 根据所述第一视频 URL确认拦截到播放第一视频类网页元素的脚本;
则所述当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认拦截到播放第二视频类网页 元素的脚本的步骤进一步包括:
当拦截到浏览器加载运行包括第二名称信息的脚本时, 从该脚本的运行中获知第二视频 URL; 根据所述第二视频 URL确认拦截到播放第二视频类网页元素的脚本。
6、 根据权利要求 1所述的方法, 其中,
所述依据所述视频播放快进倍数信息, 使用浏览器视频插件播放所述第一视频类网页元素包括: 根据所述设置的视频播放快进倍数信息获知调整倍数; 将浏览器视频插件的视频播放速度修改为原 始播放速度与调整倍数的乘积; 使用浏览器视频插件按照修改后的视频播放速度, 播放所述第一视 频类网页元素;
所述依据所述重置的视频播放快进倍数信息, 使用浏览器视频插件播放所述第二视频类网页元 素包括: 根据所述重置的视频播放快进倍数信息获知视频播放速度的原始值; 使用浏览器视频插件 按照重置后的视频播放速度的原始值, 播放所述第二视频类网页元素。
7、 根据权利要求 1所述的方法, 其中, 利用浏览器中的全局变量设置所述视频播放快进倍数信 息。
8、 根据权利要求 7所述的方法, 其中, 设置所述视频播放快进倍数信息指示的调整倍数为大于 1的数值。
9、 根据权利要求 7所述的方法, 其中,
所述设置视频播放快进倍数信息包括: 拦截所述浏览器视频插件中系统运行时间获取 timeGetTime 函数的调用, 将所述系统运行时间获取函数的返回值修改为所述视频播放快进倍数信 息, 以设置视频播放快进倍数信息;
所述重置所述视频播放快进倍数信息包括: 通过将所述系统运行时间获取函数的返回值恢复为 原始值, 以重置所述视频播放快进倍数信息。
10、 根据权利要求 7所述的方法, 其中,
所述设置视频播放快进倍数信息包括: 拦截所述浏览器视频插件中设置指定波形输出设备速度 waveOutSetPlaybackRate函数的调用,将所述设置指定波形输出设备速度的函数使用的播放帧频修改 为所述视频播放快进倍数信息, 以设置视频播放快进倍数信息;
所述重置所述视频播放快进倍数信息包括: 通过将所述设置指定波形输出设备速度的函数使用 的播放帧频恢复为原始值, 以重置所述视频播放快进倍数信息。
1 1、 根据权利要求 1所述的方法, 其中,
所述拦截到播放第一视频类网页元素的脚本包括: 根据所述第一视频类网页元素的 URL, 选取 执行对所述播放第一视频类网页元素的脚本拦截时使用的逻辑。
12、 根据权利要求 1所述的方法, 其中,
所述第一视频类网页元素包括的视频数据为广告视频数据, 所述第二视频类网页元素包括的视 频数据为影视视频数据。
13、 根据权利要求 1所述的方法, 其中,
所述视频类网页元素包括下述的至少一种类型的视频: 动态图像专家组 mpg格式的视频、 rm格 式的视频、 音视频交错 avi格式的视频、 微软媒体视频 wmv格式的视频、 Flash视频格式的视频。
14、 根据权利要求 1所述的方法, 其中, 所述播放第一视频类网页元素的脚本是在第二视频类网页元素的緩冲阶段时被加载和被拦截; 则所述播放第二视频类网页元素的脚本是在第一视频类网页元素的播放结束阶段后被加载和被拦 截。
15、 一种网页中视频的播放装置, 包括:
网页加载单元, 适于在浏览器中加载带有视频类网页元素的网页;
视频播放速度修改单元, 适于拦截到播放第一视频类网页元素的脚本, 设置视频播放快进倍数 信息;
视频播放速度重置单元, 适于拦截到播放第二视频类网页元素的脚本, 重置所述视频播放快进 倍数信息;
视频播放控制单元, 适于依据所述视频播放快进倍数信息, 使用浏览器视频插件播放所述第一 视频类网页元素; 以及, 依据所述重置的视频播放快进倍数信息, 使用浏览器视频插件播放所述第 二视频类网页元素。
16、 根据权利要求 15所述的装置, 其中,
所述网页加载单元, 适于检测所加载的网页中资源的多功能网络邮件扩充 MIME类型信息, 当 该 MIME类型信息指示视频类型时, 获知所述网页为带有视频类网页元素的网页。
17、 根据权利要求 15所述的装置, 其中,
所述视频播放速度修改单元, 适于当拦截到浏览器加载运行包括第一名称信息的脚本时, 确认 拦截到播放第一视频类网页元素的脚本, 并设置视频播放快进倍数信息;
所述视频播放速度重置单元, 适于当拦截到浏览器加载运行包括第二名称信息的脚本时, 确认 拦截到播放第二视频类网页元素的脚本, 并重置所述视频播放快进倍数信息。
18、 根据权利要求 17所述的装置, 其中, 所述第一名称信息、 第二名称信息保存在浏览器侧的 脚本名称信息列表中, 所述装置还包括列表获取单元, 适于从浏览器自带的信息中获取脚本名称信 息列表, 和 /或从浏览器用户配置的信息中获取脚本名称信息列表, 和 /或从网络服务器侧定期下载得 到脚本名称信息列表, 并当从网络服务器侧下载到新的脚本名称信息列表时, 利用新下载的脚本名 称信息列表更新已有的脚本名称信息列表。
19、 根据权利要求 17所述的装置, 其中,
所述视频播放速度修改单元, 进一步适于当拦截到浏览器加载运行包括第一名称信息的脚本时, 从该脚本的运行中获知第一视频 URL;根据所述第一视频 URL确认拦截到播放第一视频类网页元素 的脚本;
所述视频播放速度重置单元, 进一步适于当拦截到浏览器加载运行包括第二名称信息的脚本时, 从该脚本的运行中获知第二视频 URL;
根据所述第二视频 URL确认拦截到播放第二视频类网页元素的脚本。
20、 根据权利要求 15所述的装置, 其中,
所述视频播放控制单元, 适于根据所述视频播放快进倍数信息获知调整倍数; 将浏览器视频插 件的视频播放速度修改为原始播放速度与调整倍数的乘积; 使用浏览器视频插件按照修改后的视频 播放速度, 播放所述第一视频类网页元素;
所述视频播放控制单元, 适于根据所述重置的视频播放快进倍数信息获知视频播放速度的原始 值; 使用浏览器视频插件按照重置后的视频播放速度的原始值, 播放所述第二视频类网页元素。
21、 根据权利要求 15所述的装置, 其中,
所述视频播放速度修改单元, 适于利用浏览器中的全局变量设置所述视频播放快进倍数信息。
22、 根据权利要求 21所述的装置, 其中, 所述视频播放速度修改单元, 适于设置所述视频播放 快进倍数信息指示的调整倍数为大于 1的数值。
23、 根据权利要求 21所述的装置, 其中,
所述视频播放速度修改单元, 适于拦截所述浏览器视频插件中系统运行时间获取 timeGetTime 函数的调用, 将所述系统运行时间获取函数的返回值修改为所述视频播放快进倍数信息, 以设置视 频播放快进倍数信息;所述视频播放速度重置单元, 适于通过将所述系统运行时间获取函数的返回值 恢复为原始值, 以重置所述视频播放快进倍数信息。
24、 根据权利要求 21所述的装置, 其中,
所述视频播放速度修改单元, 适于拦截所述浏览器视频插件中设置指定波形输出设备速度 waveOutSetPlaybackRate函数的调用,将所述设置指定波形输出设备速度的函数使用的播放帧频修改 为所述视频播放快进倍数信息, 以设置视频播放快进倍数信息;
所述视频播放速度重置单元, 适于通过将所述设置指定波形输出设备速度的函数使用的播放帧 频恢复为原始值, 以重置所述视频播放快进倍数信息。
25、 根据权利要求 15所述的装置, 其中,
所述视频播放速度修改单元, 还适于根据所述第一视频类网页元素的 URL, 选取执行对所述播 放第一视频类网页元素的脚本拦截时使用的逻辑。
26、 根据权利要求 15所述的装置, 其中,
所述第一视频类网页元素包括的视频数据为广告视频数据, 所述第二视频类网页元素包括的视 频数据为影视视频数据。
27、 根据权利要求 15所述的装置, 其中,
所述视频类网页元素包括下述的至少一种类型的视频: 动态图像专家组 mpg格式的视频、 rm格 式的视频、 音视频交错 avi格式的视频、 微软媒体视频 wmv格式的视频、 Flash视频格式的视频。
28、 根据权利要求 15所述的装置, 其中,
所述视频播放速度修改单元, 适于在第二视频类网页元素的緩冲阶段时加载和拦截所述播放第 一视频类网页元素的脚本;
所述视频播放速度重置单元, 适于在第一视频类网页元素的播放结束阶段后加载和拦截所述播 放第二视频类网页元素的脚本。
29、 一种计算机程序, 包括计算机可读代码, 当所述计算机可读代码在计算设备上运行时, 导 致所述计算设备执行根据权利要求 1至 14中的任一个所述的网页中视频的播放方法。
30、 一种计算机可读介质, 其中存储了如权利要求 29所述的计算机程序。
PCT/CN2014/071540 2013-05-16 2014-01-27 一种网页中视频的播放方法和装置 WO2014183487A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310181177.1A CN103268337B (zh) 2013-05-16 2013-05-16 一种网页中视频的播放方法和装置
CN201310181177.1 2013-05-16

Publications (1)

Publication Number Publication Date
WO2014183487A1 true WO2014183487A1 (zh) 2014-11-20

Family

ID=49011966

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/071540 WO2014183487A1 (zh) 2013-05-16 2014-01-27 一种网页中视频的播放方法和装置

Country Status (2)

Country Link
CN (1) CN103268337B (zh)
WO (1) WO2014183487A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331876A (zh) * 2016-09-09 2017-01-11 乐视控股(北京)有限公司 网页视频播放方法及装置
CN108234402A (zh) * 2016-12-15 2018-06-29 北京小度互娱科技有限公司 在移动客户端获取视频流的方法和装置以及向移动客户端提供可执行代码的方法和装置

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268337B (zh) * 2013-05-16 2016-09-28 北京奇虎科技有限公司 一种网页中视频的播放方法和装置
CN104581171B (zh) * 2013-10-15 2019-08-27 腾讯科技(深圳)有限公司 一种浏览器上播放视频的方法、装置及移动终端
CN104918119B (zh) * 2014-03-11 2018-09-04 腾讯科技(深圳)有限公司 基于iOS浏览器的视频处理方法及视频处理装置
CN104159141A (zh) * 2014-07-23 2014-11-19 广州金山网络科技有限公司 一种播放视频的方法以及装置
CN104602034B (zh) * 2014-12-31 2019-05-31 北京奇艺世纪科技有限公司 一种移动网页的播放方法和系统
CN106162362B (zh) * 2015-04-20 2020-10-16 中兴通讯股份有限公司 一种视频播放方法及播放器
CN105578200A (zh) * 2015-12-15 2016-05-11 天脉聚源(北京)教育科技有限公司 一种视频处理方法及装置
CN105528217A (zh) * 2015-12-24 2016-04-27 北京白鹭时代信息技术有限公司 一种基于显示列表的局部刷新方法及装置
CN106230644B (zh) * 2016-08-31 2020-01-21 北京像素软件科技股份有限公司 一种客户端加速的检测方法
CN113497967B (zh) * 2021-05-26 2023-03-14 浙江大华技术股份有限公司 基于浏览器的视频帧切换方法、装置和存储介质
CN113487355A (zh) * 2021-07-07 2021-10-08 维沃移动通信(杭州)有限公司 广告展示方法、装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101350729A (zh) * 2007-07-19 2009-01-21 华为技术有限公司 一种广告播放方法及广告系统以及相关设备
CN101632069A (zh) * 2007-02-26 2010-01-20 思科技术公司 用于呈现与记录内容有关的信息的方法和系统
CN102027741A (zh) * 2008-05-29 2011-04-20 国际商业机器公司 由多个输入视频流产生组合视频流
CN103268337A (zh) * 2013-05-16 2013-08-28 北京奇虎科技有限公司 一种网页中视频的播放方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101632069A (zh) * 2007-02-26 2010-01-20 思科技术公司 用于呈现与记录内容有关的信息的方法和系统
CN101350729A (zh) * 2007-07-19 2009-01-21 华为技术有限公司 一种广告播放方法及广告系统以及相关设备
CN102027741A (zh) * 2008-05-29 2011-04-20 国际商业机器公司 由多个输入视频流产生组合视频流
CN103268337A (zh) * 2013-05-16 2013-08-28 北京奇虎科技有限公司 一种网页中视频的播放方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331876A (zh) * 2016-09-09 2017-01-11 乐视控股(北京)有限公司 网页视频播放方法及装置
CN108234402A (zh) * 2016-12-15 2018-06-29 北京小度互娱科技有限公司 在移动客户端获取视频流的方法和装置以及向移动客户端提供可执行代码的方法和装置

Also Published As

Publication number Publication date
CN103268337B (zh) 2016-09-28
CN103268337A (zh) 2013-08-28

Similar Documents

Publication Publication Date Title
WO2014183487A1 (zh) 一种网页中视频的播放方法和装置
US11757961B2 (en) System and method for streaming content from multiple servers
US8555163B2 (en) Smooth streaming client component
RU2500026C2 (ru) Способ и устройство для показа относящихся к веб-странице ресурсов
US20130019149A1 (en) Media Recorder
US9743137B2 (en) Run-time SDK integration for connected video players
JP2013516923A (ja) メディア再生デバイスのためのリアルタイムのフラッシュベースのユーザインターフェース
JP2022553996A (ja) ビデオ再生方法、装置、機器及びコンピュータプログラム
CN111510789B (zh) 视频播放方法、系统、计算机设备及计算机可读存储介质
US20150268808A1 (en) Method, Device and System for Multi-Speed Playing
US9705942B2 (en) Progressive playback
WO2009052269A2 (en) System and method for an extensible media player
CN112449250B (zh) 一种视频资源的下载方法、装置、设备和介质
WO2015143854A1 (zh) 数据获取及交互方法、机顶盒、服务器、多媒体系统
CA2745981A1 (en) A computer-implemented method, a computer program product and an embedded system for increasing the speed of data retrieval by a client on the embedded system
US9292081B2 (en) Systems and methods for programmatically interacting with a media player
CN112565877B (zh) 投屏方法、系统、电子设备及存储介质
US9049472B2 (en) Systems and methods for dynamic media players utilizing media traits
US8332529B1 (en) Media content including introduced code
KR102432376B1 (ko) 콘텐츠 재생 방법 및 시스템
CN113364728B (zh) 媒体内容接收方法、装置、存储介质和计算机设备
KR102228375B1 (ko) 다수의 스트리밍 콘텐츠들을 재생하는 방법 및 시스템
WO2012166154A1 (en) Embedded video player with modular ad processing
Podjarny Responsive & Fast: Implementing High-Performance Responsive Design

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14798112

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14798112

Country of ref document: EP

Kind code of ref document: A1