The content of the invention
For defect present in prior art, it is an object of the invention to provide the live middle present banner background colour of one kind
Collocation method and a kind of configuration system of live middle present banner background colour, efficiently accomplish present banner background colour set.
To achieve the above objectives, the present invention adopts the technical scheme that, including:
S1:When live mobile client end subscriber initiates present Comp Requests, background server is sent out to live mobile client
A present banner is sent to configure message, the present banner configuration message is contained within the scheme of colour of present banner background colour;
S2:Based on the scheme of colour in present banner configuration message, obtain and scheme color identical color lump picture;
S3:Define a set method functions, using set method functions will obtain color lump picture as present banner background,
The setting of present banner background colour is completed, and the corresponding present banner background colour of different presents is different.
On the basis of above-mentioned technical proposal, the present banner configuration message is the iOS system data storage mould of encapsulation
Type.
On the basis of above-mentioned technical proposal, the present banner configuration message includes that one sees for judging user live broadcast
The field at interface is seen, the user live broadcast viewing interface includes half screen direct broadcasting room viewing interface, full transverse screen direct broadcasting room viewing interface
Interface is watched with full portrait layout direct broadcasting room.
On the basis of above-mentioned technical proposal, the S3 is specially:
S301:A set method functions are defined, the set method functions are used to set present banner;
S302:According to the field for judging user live broadcast viewing interface, the current live viewing interface to user judges,
And the live viewing interface based on user, selection correspondence present banner template;
S303:The color lump picture that will be obtained completes the setting of present banner background colour as the background of present banner template.
On the basis of above-mentioned technical proposal, the color lump picture is from network or runs the intelligent sliding of live mobile client
Dynamic equipment is locally obtained.
On the basis of above-mentioned technical proposal, the network url containing a color lump picture in the present banner configuration message,
And the color of the color lump picture is identical with the color of scheme of colour.
On the basis of above-mentioned technical proposal, when color lump picture obtains failure from network, then from Intelligent mobile equipment
Locally obtained.
The present invention also provides a kind of configuration system of live middle present banner background colour, including:
Receiver module, it is used to receive the present banner configuration message that background server is sent to live mobile client,
The present banner configuration message is contained within the scheme of colour of present banner background colour, and the corresponding present banner back of the body of different presents
The scheme of colour of scenery is different;
Resource load-on module, it is used to obtain and scheme color identical color lump picture;
Performing module, it is used to define a set method functions, and is made using the color lump picture that set method functions will be obtained
It is present banner background, completes the setting of present banner background colour.
On the basis of above-mentioned technical proposal, the color lump picture is from network or runs the intelligent sliding of live mobile client
Dynamic equipment is locally obtained.
On the basis of above-mentioned technical proposal, when color lump picture obtains failure from network, then from Intelligent mobile equipment
Locally obtained.
Compared with prior art, a kind of advantage of the collocation method of live middle present banner background colour of the present invention is:When
When needing to carry out present displaying, then according to different presents, background server sends present banner and configures to live mobile client
Message, and present banner configuration message is contained within the scheme of colour of present banner background colour, and the corresponding present of different presents is horizontal
Width background colour is different, so as to increase display difference when different presents show, improves the differentiation of user and main broadcaster for present
Degree;Unstable network environment when being used for Intelligent mobile equipment, the color lump picture related to present banner background colour can
Locally loaded from Intelligent mobile equipment, it is also possible to obtained from network, using fault-tolerant processing mode, meet different uses
Scene.
A kind of advantage of the configuration system of live middle present banner background colour of the present invention is:Receiver module receives backstage clothes
Business device is sent to the present banner configuration message of live mobile client, and resource load-on module is configured in message according to present banner
Scheme of colour, loads corresponding color lump picture, so that performing module is configured to present banner background colour, meets different gifts
The present banner displaying of thing, the identification of lifting present displaying.
Specific embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
Shown in Figure 1, the embodiment of the present invention provides a kind of collocation method of live middle present banner background colour, for straight
The display of present banner background colour in mobile client is broadcast, in the embodiment of the present invention, live mobile client runs on iOS system
Intelligent mobile equipment in, Intelligent mobile equipment be mobile phone or flat board.A kind of live middle present banner back of the body of the embodiment of the present invention
The collocation method of scenery is specifically included:
S1:When live mobile client end subscriber initiates present Comp Requests, background server is sent out to live mobile client
A present banner is sent to configure message, present banner configuration message is contained within the scheme of colour of present banner background colour, is led to improve
Broadcast the present of the discrimination for displaying present with user, the present banner background colour difference of different presents, therefore different presents
The scheme of colour of banner background colour is different.To meet the exploitation demand of iOS system language, the gift of live mobile client is sent to
Thing banner configuration message is the iOS system Data Storage Models of encapsulation, and model is that a kind of data in iOS system development language are deposited
Storage type, therefore the iOS system Data Storage Models of encapsulation can be designated as DYGiftPanelModel.The configuration of present banner disappears
Numerous fields related to present, such as present animated show such as the scheme of colour containing present banner background colour in breath.
S2:Based on the scheme of colour in present banner configuration message, obtain and scheme color identical color lump picture,
Color lump picture is only a kind of pure color picture of color.Color lump picture passes through function [UIImageimageNamed:" picture name
Claim "] obtained, the function is the method for the acquisition picture commonly used in Objective-C language.
S3:Define a set method functions, using set method functions will obtain color lump picture as present banner background,
The setting of present banner background colour is completed, and the corresponding present banner background colour of different presents is different.Set methods are programmings
The method for packing commonly used in language.Meanwhile, according to the actual live mobile client of user using viewing scene, present banner is matched somebody with somebody
Putting message includes that one watches the field at interface for judging user live broadcast, and user live broadcast is watched interface and seen including half screen direct broadcasting room
See interface, full transverse screen direct broadcasting room viewing interface and full portrait layout direct broadcasting room viewing interface.Specially:
S301:A set method functions are defined, set method functions are-(void) setBackgroundLevel:(int)
BackgroundLevel, the set method functions are used to set present banner, wherein parameter (int) backgroundLevel pairs
User live broadcast is answered to watch interface.
S302:According to the field for judging user live broadcast viewing interface, the current live viewing interface to user judges,
And the live viewing interface based on user, selection correspondence present banner template, same present, at different live viewing interfaces
Under, present banner template is different.
The value for setting the corresponding field backgroundLevel in half screen direct broadcasting room viewing interface is 1, and full transverse screen direct broadcasting room is seen
See that the value of the corresponding field backgroundLevel in interface is 0, full portrait layout direct broadcasting room watches the corresponding field in interface
The value of backgroundLevel is 1.For example, when interface is watched in the viewing interface of user for half screen direct broadcasting room, then setting
(int) backgroundLevel=1 in backgroundLevel.
S303:The color lump picture that will be obtained completes the setting of present banner background colour as the background of present banner template.
Present banner background colour is set using the case statement in set method functions, case statement is switch
(backgroundLevel).The sentence of setting present banner background colour imgGiftBackground is in present banner template
ImgGiftBackground.image=[UIImageimageNamed:" picture name "], the color lump picture that will be obtained is made
It is the background colour of present banner.
Meanwhile, according to the actually used situation of live mobile client, color lump picture is from network or runs live mobile visitor
The Intelligent mobile equipment at family end is locally obtained, using fault-tolerant processing mode, to being examined without net or the bad situation of network condition
Consider, when color lump picture obtains failure from network, then locally obtained from Intelligent mobile equipment.Therefore present banner configuration
Network url containing a picture in message, by url (the Uniform Resource Locator, unified resource positioning of picture
Symbol), the acquisition of color lump picture is carried out from network, and the color of the color lump picture and the color of scheme of colour are identical.
When color lump picture is obtained from network:
1) set method functions-(void) setGiftBackground is defined:(NSString*)
GiftBackground is used for setting present banner, and wherein parameter (NSString*) giftBackground is NSString words
The incoming parameter of string type is accorded with, parameter (NSString*) giftBackground is used for the url of incoming color lump picture here;
2) characteristic according to iOS system language is, it is necessary to use sentence _ giftBackground=giftBackground;
The background colour of present banner is preserved, giftBackground is the variable save background colour of current definition,
GiftBackground is the incoming parameter of set methods.
3) current live of user viewing interface is judged, while using the sentence NSURL of Objective-C language
Url=[NSURL URLWithString:GiftBackground] url of picture is passed in present banner template, its
In, URLWithString:It is a class method, class method needs to use NSURL classes to call, giftBackground is step
It is rapid 1) in the incoming parameter of set methods.
4) function statement UIImage*image=[UIImageimageNamed are used:@" low_gift "] build one
Object picture, this picture be loading Intelligent mobile equipment it is local in scheme of colour identical color lump picture, when network is different
Chang Shi, then using the picture, in the function statement, imageNamed:It is the side that loading function is removed according to a picture address
Method ,@" low_gift " it is incoming be picture address title.
5) function [imgGiftBackgroundsd_setImageWithURL is used:urlplaceholderImage:
image];Sd_setImageWithURL carries out the acquisition of color lump picture on network.
Certainly, when color lump picture loading failure in network, using the local color lump picture of Intelligent mobile equipment, carry out
Flexibly selection, meets the use demand under various network scenarios.
The collocation method of a kind of live middle present banner background colour in the embodiment of the present invention, when needing to carry out present displaying
When, then according to different presents, background server sends present banner configuration message to live mobile client, and present banner is matched somebody with somebody
The scheme of colour that message is contained within present banner background colour is put, and the corresponding present banner background colour of different presents is different, so that
Display difference when different presents show is increased, the discrimination of user and main broadcaster for present is improved;Set for intelligent mobile
For network environment unstable when using, the color lump picture related to present banner background colour can be local from Intelligent mobile equipment
Loading, it is also possible to obtained from network, using fault-tolerant processing mode, meet different usage scenarios.
The embodiment of the present invention also provide a kind of collocation method based on above-mentioned live middle present banner background colour it is live in
The configuration system of present banner background colour, including receiver module, resource load-on module and performing module.
Receiver module is used to receive the present banner configuration message that background server is sent to live mobile client, described
Present banner configuration message is contained within the scheme of colour of present banner background colour, and the corresponding present banner background colour of different presents
Scheme of colour it is different;Resource load-on module is used to obtain and scheme color identical color lump picture;Performing module is used for
A set method functions are defined, and uses the color lump picture that set method functions will be obtained as present banner background, complete present
The setting of banner background colour.Wherein, color lump picture is locally obtained from the Intelligent mobile equipment of network or the live mobile client of operation
Take.When color lump picture obtains failure from network, then locally obtained from Intelligent mobile equipment.
The configuration system of the live middle present banner background colour in the embodiment of the present invention:Receiver module receives background server
The present banner configuration message of live mobile client is sent to, resource load-on module is matched colors in configuring message according to present banner
Scheme, loads corresponding color lump picture, so that performing module is configured to present banner background colour, meets different presents
The displaying of present banner, the identification of lifting present displaying.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as protection of the invention
Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.