Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of sides for promoting live streaming viewing experienceMethod can effectively promote user to the viewing experience of live streaming.
To achieve the above objectives, it the technical solution adopted by the present invention is that, including S1: creates and uses in mobile live streaming clientIn the container contentView for loading UI element, the container contentView succession is in the base class UIView of interface class;
S2: the live streaming image player of the direct broadcasting room page is added to the bottom of mobile live streaming client-side controller, directlyThe functional display UI element for broadcasting a page is added on live streaming image player, and functionality display UI element is loaded intoIn container contentView, the direct broadcasting room page is made of live streaming picture and functional display UI element;
S3: the pan gesture of positive sliding or reverse slide in one direction is created, and the pan gesture of creation is added toOn the view of mobile live streaming client-side controller;
S4: user is located at direct broadcasting room, and when user is in the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operationWhen carrying out the slide in a direction on curtain, judgement is positive sliding or reverse slide, slides if forward direction, then goes to S5,If reverse slide, then S6 is gone to;
S5: judge whether functional property shows UI element on the page between current live, if so, hiding containerContentView, if it is not, being then not processed;
S6: judge whether functional property shows UI element on the page between current live, if so, not dealing with, if it is not, thenShow container contentView.
Based on the above technical solution, the functional display UI element is room number, main broadcaster's head portrait, current roomUser list, concern button, one or more of barrage and present banner.
Based on the above technical solution,
When container contentView is display state, the functional display UI element in container contentView is straightIt broadcasts and is shown on a page;
When container contentView is hidden state, the functional display UI element in container contentView is straightIt broadcasts and is hidden on a page.
Based on the above technical solution,
The positive sliding on the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operation from left to rightSliding;
On touch screen of the reverse slide to move the Intelligent mobile equipment of live streaming client in operation from right to leftSliding.
Based on the above technical solution, for the pan gesture of creation, call memory allocation function for pan gesture pointIt is set as controller with memory, and by the listener of pan gesture, monitored by controller and judges that user carries out positive sliding stillReverse slide.
The present invention also provides a kind of storage medium, computer program, the computer program are stored on the storage mediumMethod described above is realized when being executed by processor.
The present invention also provides a kind of electronic equipment, including memory and processor, stored on a processor on memoryThe computer program of operation, the processor realize method described above when executing the computer program.
The present invention also provides a kind of systems for promoting live streaming viewing experience, comprising:
Creation module is used to create the container contentView for loading UI element in mobile live streaming client,And the pan gesture of positive sliding or reverse slide in one direction is created, and the pan gesture of creation is added to mobile live streamingOn the view of client-side controller, the container is inherited in the base class UIView of interface class;
Judgment module is used to be located at direct broadcasting room as user, and when user is in the intelligent sliding of the mobile live streaming client of operationWhen carrying out the slide in a direction on the touch screen of dynamic equipment, judgement is positive sliding or reverse slide;
Execution module is used to for the live streaming image player of the direct broadcasting room page being added to mobile live streaming client-side controllerThe bottom, the functional display UI element of the direct broadcasting room page is added on live streaming image player, and functionality is shownUI element is loaded into container contentView, and, when user is positive sliding, judge be on the page between current liveNo functional property shows UI element, if so, container contentView is hidden, if it is not, being then not processed, when user is reversedWhen sliding, judge whether functional property shows UI element on the page between current live, if so, not dealing with, if it is not, then showingContainer contentView, the direct broadcasting room page are made of live streaming picture and functional display UI element.
Based on the above technical solution, the functional display UI element is room number, main broadcaster's head portrait, current roomUser list, concern button, one or more of barrage and present banner.
Based on the above technical solution,
When container contentView is display state, the functional display UI element in container contentView is straightIt broadcasts and is shown on a page;
When container contentView is hidden state, the functional display UI element in container contentView is straightIt broadcasts and is hidden on a page.
Compared with the prior art, the advantages of the present invention are as follows: creation loads the container contentView of UI element, will removeOther UI elements outside live streaming picture are all loaded into container contentView, and define corresponding gesture to control containerThe hiding and display of contentView, that is, control other UI elements in addition to picture is broadcast live hides and is displayed for user's choosingIt selects, when user's forward direction slides screen, then hides container contentView, when screen is slided in user direction, then show containerContentView, it is easy to control, it hides convenient for the convenient selection of user except other UI elements in addition to picture is broadcast live, reduces to straightThe influence of picture viewing is broadcast, promotes user to the usage experience of mobile live streaming client.
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 method for promoting live streaming viewing experience, suitable for running onMobile live streaming client in iOS system, specifically includes:
S1: the container contentView for loading UI element, container are created in mobile live streaming clientContentView, which is inherited, indicates one piece of region on screen in the base class UIView, UIView of interface class, and UIView is mainly used forManage and control the display content in the region.By creation container contentView come to the corresponding UI on the direct broadcasting room pageElement is loaded.
S2: the live streaming image player of the direct broadcasting room page is added to the bottom of mobile live streaming client-side controller, directlyThe functional display UI element for broadcasting a page is added on live streaming image player, and functionality display UI element is loaded intoIn container contentView, the direct broadcasting room page is made of live streaming picture and functional display UI element.It is main broadcaster that picture, which is broadcast live,The content of live streaming, functionality display UI element are the UI element that platform is broadcast live and is added on live streaming picture, specifically, functional aobviousShow that UI element is one in room number, main broadcaster's head portrait, the user list of current room, concern button, barrage and present bannerOr multiple, a certain moment, the functional display UI element shown on the direct broadcasting room page is specially one or more, and the present invention is implementedThe all functionalities shown on the page between current live are shown that UI element is loaded into container contentView in example.
It being broadcast live in client mobile, the control for the direct broadcasting room page is generally all controlled by a controller, andOn the direct broadcasting room page, in spite of clear screen operation is executed, live streaming picture must be visible always, therefore live streaming picture is playedDevice is added to the bottom of mobile live streaming client-side controller, and other UI elements of the direct broadcasting room page are placed in live streaming image playerOn.
S3: the pan gesture of positive sliding or reverse slide in one direction is created, and the pan gesture of creation is added toOn the view of mobile live streaming client-side controller, pan gesture refers to sliding action on the touch screen.Specifically, using gestureIt is gesture pan storage allocation that class UIPanGestureRecognizer, which calls memory allocation function alloc, adds gesture listenerFunction initWithTarget is that gesture pan adds a listener, and the listener of pan gesture is set as controller, simultaneouslyIt is oneFingerRightAndLeft that the call back function that this gesture pan is performed, which is arranged, and the method for addition gesture pan isaddGestureRecognizer.View is one piece of drawable space block of user interface components in Intelligent mobile equipment.ThisIn inventive embodiments, Intelligent mobile equipment is smart phone or plate.
Wherein, positive sliding on the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operation from left to rightSliding;Reverse slide is to slide from right to left on the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operation.IntoOne step, finger slides to right side on the left of screen and is determined as positive sliding, and finger slides to left side on the right side of screen and sentencesIt is set to reverse slide, and the starting point slided and end point can not be on sustained heights.
S4: user is located at direct broadcasting room, and when user is in the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operationWhen carrying out the slide in a direction on curtain, judgement is positive sliding or reverse slide, slides if forward direction, then goes to S5,If reverse slide, then S6 is gone to;In the embodiment of the present invention, the listener of pan gesture is controller, therefore is supervised by controllerIt listens and judges that user carries out positive sliding or reverse slide.
S5: judge whether functional property shows UI element on the page between current live, if so, hiding containerContentView, if it is not, being then not processed;It will be triggered when user slides on the touch screen and gesture is called to graspThe call back function oneFingerRightAndLeft of work, call back function oneFingerRightAndLeft have a gesture-typeThe parameter recognizer of UIPanGestureRecognizer, when call back function oneFingerRightAndLeft is calledWhen, it will check whether the slide of active user is finished or is cancelled or fail, currently be carried out as confirmation userFor forward direction sliding, i.e., from left to right, and slide has been finished, and will continue between subsequent judgement current live at this timeWhether functional property shows UI element on the page, if so, container contentView is hidden, if it is not, being then not processed.If holdingDevice contentView itself is just hidden state, then when user carries out positive slide, is then not processed.For triggeringThe gesture of container contentView hidden and shown can be freely set.
When container contentView is display state, the functional display UI element in container contentView is straightIt broadcasts and is shown on a page;Functional display UI when container contentView is hidden state, in container contentViewElement is hidden on the direct broadcasting room page.And the bottom that image player is located at controller is broadcast live, when progress containerWhen the hiding or display of contentView, i.e. clear screen or recovery clear screen operation, live streaming picture is unaffected, and in the present inventionScheme in, container contentView hide or display operation be not related to the removal of UI element or re-create, be only pairContainer contentView is hidden or shows, therefore hides or show process, memory for container contentViewConsumption is smaller, is not related to the addition operation of the removal to corresponding control, reduces CPU and GPU (Graphics ProcessingUnit, graphics processor) load, improve the stability of mobile live streaming client operation.
To improve the interactive experience between mobile live streaming client and user, for the hiding process of container contentView,The process that other all UI elements disappear in addition to picture is broadcast live i.e. on the direct broadcasting room page, increases by an animation process, specifically, usingThe base class UIView class of screen interface calls the class method animateWithDuration an of animation, continuing for animation is arrangedTime, the duration of animation are generally set to 0.1 second, after being provided with, for executing container after clear screen has operatedThe position of contentView, the x value of the coordinate of container contentView are exactly the width of screen, container contentView'sY value, width w value, the height y value of coordinate remain unchanged, and translation motion are then increased by an animation, to be very natural to userThe feeling slided to the right.
S6: judge whether functional property shows UI element on the page between current live, if so, not dealing with, if it is not, thenShow container contentView.Correspondingly, will be triggered when user slides on the touch screen and call gesture operationCall back function oneFingerRightAndLeft will when call back function oneFingerRightAndLeft is calledIt checks whether the slide of active user is finished or is cancelled or fail, currently carries out being reversed sliding as confirmation userDynamic, i.e., from right to left, and slide has been finished, will continue at this time be on the page between subsequent judgement current liveNo functional property shows UI element, if so, not dealing with, if it is not, then showing container contentView.If containerContentView itself is just hidden state, then when user carries out positive slide, is then not processed.If containerContentView itself is just display state, then when user carries out reversible sliding action, is then not processed.
Likewise, to improve the interactive experience between mobile live streaming client and user, for the aobvious of container contentViewShow process, i.e., it is dynamic to increase by one for the process of other all UI elements in addition to picture is broadcast live removed before display on the direct broadcasting room pagePicture process, specifically, calling the class method an of animation using the base class UIView class of screen interfaceThe duration of animation is arranged in animateWithDuration, and the duration of animation is generally set to 0.1 second, is provided withAfterwards, the position of rear container contentView has been operated for executing clear screen, the x value of the coordinate of container contentView is exactly to shieldThe Far Left of curtain, i.e., 0, y value, width w value, the height y value of the coordinate of container contentView remain unchanged, and only change x'sThen translation motion is increased by an animation, thus the feeling slided to the left being very natural to user by value.
The principle of the method for promotion live streaming viewing experience of the invention is that creation loads the container of UI elementOther UI elements in addition to picture is broadcast live all are loaded into container contentView by contentView, and are defined correspondingGesture come control container contentView hide and display, i.e., other UI elements of the control in addition to picture be broadcast live hide withIt is displayed for user's selection, when user's forward direction slides screen, then container contentView is hidden, slides and shield when user directionWhen curtain, then container contentView is shown, it is easy to control, it hides convenient for the convenient selection of user except other in addition to picture is broadcast liveUI element reduces the influence to live streaming picture viewing, and the hiding or display operation of container contentView is not related to UI memberThe removal of element re-creates, and is only that container contentView is hidden or is shown, therefore for containerContentView's hides or shows process, and memory consumption is smaller, is not related to the addition operation of the removal to corresponding control, subtractsThe load of few CPU and GPU improves the stability of mobile live streaming client operation.
In addition, the method for corresponding above-mentioned promotion live streaming viewing experience, the present invention also provides a kind of storage medium, storage mediumsOn be stored with computer program, when computer program is executed by processor realize the various embodiments described above described in promotion live streaming viewingThe step of method of experience.It should be noted that the storage medium includes USB flash disk, mobile hard disk, ROM (Read-OnlyMemory, read-only memory), RAM (Random Access Memory, random access memory), magnetic or disk etc. it is eachKind can store the medium of program code.
It is shown in Figure 2, the method for corresponding above-mentioned promotion live streaming viewing experience, the present invention also provides a kind of electronic equipment,Including memory and processor, the computer program run on a processor is stored on memory, processor executes computerThe method of the promotion live streaming viewing experience of the various embodiments described above is realized when program.
The present invention also provides what viewing experience was broadcast live in a kind of promotion of method based on above-mentioned promotion live streaming viewing experience to beSystem, including creation module, judgment module and execution module.
Creation module is used to create the container contentView for loading UI element in mobile live streaming client, withAnd the creation pan gesture of positive sliding or reverse slide in one direction, and the pan gesture of creation is added to mobile live streaming visitorOn the view of family side controller, the container is inherited in the base class UIView of interface class;Judgment module is used to be located at directly as userBetween broadcasting, and when user carries out the sliding behaviour in a direction on the touch screen of the Intelligent mobile equipment of the mobile live streaming client of operationWhen making, judgement is positive sliding or reverse slide;Execution module is used to add the live streaming image player of the direct broadcasting room pageTo the bottom of mobile live streaming client-side controller, the functional display UI element of the direct broadcasting room page is added to live streaming picture and playsOn device, and functionality display UI element is loaded into container contentView, and, when user is positive sliding, sentenceWhether functional property shows UI element on the page between disconnected current live, if so, container contentView is hidden, if it is not, then notIt processes, when user is reverse slide, judges whether functional property shows UI element on the page between current live, if so,It does not deal with, if it is not, then showing container contentView, the direct broadcasting room page is by live streaming picture and functional display UI memberElement composition.
Functionality display UI element be room number, main broadcaster's head portrait, current room user list, concern button, barrage andOne or more of present banner.Function when container contentView is display state, in container contentViewProperty display UI element shown on the direct broadcasting room page;When container contentView is hidden state, container contentViewIn functional display UI element hidden on the direct broadcasting room page.
The principle of the system of promotion live streaming viewing experience of the invention is that creation module creation loads the container of UI elementOther UI elements in addition to picture is broadcast live all are loaded into container contentView by contentView, and are defined correspondingGesture come control container contentView hide and display, i.e., other UI elements of the control in addition to picture be broadcast live hide withBe displayed for user's selection, by judgment module, when user's forward direction slides screen, then hide container contentView, when withWhen screen is slided in family direction, then container contentView is shown, it is easy to control, it hides convenient for the convenient selection of user except except live streamingOther UI elements outside picture reduce the influence to live streaming picture viewing, and the hiding or display operation of container contentViewIt is not related to the removal of UI element or re-creates, is only that container contentView is hidden or is shown, memory consumptionIt is smaller, it is not related to the addition operation of the removal to corresponding control, reduces the load of CPU and GPU, improves mobile live streaming client operationStability.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing fromUnder 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 inventionWithin 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.