Summary of the invention
Present invention is primarily targeted at solve advertisement fail for video window position or size variation make respective change throw in real time and advertisement putting scope is subject to the technical problem of restriction of Video Applications.
For achieving the above object, the present invention provides a kind of method of advertisement putting, and the method for described advertisement putting comprises the following steps:
S1, when starting Video Applications, display device obtains the first coordinate information and the first size information of the video window of described Video Applications;
S2, obtain the input effect information of advertisement, obtain the second dimension information according to described input effect information, and calculate the second coordinate information of the advertisement windows thrown in described video window according to described first coordinate information, first size information and described input effect information;
S3, obtains attribute information and the ad content of advertisement, is drawn to the screen of described display device by described ad content according to described second coordinate information, the second dimension information, attribute information;
S4, whether the first coordinate information and/or the first size information that detect described video window change; If so, return the first coordinate information reacquiring video window in step S1 and first size information and circulate.
Preferably, described step S1 includes:
Step S11, when starting Video Applications, extracts the layout configuration file of the video window of described Video Applications;
Step S12, obtains described first coordinate information and first size information according to described layout configuration file.
Preferably, described step S2 includes:
Step S21, obtains described advertisement windows and accounts for the scale of described video window relative to the relative position information of described video window and described advertisement windows, and calculate described second dimension information according to described first size information and described scale;
Step S22, the scale accounting for described video window according to described first coordinate information, first size information, described relative position information and described advertisement windows calculates described second coordinate information.
Preferably, the method for described advertisement putting also included before S1:
When described display device connects network, the input effect information of described advertisement, the attribute information of advertisement and ad content are downloaded to this locality and preserve.
Additionally, for achieving the above object, the present invention also provides for a kind of display device, and described display device includes:
Acquisition module, for when starting Video Applications, display device obtains the first coordinate information and the first size information of the video window of described Video Applications;
Computing module, for obtaining the input effect information of advertisement, obtain the second dimension information according to described input effect information, and calculate the second coordinate information of the advertisement windows thrown in described video window according to described first coordinate information, first size information and described input effect information;
Drafting module, for obtaining attribute information and the ad content of advertisement, draws described ad content to the screen of described display device according to described second coordinate information, the second dimension information, attribute information;
Detection module, for whether the first coordinate information and/or first size information detecting described video window changes;
Loop module, if the first coordinate information and/or first size information for described video window change, then reacquires the first coordinate information of video window and circulates.
Preferably, described acquisition module includes:
Extraction unit, for when starting Video Applications, extracting the layout configuration file of the video window of described Video Applications;
First acquiring unit, for obtaining described first coordinate information and first size information according to described layout configuration file.
Preferably, described computing module includes:
Second acquisition unit, account for the scale of described video window for obtaining described advertisement windows relative to the relative position information of described video window and described advertisement windows, and calculate described second dimension information according to described first size information and described scale;
Computing unit, the scale for accounting for described video window according to described first coordinate information, first size information, described relative position information and described advertisement windows calculates described second coordinate information.
Preferably, described display device also includes:
Download module, for when described display device connects network, being downloaded to this locality by the input effect information of described advertisement, the attribute information of advertisement and ad content and preserve.
The put-on method of a kind of advertisement of the present invention and display device, the first coordinate information and the first size information of video window can be obtained when starting Video Applications, throw in effect information, then obtain the second dimension information of advertisement windows and calculate the second coordinate information that advertisement windows is thrown in video window, advertisement is drawn in screen according to the second coordinate information and the second dimension information, when the first coordinate information of video window and/or first size information change, the second coordinate information and/or second dimension information of advertisement windows can be recalculated, and repaint advertisement, achieve advertisement and can make the real-time input of respective change for video window position or size variation, additionally, no matter user starts any Video Applications, display device all may determine that placement position and the actual size of advertisement windows, and finally realize being plotted in by ad content in determined placement position, make the input of advertisement not by the restriction of Video Applications, expand the input scope of advertisement, and can throw in the optional position of video window.
Detailed description of the invention
Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention.
The present invention provides a kind of method of advertisement putting, and with reference to Fig. 1, in one embodiment, the method for this advertisement putting includes:
Step S1, when starting Video Applications, display device obtains the first coordinate information and the first size information of the video window of described Video Applications;
In the present embodiment, display device can be television set, panel computer or mobile phone etc., and this display device is the equipment of Android operation system.
In the present embodiment, Video Applications can be third-party Video Applications or non-third-party Video Applications, and it can play local video, Online Video and video web page etc., for instance can be MPC, PPTV or excellent cruel video etc.
In the present embodiment, the first coordinate information of the video window of Video Applications is preferably video window top left co-ordinate information, and first size information refers to width and the elevation information of video window.
In the present embodiment, drawn by layout configuration file when drawing the view of video window, the width of view, high measurement is carried out by the attribute of definition in layout configuration file, obtain first size information, with the upper left corner of the screen of display device for zero (0,0), calculated from Edge Distance and the first size information of display window by video window and obtain the video window upper left corner from initial point (0,0) distance, thus obtaining video window the first coordinate information. Then it is laid out operation further according to layout configuration file attribute information, the first coordinate, first size information etc.
Step S2, obtain the input effect information of advertisement, obtain the second dimension information according to described input effect information, and calculate the second coordinate information of the advertisement windows thrown in described video window according to described first coordinate information, first size information and described input effect information;
In the present embodiment, advertisement operators, in order to reach the display effect of certain advertisement, plays the ad-hoc location that advertisement can be thrown in the process of video video window according to certain scale in Video Applications. In the present embodiment, the input effect information of advertisement includes advertisement windows and accounts for the scale of video window and the relative position information of advertisement windows and video window, wherein, described relative position information can be the relative position between limit and the limit of two windows, or can be the center distance etc. to the both sides of video window of advertisement windows.
In the present embodiment, the second coordinate information is preferably advertisement windows top left co-ordinate information, and the second dimension information refers to throw in width and the elevation information of the advertisement windows set in effect. The present embodiment can calculate the second dimension information according to throwing in effect information with first size information; If it addition, have learned that the relative position information of the scale shared by the first coordinate information of video window and first size information, advertisement windows and advertisement windows and video window, then can directly calculate the second coordinate information.
Step S3, obtains attribute information and the ad content of advertisement, is drawn to the screen of described display device by described ad content according to described second coordinate information, the second dimension information, attribute information;
In the present embodiment, the attribute information of advertisement includes the information such as transparency and the rank of advertisement windows. Even have learned that the second coordinate information and second dimension information of advertisement windows, then display device can create an advertisement windows according to the second coordinate information and the second dimension information, then according to the attribute information of described advertisement, ad content is drawn to advertisement windows again, realize advertisement input in any video window, and the position that advertisement is thrown in Video Applications is also arbitrary, such as the position etc. of the position in the lower left corner or the upper right corner, make broadcasting or the display effect variation of advertisement.
In the present embodiment, the broadcast mechanism of android system can be utilized: write inside broadcast additional data by the second coordinate information and the second dimension information, broadcast announcement is sent to whole system with broadcast event, when listening to broadcast and sending, the second coordinate information and second dimension information of advertisement windows in broadcast data can be extracted. Utilize the second coordinate information and the second dimension information, it is possible to advertisement is drawn in specific position on the screen of a display device. Wherein, first the attribute information of advertisement, the second dimension information and the second coordinate information are passed to Android window management service. Then the service of Android window management starts, according to these attribute informations, the second dimension information and the second coordinate information, draw out the advertisement of appropriate level and play.
S4, whether the first coordinate information and/or the first size information that detect described video window change; If so, returning the first coordinate information reacquiring video window in step S1 and first size information and circulate, otherwise entering step S5, namely display device keeps current display effect.
In the present embodiment, when carrying out the operations such as the rolling of full frame/non-full frame switching or the page as user, first coordinate information and/or the first size information of video window there occurs change, now need to reacquire position and the size of video window, namely the first coordinate information and first size information are obtained, then recalculate the second dimension information and the second coordinate information, render to position and the size of advertisement windows on video window with correspondence adjustment.
In the present embodiment, Video Applications just have registered monitoring when instantiation, when the rolling listening to full frame/non-full frame switching or the page causes its position and/or change in size, reacquire the first coordinate information and the first size information of video window, then the second coordinate information and/or second dimension information of advertisement windows are calculated, and repainting advertisement, it is achieved that advertisement can make the real-time input of respective change for video window position and/or size variation. Such as video window is rolled into bottom by top, and advertisement is also as the rolling of video window and rolls; Video window from full frame to non-full frame switching time, the size and location of advertisement also change therewith, such as, video window is by full frame change half screen, its width or height reduce by half, the size of advertisement windows is the half of video window size, namely the size of advertisement windows become that original video window is wide or high by the half that original video window is wide or high 1/4.
Compared with prior art, the present embodiment can obtain the first coordinate information and the first size information of video window when starting Video Applications, throw in effect information, then obtain the second dimension information of advertisement windows and calculate the second coordinate information that advertisement windows is thrown in video window, advertisement is drawn in screen according to the second coordinate information and the second dimension information, when the first coordinate information of video window and/or first size information change, the second coordinate information and/or second dimension information of advertisement windows can be recalculated, and repaint advertisement, achieve advertisement and can make the real-time input of respective change for video window position or size variation, additionally, no matter user starts any Video Applications, display device all may determine that placement position and the actual size of advertisement windows, and finally realize being plotted in by ad content in determined placement position, make the input of advertisement not by the restriction of Video Applications, expand the input scope of advertisement, and can throw in the optional position of video window.
In a preferred embodiment, as in figure 2 it is shown, on the basis of the embodiment of above-mentioned Fig. 1, above-mentioned steps S1 includes:
Step S11, when starting Video Applications, extracts the layout configuration file of the video window of described Video Applications;
Step S12, obtains described first coordinate information and first size information according to described layout configuration file.
In the present embodiment, the window of android system is drawn and is included: when user is by clicking the application icon at main interface or operating by remote control applications hot key etc., Video Applications on display device starts, start the flow process performing to draw the video window of Video Applications, when completing, the video window of Video Applications just can be presented on user at the moment.
Wherein, in window is drawn, father's view includes multiple many sub-views, and the content of sub-view can be word, it is also possible to be picture, and the video window of the present embodiment is the sub-view of one of them.
When drawing father's view and sub-view, first carry out wide and high measurement according to the attribute of definition in the layout configuration file specifying to both, check whether a certain sub-view fills completely full frame as by layout configuration file width, height, or be configured to width, the height fixed, or by content actual disposition width, height. Then according to these configurations, measurement is performed. What first measure is father's view, measures the width of each sub-view, height more successively, get first size information with this after completing. When completing to measure operation, display device proceeds by layout operation.
In the present embodiment, in conjunction with consulting Fig. 3, with the coordinate in the upper left corner of father's view (being equivalent to the desktop of above-mentioned display screen) for zero (0,0), according to layout configuration file, obtain sub-view (being equivalent to above-mentioned video window) from the back gauge of father's view distance and above-mentioned measured by obtain width, height, finally calculate the sub-view top left co-ordinate relative to father's view, i.e. the first coordinate information, the coordinate calculating the upper left corner obtaining video window as shown in Figure 3 is (X, Y).
In a preferred embodiment, as shown in Figure 4, on the basis of the embodiment of above-mentioned Fig. 1, above-mentioned steps S2 includes:
Step S21, obtains described advertisement windows and accounts for the scale of described video window relative to the relative position information of described video window and described advertisement windows, and calculate described second dimension information according to described first size information and described scale;
Step S22, the scale accounting for described video window according to described first coordinate information, first size information, described relative position information and described advertisement windows calculates described second coordinate information.
In the present embodiment, the input effect information of advertisement includes advertisement windows and accounts for the scale of video window relative to the relative position information of described video window and described advertisement windows.
As shown in Figure 3, the scale of video window is accounted for for 1/16 for advertisement windows, zero is (0,0), first coordinate information is the coordinate (X in the video window upper left corner, Y), first size information is video window width high (W, H), second dimension information is that advertisement windows presents wide high (w, h) and relative position information be the advertisement windows central point distance (dw, dh) from the video window left side and top, wherein, w=1/4W, h=1/4H, utilize data above calculate the advertisement windows upper left corner coordinate (x, y):
X=X+ (dw w/2)=X+ (dw 1/8W);
Y=Y+ (dh h/2)=Y+ (dh 1/8H);
Wherein, X, Y are the first size information got in video window drawing process; Dw, dh throw in that set and between video window relative position information from advertisement windows, so, can accurately calculate the second dimension information and the second coordinate information. So, by the advertisement windows top left corner apex coordinate that calculates (x, y) and advertisement windows present wide high for (w h), can draw described advertisement on video window accurately.
Additionally, when the first coordinate information of video window and/or first size information change, the position of advertisement windows and/or size correspondence regulate, such as, when the first coordinate information of video window changes, i.e. (X, when Y) changing, x and y of correspondence still can be calculated according to x=X+ (dw 1/8W), y=Y+ (dh 1/8H), obtain the second coordinate information, so, the advertisement that size correspondence video window changes can be drawn described advertisement on video window.
In a preferred embodiment, as it is shown in figure 5, on the basis of the embodiment of above-mentioned Fig. 1, the method for this advertisement putting also included before above-mentioned steps S1:
Step S0, when described display device connects network, is downloaded to this locality by the input effect information of described advertisement, the attribute information of advertisement and ad content and preserves.
In the present embodiment, after display device starts and when connecting network, in advance the input effect information of advertisement, the attribute information of advertisement and ad content are downloaded to this locality and preserve, after download completes, even if display device can also play advertisement without network when playing video, make the broadcasting of advertisement not by the restriction of network.
The present invention also provides for a kind of display device, and as shown in Figure 6, in one embodiment, display device includes:
Acquisition module 101, for when starting Video Applications, obtaining the first coordinate information and the first size information of the video window of described Video Applications;
In the present embodiment, display device can be television set, panel computer or mobile phone etc., and this display device is the equipment of Android operation system.
In the present embodiment, Video Applications can be third-party Video Applications or non-third-party Video Applications, and it can play local video, Online Video and video web page etc., for instance can be MPC, PPTV or excellent cruel video etc.
In the present embodiment, the first coordinate information of the video window of Video Applications is preferably video window top left co-ordinate information, and first size information refers to width and the elevation information of video window.
In the present embodiment, being drawn by layout configuration file when drawing the view of video window, carry out the width of view, high measurement by the attribute of definition in layout configuration file, the present embodiment also can obtain the first coordinate information by layout configuration file.
In the present embodiment, drawn by layout configuration file when drawing the view of video window, the width of view, high measurement is carried out by the attribute of definition in layout configuration file, obtain first size information, with the upper left corner of the screen of display device for zero (0,0), calculated from Edge Distance and the first size information of display window by video window and obtain the video window upper left corner from initial point (0,0) distance, thus obtaining video window the first coordinate information. Then it is laid out operation further according to layout configuration file attribute information, the first coordinate, first size information etc.
Computing module 102, for obtaining the input effect information of advertisement, obtain the second dimension information according to described input effect information, and calculate the second coordinate information of the advertisement windows thrown in described video window according to described first coordinate information, first size information and described input effect information;
In the present embodiment, advertisement operators, in order to reach the display effect of certain advertisement, plays the ad-hoc location that advertisement can be thrown in the process of video video window according to certain scale in Video Applications. In the present embodiment, the input effect information of advertisement includes advertisement windows and accounts for the scale of video window and the relative position information of advertisement windows and video window, wherein, described relative position information can be the relative position between limit and the limit of two windows, or can be the center distance etc. to the both sides of video window of advertisement windows.
In the present embodiment, the second coordinate information is preferably advertisement windows top left co-ordinate information, and the second dimension information refers to throw in width and the elevation information of the advertisement windows set in effect. The present embodiment can calculate the second dimension information according to throwing in effect information with first size information; If it addition, have learned that the relative position information of the scale shared by the first coordinate information of video window and first size information, advertisement windows and advertisement windows and video window, then can directly calculate the second coordinate information.
Drafting module 103, for obtaining attribute information and the ad content of advertisement, draws described ad content to the screen of described display device according to described second coordinate information, the second dimension information, attribute information.
In the present embodiment, the attribute information of advertisement includes the information such as transparency and the rank of advertisement windows. Even have learned that the second coordinate information and second dimension information of advertisement windows, then display device can create an advertisement windows according to the second coordinate information and the second dimension information, then according to the attribute information of described advertisement, ad content is drawn to advertisement windows again, realize advertisement input in any video window, and the position that advertisement is thrown in Video Applications is also arbitrary, such as the position etc. of the position in the lower left corner or the upper right corner, make broadcasting or the display effect variation of advertisement.
In the present embodiment, the broadcast mechanism of android system can be utilized: write inside broadcast additional data by the second coordinate information and the second dimension information, broadcast announcement is sent to whole system with broadcast event, when listening to broadcast and sending, the second coordinate information and second dimension information of advertisement windows in broadcast data can be extracted. Utilize the second coordinate information and the second dimension information, it is possible to advertisement is drawn in specific position on the screen of a display device. Wherein, first the attribute information of advertisement, the second dimension information and the second coordinate information are passed to Android window management service. Then the service of Android window management starts, according to these attribute informations, the second dimension information and the second coordinate information, draw out the advertisement of appropriate level and play.
Detection module 104, for whether the first coordinate information and/or first size information detecting described video window changes; Loop module 105, for when detection module 104 detects above-mentioned change, then reacquires the first coordinate information of video window and first size information and circulates.
In the present embodiment, when carrying out the operations such as the rolling of full frame/non-full frame switching or the page as user, first coordinate information and/or the first size information of video window there occurs change, now need to reacquire position and the size of video window, namely the first coordinate information and first size information are obtained, then recalculate the second dimension information and the second coordinate information, render to position and the size of advertisement windows on video window with correspondence adjustment.
In the present embodiment, Video Applications just have registered monitoring when instantiation, when the rolling listening to full frame/non-full frame switching or the page causes its position and/or change in size, reacquire the first coordinate information and the first size information of video window, then the second coordinate information and/or second dimension information of advertisement windows are calculated, and repainting advertisement, it is achieved that advertisement can make the real-time input of respective change for video window position and/or size variation. Such as video window is rolled into bottom by top, and advertisement is also as the rolling of video window and rolls; Video window from full frame to non-full frame switching time, the size and location of advertisement also change therewith, such as, video window is by full frame change half screen, its width or height reduce by half, the size of advertisement windows is the half of video window size, namely the size of advertisement windows become that original video window is wide or high by the half that original video window is wide or high 1/4.
In a preferred embodiment, as it is shown in fig. 7, on the basis of the embodiment of above-mentioned Fig. 6, acquisition module 101 includes:
Extraction unit 1011, for when starting Video Applications, extracting the layout configuration file of the video window of described Video Applications;
First acquiring unit 1012, for obtaining described first coordinate information and first size information according to described layout configuration file.
In the present embodiment, the window of android system is drawn and is included: when user is by clicking the application icon at main interface or operating by remote control applications hot key etc., Video Applications on display device starts, start the flow process performing to draw the video window of Video Applications, when completing, the video window of Video Applications just can be presented on user at the moment.
Wherein, in window is drawn, father's view includes multiple many sub-views, and the content of sub-view can be word, it is also possible to be picture, and the video window of the present embodiment is the sub-view of one of them.
When drawing father's view and sub-view, first carry out wide and high measurement according to the attribute of definition in the layout configuration file specifying to both, check whether a certain sub-view fills completely full frame as by layout configuration file width, height, or be configured to width, the height fixed, or by content actual disposition width, height. Then according to these configurations, measurement is performed. What first measure is father's view, measures the width of each sub-view, height more successively, get first size information with this after completing. In time completing to measure operation, display device proceeds by layout operation.
In the present embodiment, in conjunction with consulting Fig. 3, with the coordinate in the upper left corner of father's view (being equivalent to the desktop of above-mentioned display screen) for zero (0,0), according to layout configuration file, obtain sub-view (being equivalent to above-mentioned video window) from the back gauge of father's view distance and above-mentioned measured by obtain width, height, finally calculate each the sub-view top left co-ordinate relative to father's view, i.e. the first coordinate information, the coordinate calculating the upper left corner obtaining video window as shown in Figure 3 is (X, Y).
In a preferred embodiment, as shown in Figure 8, on the basis of the embodiment of above-mentioned Fig. 6, computing module 102 includes:
Second acquisition unit 1021, account for the scale of described video window for obtaining described advertisement windows relative to the relative position information of described video window and described advertisement windows, and calculate described second dimension information according to described first size information and described scale;
Computing unit 1022, the scale for accounting for described video window according to described first coordinate information, first size information, described relative position information and described advertisement windows calculates described second coordinate information.
In the present embodiment, the input effect information of advertisement includes advertisement windows and accounts for the scale of video window relative to the relative position information of described video window and described advertisement windows.
As shown in Figure 3, the scale of video window is accounted for for 1/16 for advertisement windows, zero is (0,0), first coordinate information is the coordinate (X in the video window upper left corner, Y), first size information is video window width high (W, H), second dimension information is that advertisement windows presents wide high (w, h) and relative position information be the advertisement windows central point distance (dw, dh) from the video window left side and top, wherein, w=1/4W, h=1/4H, utilize data above calculate the advertisement windows upper left corner coordinate (x, y):
X=X+ (dw w/2)=X+ (dw 1/8W);
Y=Y+ (dh h/2)=Y+ (dh 1/8H);
Wherein, X, Y are the first size information got in video window drawing process; Dw, dh throw in that set and between video window relative position information from advertisement windows, so, can accurately calculate the second dimension information and the second coordinate information. So, by the advertisement windows top left corner apex coordinate that calculates (x, y) and advertisement windows present wide high for (w h), can draw described advertisement on video window accurately.
Additionally, when the first coordinate information of video window and/or first size information change, the position of advertisement windows and/or size correspondence regulate, such as, when the first coordinate information of video window changes, i.e. (X, when Y) changing, x and y of correspondence still can be calculated according to x=X+ (dw 1/8W), y=Y+ (dh 1/8H), obtain the second coordinate information, so, the advertisement that size correspondence video window changes can be drawn described advertisement on video window.
In a preferred embodiment, on the basis of the embodiment of above-mentioned Fig. 6, display device also includes: download module, for when described display device connects network, the input effect information of described advertisement, the attribute information of advertisement and ad content being downloaded to this locality and preserved.
In the present embodiment, after display device starts and when connecting network, in advance the input effect information of advertisement, the attribute information of advertisement and ad content are downloaded to this locality and preserve, after download completes, even if display device can also play advertisement without network when playing video, make the broadcasting of advertisement not by the restriction of network.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every equivalent structure utilizing description of the present invention and accompanying drawing content to make or equivalence flow process conversion; or directly or indirectly it is used in other relevant technical fields, all in like manner include in the scope of patent protection of the present invention.