Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide present banner background colours in a kind of live streaming
Configuration method and a kind of live streaming in present banner background colour configuration system, efficiently accomplish present banner background colour setting.
To achieve the above objectives, the technical solution adopted by the present invention is that, comprising:
S1: when live streaming mobile client end subscriber initiates present Comp Requests, background server is sent out to live streaming mobile client
A present banner is sent to configure message, the present banner configuration message includes the scheme of colour of present banner background colour;
S2: based on the scheme of colour in present banner configuration message, color lump picture identical with scheme color is obtained;
S3: defining a set method function, the color lump picture for using set method function will acquire 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.
Based on the above technical solution, the type of the present banner configuration message is the iOS system data of encapsulation
Storage model.
It based on the above technical solution, include one for judging that user live broadcast is seen in the present banner configuration message
See the field at interface, 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 vertical screen direct broadcasting room.
Based on the above technical solution, the S3 specifically:
S301: a set method function is defined, the set method function is for being arranged present banner;
S302: according to the field for judging user live broadcast viewing interface, judging the current live viewing interface of user,
And interface is watched in the live streaming based on user, selects corresponding present banner template;
S303: background of the color lump picture that will acquire as present banner template completes the setting of present banner background colour.
Based on the above technical solution, the intelligent sliding of mobile client is broadcast live from network or operation for the color lump picture
Dynamic equipment locally obtains.
Based on the above technical solution, the network url containing a color lump picture in the present banner configuration message,
And the color of the color lump picture is identical as the color of scheme of colour.
Based on the above technical solution, when obtaining failure from network when color lump picture, then from Intelligent mobile equipment
Locally obtained.
The present invention also provides a kind of configuration systems of present banner background colour in live streaming, comprising:
Receiving module is used to receive the present banner configuration message that background server is sent to live streaming mobile client,
The present banner configuration message includes the scheme of colour of present banner background colour, and the corresponding present banner back of different presents
The scheme of colour of scenery is different;
Resource loading module is used to obtain color lump picture identical with scheme color;
Execution module is used to define a set method function, and is made using the color lump picture that set method function will acquire
For present banner background, the setting of present banner background colour is completed.
Based on the above technical solution, the intelligent sliding of mobile client is broadcast live from network or operation for the color lump picture
Dynamic equipment locally obtains.
Based on the above technical solution, when obtaining failure from network when color lump picture, then from Intelligent mobile equipment
Locally obtained.
Compared with prior art, it is the advantages of the configuration method of present banner background colour in a kind of live streaming of the present invention: when
When needing to carry out present displaying, then according to different presents, background server sends the configuration of present banner to live streaming mobile client
Message, and present banner configuration message includes the scheme of colour of present banner background colour, and the corresponding present of different presents is horizontal
Width background colour is different, to increase display difference when different presents are shown, improves the differentiation of user and main broadcaster for present
Degree;Unstable network environment when using for Intelligent mobile equipment, color lump picture relevant to present banner background colour can
It is locally loaded from Intelligent mobile equipment, can also be obtained from network, using fault-tolerant processing mode, meet different uses
Scene.
The advantages of configuration system of present banner background colour is in a kind of live streaming of the present invention: receiving module receives backstage and takes
Business device is sent to the present banner configuration message of live streaming mobile client, and resource loading module configures in message according to present banner
Scheme of colour loads corresponding color lump picture, is configured thereby executing module to present banner background colour, meets different gifts
The present banner of object is shown, promotes the identification that present is shown.
Specific embodiment
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Shown in Figure 1, the embodiment of the present invention provides a kind of configuration method of present banner background colour in live streaming, for straight
Broadcast the display of present banner background colour in mobile client, in the embodiment of the present invention, live streaming mobile client runs on iOS system
Intelligent mobile equipment in, Intelligent mobile equipment be mobile phone or plate.Present banner is carried on the back in a kind of live streaming of the embodiment of the present invention
The configuration method of scenery specifically includes:
S1: when live streaming mobile client end subscriber initiates present Comp Requests, background server is sent out to live streaming mobile client
A present banner is sent to configure message, present banner configuration message includes the scheme of colour of present banner background colour, to improve master
The discrimination with user for displaying present is broadcast, the present banner background colour of different presents is different, therefore the present of different presents
The scheme of colour of banner background colour is different.For the exploitation demand for meeting iOS system language, it is sent to the gift of live streaming mobile client
The type of object banner configuration message is the iOS system Data Storage Models of encapsulation, and model is one of iOS system development language
Stored Data Type, therefore the iOS system Data Storage Models of encapsulation can be denoted as DYGiftPanelModel.Present banner
Numerous fields relevant to present such as scheme of colour containing present banner background colour in message are configured, such as present animated show
Deng.
S2: based on the scheme of colour in present banner configuration message, obtaining color lump picture identical with scheme color,
Color lump picture is a kind of pure color picture of only color.Color lump picture passes through function [UIImageimageNamed: " picture name
Claim "] it is obtained, which is the method that picture is commonly obtained in Objective-C language.
S3: defining a set method function, the color lump picture for using set method function will acquire 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 method is programming
Common packaging method in language.Meanwhile according to the actual live streaming mobile client of user using viewing scene, present banner is matched
Setting includes one in message for judging the field at user live broadcast viewing interface, and user live broadcast viewing interface includes that half screen direct broadcasting room is seen
See interface, full transverse screen direct broadcasting room viewing interface and full vertical screen direct broadcasting room viewing interface.Specifically:
S301: defining a set method function, and set method function is-(void) setBackgroundLevel:(int)
BackgroundLevel, the set method function are used to that present banner to be arranged, wherein backgroundLevel pairs of parameter (int)
User live broadcast is answered to watch interface.
S302: according to the field for judging user live broadcast viewing interface, judging the current live viewing interface of user,
And interface is watched in the live streaming based on user, selects corresponding present banner template, same present watches interface in different live streamings
Under, present banner template is different.
The value for setting the half screen direct broadcasting room viewing corresponding field backgroundLevel in interface is 1, full transverse screen direct broadcasting room sight
The value for seeing the corresponding field backgroundLevel in interface is that 0, Quan Shuping direct broadcasting room watches the corresponding field in interface
The value of backgroundLevel is 1.For example, then being set when the viewing interface of user is that half screen direct broadcasting room watches interface
(int) backgroundLevel=1 in backgroundLevel.
S303: background of the color lump picture that will acquire as present banner template completes the setting of present banner background colour.
Present banner background colour, case statement switch are set using the case statement in set method function
(backgroundLevel).The sentence of setting present banner background colour imgGiftBackground is in present banner template
ImgGiftBackground.image=[UIImageimageNamed: " picture name "], that is, the color lump picture that will acquire is made
For the background colour of present banner.
Meanwhile according to the actual use situation of live streaming mobile client, color lump picture is mobile objective from network or operation live streaming
The Intelligent mobile equipment at family end locally obtains, and using fault-tolerant processing mode, examines no net or the bad situation of Network status
Consider, when color lump picture obtains failure from network, is then locally obtained from Intelligent mobile equipment.Therefore present banner configuration
Network url in message containing a picture passes through url (Uniform Resource Locator, the 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 is identical as the color of scheme of colour.
The case where being obtained from network for color lump picture:
1) a set method function-(void) setGiftBackground:(NSString* is defined)
GiftBackground is used to that present banner is arranged, and wherein parameter (NSString*) giftBackground is NSString word
The incoming parameter of string type is accorded with, parameter (NSString*) giftBackground is used to be passed to the url of color lump picture here;
2) it according to the characteristic of iOS system language, needs using sentence _ giftBackground=giftBackground;
The background color value of present banner is saved, giftBackground is the variable save background color value currently defined,
GiftBackground is the incoming parameter of set method.
3) the current live viewing interface of user is judged, while uses the sentence NSURL of Objective-C language
The url of picture is passed in present banner template by url=[NSURL URLWithString:giftBackground],
In, URLWithString: being a class method, and class method needs to call using NSURL class, and giftBackground is step
It is rapid 1) in the incoming parameter of set method.
4) one is constructed using function statement UIImage*image=[UIImageimageNamed:@" low_gift "]
Object picture, this picture is color lump picture identical with scheme of colour in the Intelligent mobile equipment local of load, when network is different
Chang Shi then uses the picture, and in the function statement, imageNamed: being the side that loading function is removed according to a picture address
Method ,@" low_gift " it is incoming be picture address title.
5) using function [imgGiftBackgroundsd_setImageWithURL:urlplaceholderImage:
image];Sd_setImageWithURL carries out the acquisition of color lump picture on network.
Certainly, it when color lump picture load failure in network, in the color lump picture using Intelligent mobile equipment local, carries out
Flexible choice meets the use demand under various network scenarios.
The configuration method of present banner background colour in the live streaming of one of embodiment of the present invention, when needing to carry out present displaying
When, then according to different presents, background server sends present banner to live streaming mobile client and configures message, and present banner is matched
The scheme of colour that message includes present banner background colour is set, and the corresponding present banner background colour of different presents is different, thus
Display difference when different presents are shown is increased, improves user and main broadcaster for the discrimination of present;Intelligent mobile is set
Unstable network environment when standby use, color lump picture relevant to present banner background colour can be from Intelligent mobile equipment locals
Load, can also be obtained from network, using fault-tolerant processing mode, meet different usage scenarios.
The embodiment of the present invention also provides a kind of based in above-mentioned live streaming in the live streaming of the configuration method of present banner background colour
The configuration system of present banner background colour, including receiving module, resource loading module and execution module.
Receiving module is used to receive the present banner configuration message that background server is sent to live streaming mobile client, described
Present banner configuration message includes 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 loading module is for obtaining color lump picture identical with scheme color;Execution module is used for
The color lump picture for defining a set method function, and set method function being used to will acquire completes present as present banner background
The setting of banner background colour.Wherein, color lump picture is locally obtained from the Intelligent mobile equipment of network or operation live streaming mobile client
It takes.When color lump picture obtains failure from network, then locally obtained from Intelligent mobile equipment.
The configuration system of present banner background colour in live streaming in the embodiment of the present invention: receiving module receives background server
It is sent to the present banner configuration message of live streaming mobile client, resource loading module is configured in message according to present banner and matched colors
Scheme loads corresponding color lump picture, is configured thereby executing module to present banner background colour, meets different presents
Present banner is shown, promotes the identification that present is shown.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
Under the premise of the principle of the invention, several 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 being not described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.