CN107277564B - A kind of video broadcasting method, device and client - Google Patents

A kind of video broadcasting method, device and client Download PDF

Info

Publication number
CN107277564B
CN107277564B CN201710431523.5A CN201710431523A CN107277564B CN 107277564 B CN107277564 B CN 107277564B CN 201710431523 A CN201710431523 A CN 201710431523A CN 107277564 B CN107277564 B CN 107277564B
Authority
CN
China
Prior art keywords
video
play mode
triggering
broadcast event
variable
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710431523.5A
Other languages
Chinese (zh)
Other versions
CN107277564A (en
Inventor
陈权
林雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710431523.5A priority Critical patent/CN107277564B/en
Publication of CN107277564A publication Critical patent/CN107277564A/en
Application granted granted Critical
Publication of CN107277564B publication Critical patent/CN107277564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/2625Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for delaying content or additional data distribution, e.g. because of an extended sport event
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44213Monitoring of end-user related data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Social Psychology (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention relates to a kind of video broadcasting method, device and clients, including create the first element variable;First element variable is assigned to second element by dynamic creation second element;Broadcast event is registered for the second element, and is broadcast event addition delay triggering function;The triggering function for calling the broadcast event judges video play mode according to triggering result.The present invention is based on the principle similitude that video and audio are supported to play automatically, using judging that whether automatically broadcasting judges whether video plays automatically to audio, can reduce the consuming in deterministic process for system resource.And it according to based on current network and user preference setting, may further determine whether to switch under different play mode.

Description

A kind of video broadcasting method, device and client
Technical field
The present invention relates to field of video broadcasting technology, particularly, are related to a kind of video broadcasting method, device and client End.
Background technology
With the continuous development of mobile Internet, have become common entertainment way using mobile terminal viewing video. And user is when watching video, the play mode of video and video-see custom, the network environment of user of user produce punching It is prominent, user experience is affected to a certain extent, this becomes the project for being worth designer's research.
Invention content
In order to solve the technical problems existing in the prior art, an embodiment of the present invention provides a kind of video broadcasting method, Device, client and computer equipment, technical solution are as follows:
In a first aspect, a kind of video play mode judgment method is provided, the method includes:Create the first element variable; First element variable is assigned to second element by dynamic creation second element;Broadcast event is registered for the second element, And it is broadcast event addition delay triggering function;The triggering function for calling the broadcast event judges according to triggering result Video play mode.
Second aspect, provides a kind of video play mode judgment means, and described device includes following module:First element becomes Creation module is measured, for creating the first element variable;Second element creation module is used for dynamic creation second element, will be described First element variable is assigned to second element;Registration and delay triggering add module, for being played for second element registration Event, and be broadcast event addition delay triggering function;Judgment module, the triggering letter for calling the broadcast event Number judges video play mode according to triggering result.
The third aspect provides a kind of client, including video play mode judgment means above-mentioned.
Fourth aspect, it includes memory to provide a kind of equipment, processor, and is stored on memory and can be in processing The program of operation, the processor realize video play mode judgment method above-mentioned when executing described program.
The advantageous effect that the present invention can reach:The present invention is based on videos to support the principle played automatically similar to audio Property, judging whether video plays automatically using judging whether audio plays automatically, can reduce in deterministic process for being The consuming for resource of uniting.
Description of the drawings
Specific embodiments of the present invention will be described in further detail below in conjunction with the accompanying drawings;
Fig. 1 (a) is method implementation environment schematic diagram provided in an embodiment of the present invention.
Fig. 1 (b), Fig. 1 (c) are video playing interface schematic diagrams provided in an embodiment of the present invention.
Fig. 2 is video play mode judgment method flow diagram provided in an embodiment of the present invention.
Fig. 3 is video play mode judgment method flow diagram provided in an embodiment of the present invention.
Fig. 4 (a)-(d) is video play mode judgment method flow diagram provided in an embodiment of the present invention.
Fig. 5 is video play device theory structure block diagram provided in an embodiment of the present invention.
Fig. 6 is video play device theory structure block diagram provided in an embodiment of the present invention.
Fig. 7 (a)-(d) is video play device theory structure block diagram provided in an embodiment of the present invention.
Fig. 8 is terminal structure schematic diagram provided in an embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects It encloses.
The present embodiments relate to technical term it is as follows:
IOS:It is the Mobile operating system developed by Apple Inc.;
HTML Video:HTML5 defines a kind of mask method usually including video by video members;
HTML Audio:Tag definition sound, such as music or other audio streams;
HTML Audioplay events:(it is suitable for all by the event of medium (such as video, image and audio) triggering HTML element, but be common in medium element, such as<audio>、<embed>、<img>、<object>And<video>):
SetTimeout functions:It is a primary javascript function, it can be after a specified delay time It calls a function or executes one section of specified code;
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
As shown in Fig. 1 (a)-(c), which show the use environments of the embodiment of the present invention.Specifically, (a) is please referred to Fig.1, User 100 initiates video playing request by user equipment 101 to server 102, and server 102 is received by network transmission After video playing request, inquiry request is initiated to database 103, and the query result that database 103 returns is passed through into network It is back to client 101.Client 101 confirms that video playing, server 102 pull broadcasting video from database 103, and in visitor It is played out on family end 101.But after client 101 confirms video playing, it may go out on the interface of client 101 Existing two kinds of broadcast interfaces.As shown in Fig. 1 (b), after user confirms video playing, video council directly plays, i.e. client circle The broadcasting content of video can be directly shown on face.As shown in Fig. 1 (c), after user confirms video playing, video window can be shown Broadcast button, after user clicks broadcast button, video can just play.For both play mode, different user has The considerations of different preference, certain user is for data traffic meeting preference shows the play mode of broadcast button, because of this mould Formula can be to avoid user because of the flow consumption that video plays automatically and causes;And another part user then likes oneself of video Dynamic play mode, because such pattern has better user experience.Therefore, before video playing, to the mould of video playing Formula is judged, better user experience can be brought.
As shown in Fig. 2, the embodiment of the present invention provides a kind of video play mode judgment method, the method includes walking as follows Suddenly:
S210 creates element variable.
S220 registers broadcast event for the element variable, and is broadcast event addition delay triggering function.
S230 calls the triggering function of the broadcast event, if the broadcast event is triggered, judges the video For direct play mode;If the delay triggering function is triggered, the video is judged to trigger play mode.
By above example, triggered using the broadcasting of the triggering function pair element variable of reproduction time as a result, can sentence Break and the play mode of currently playing video and be direct play mode or need the triggering play mode that is triggered by user. But due to the element variable of establishment be must be file with video file same type to be played, that is, the element of establishment becomes Amount is a video elementary variable, when registering broadcast event for video elementary variable, needs video elementary variable being embedded into In broadcast event, and embedded video elementary variable can bring prodigious resource overhead, execution efficiency low in broadcast event.Cause This, it is also necessary to the registration of broadcast event is optimized, to save system resource.
In conclusion the present embodiment supports the principle similitude played automatically based on video and audio, sound is judged utilizing Whether frequency plays to judge whether video plays automatically automatically, can reduce the consuming in deterministic process for system resource.And And it according to based on current network and user preference setting, may further determine whether to switch under different play mode.
As shown in figure 3, the embodiment of the present invention provides a kind of video play mode judgment method, the method includes walking as follows Suddenly:
S310 creates the first element variable.
First element variable refer to can be played event execution variable, the variable when being executed, resource consumption than It is relatively low, system resource is saved with this.In one example, the first element variable selection uses audio variable, because of audio variable The response of broadcast event can equally be obtained.
First element variable is assigned to second element by S320, dynamic creation second element.
Second element refers to the element for triggering broadcast event, and second element can be played event execution.At one In example, second element variables choice uses video variable, and video variable is can be registered as video playing event variable. After creating second element variable, the first element variable that step S310 is created is assigned to second element.In an example In, give the audio variable assignments of establishment to video variable, since audio variable is much smaller than the system resource spent by video variable, By creating audio variable and video variable, then by audio variable assignments system can be largely reduced to video variable The consuming of resource.
S330 registers broadcast event for second element, and is broadcast event addition delay triggering function.
After the first element is assigned to second element, broadcast event is registered for second element, is equivalent at this time to one A video with audio value registers broadcast event, and the broadcast event after registration includes the triggering function for broadcast event, is used It is triggered in broadcast event.After to registration broadcast event, delay triggering function also is added for broadcast event, delay is touched Number of sending a letter is an independent function, for clocked flip after starting for the first delay time in function.Delay triggers function Broadcast event is made an addition to, when broadcast event is triggered, the triggering timing of delay triggering function is activated.
S340 calls the triggering function of the broadcast event, if the broadcast event is triggered, judges the video For direct play mode;If the delay triggering function is triggered, the video is judged to trigger play mode.
The triggering function of broadcast event is called, which, which is equivalent to, asks the primary triggering of type corresponding to second element It asks, if it is direct play mode that current video, which plays type, broadcast event is triggered immediately, and passes through broadcast event Triggering, it is direct play mode that can return to current play mode.If it is triggering play mode that current video, which plays type, Then broadcast event will not be triggered, and since when calling the triggering function of broadcast event, broadcast event is not triggered, delay Triggering function is triggered when reaching for the first delay time, and it is triggering play mode to return to current play mode.
In conclusion the present embodiment supports the principle similitude played automatically based on video and audio, sound is judged utilizing Whether frequency plays to judge whether video plays automatically automatically, can reduce the consuming in deterministic process for system resource.
As shown in Fig. 4 (a), the embodiment of the present invention provides a kind of video play mode judgment method, and the method includes such as Lower step:
S410 creates Base64 MP3 variables.
First element variable refer to can be played event execution variable, the variable when being executed, resource consumption than It is relatively low, system resource is saved with this.In one example, the first element variable selection uses audio variable, because of audio variable The response of broadcast event can equally be obtained.
As shown in Fig. 4 (b), the step S410 also includes following sub-step:
S4101 creates MP3 format audio file.
MP3 format file is converted to Base64 MP3 variables by S4102.
In one example, it is to do variable files MP3 format audio file to be converted to Base64 MP3 variables To minimum, while Base64 MP3 format files are more advantageous to and are nested into html language.It is further noted that will Mp3 file, which is converted to Base64 MP3 variables, may cause mp3 file that can not play, and be in order to obtain one in the present embodiment A Base64 mp3 files, for the triggering as broadcast event, and whether mp3 file is playable after format translation Audio file does not influence the implementation of subsequent step.
S420, dynamic creation second element, by the Base64 MP3 variable assignments to second element.
Second element refers to the element for triggering broadcast event, and second element can be played event execution.At one In example, second element variables choice uses video variable, and video variable is can be registered as video playing event variable. After creating second element variable, the first element variable that step S310 is created is assigned to second element.In an example In, give the audio variable assignments of establishment to video variable, since audio variable is much smaller than the system resource spent by video variable, By creating audio variable and video variable, then by audio variable assignments system can be largely reduced to video variable The consuming of resource.
In one example, second element is the audio element of dynamic creation, and Base64 MP3 variables are assigned to dynamic The audio element of establishment.The consuming that equally can greatly reduce resource of the Base64 MP3 variable assignments to audio file.
In one example, second element can also be the video elementary of dynamic creation, and Base64 MP3 variables are assigned To the video elementary of dynamic creation.
S430 registers broadcast event for second element, and is broadcast event addition delay triggering function.
In one example, second element is video elementary, is second after the first element is assigned to second element Element registers broadcast event, is equivalent to registers broadcast event, the broadcasting thing after registration to a video with audio value at this time Part includes the triggering function for broadcast event, for being triggered to broadcast event.To registration broadcast event after, also for Broadcast event addition delay triggering function, delay triggering function is an independent function, for starting the first delay in function Clocked flip after time.Delay triggering function makes an addition to broadcast event, when broadcast event is triggered, delay triggering letter Several triggering timings is activated.
In one example, second element is audio element, is second after the first element is assigned to second element Element registers broadcast event, is equivalent to registers broadcast event, the broadcasting thing after registration to an audio with audio value at this time Part includes the triggering function for broadcast event, for being triggered to broadcast event.To registration broadcast event after, also for Broadcast event addition delay triggering function, delay triggering function is an independent function, for starting the first delay in function Clocked flip after time.Delay triggering function makes an addition to broadcast event, when broadcast event is triggered, delay triggering letter Several triggering timings is activated.
Broadcast event is registered for second element, including second element to be embedded into the process in broadcast event.Embedded is interior Appearance can be the Base64 MP3 variables after foregoing assignment, can also be a mp3 file, can also be that one includes MP3 broadcast address files.In all insertion contents, less system resource is expended using Base64 MP3 variables.
In one example, second element registration broadcast event is to be based on hypertext markup language (HTML), and postpone to touch Hair is to be based on Javascript technologies.Such as second element registration broadcast event can be play events, and postponing triggering can be with It is realized using setTimeout functions, it is, of course, also possible to realize delay triggering using other delay functions or timer Function.
In one example, why consider the first variable assignments to second element to realize to video play mode Judge, is because video playing is played with audio supports that the principle played automatically is identical, if current page supports audio It is automatic to play, then it also supports video to play automatically, since audio is compared with video file more light weight, use audio conduct Detection object expends less system resource.
HTML videos as shown in the table and audio method and attribute list:
Table one, HTML videos and audio method list
Method Description
addTextTrack() New text track is added to audio/video
canPlayType() Whether detection browser can play specified audio/video type
load() Reload audio/video element
play() Start to play audio/video
pause() Suspend currently playing audio/video
Table two, HTML videos and audio attribute list
Attribute Description
audioTracks Return to the AudioTrackList objects for indicating that track can be used
autoplay Setting returns to whether play audio/video immediately after loading is complete
buffered Return to the TimeRanges objects for indicating audio/video buffer portion
controller Return to the MediaController objects for indicating audio/video current media controller
controls Setting returns to whether audio/video shows control (such as broadcasting/pause etc.)
crossOrigin It is arranged or returns the CORS settings of audio/video
currentSrc Return to the URL of present video/video
currentTime It is arranged or returns the current play position (in seconds) in audio/video
defaultMuted Whether setting or return audio/video acquiescence are mute
defaultPlaybackRate It is arranged or returns the acquiescence broadcasting speed of audio/video
duration Return to the length (in seconds) of present video/video
ended Whether the broadcasting for returning to audio/video has terminated
error Return to the MediaError objects for indicating audio/video error condition
loop Setting returns to whether audio/video should replay at the end
According to upper table it is found that video playing is played with audio supports that the principle played automatically is identical.
S440 calls the triggering function of the broadcast event, if the broadcast event is triggered, judges the video For direct play mode;If the delay triggering function is triggered, the video is judged to trigger play mode.
The triggering function (play functions) of broadcast event is called, which is equivalent to for type corresponding to second element Trigger request, if it is direct play mode that current video, which plays type, broadcast event is made an immediate response, and is played Event is triggered.By the triggering of broadcast event, it is direct play mode that can return to current play mode.If working as forward sight It is triggering play mode that frequency, which plays type, then broadcast event will not be triggered, and due in the triggering function for calling broadcast event When, broadcast event is not triggered, and delay triggering function is triggered when reaching for the first delay time, returns to current broadcasting mould Formula is triggering play mode.
In one embodiment, triggering play mode is realized using UIWeb or the triggering play mode uses HTML It is realized with Javascript, by one of both modes, pops up video play button at video playing interface, regarded if not clicking Frequency broadcast button, then video will not play, by click video play button, the broadcasting of video can be triggered.
After step S440, following steps can also be carried out:
S450 judges whether that load is touched when video is direct play mode according to current network conditions and user setting Broadcast mode playback.
Based on step S450, can be judged whether to be converted to direct play mode according to network environment core user setting tactile Broadcast mode playback.As shown in Fig. 4 (c), step S450 can include following sub-step:
S4501 judges whether current network is radio data network.
In step, judge the networking type of user terminal, the type of networking can be GSM, CDMA, LET, LET-A, WIFI, HIFI, bluetooth, ZIGBEE, GPRS etc..
S4502 judges whether user allows to enable certainly under radio data network if current network is radio data network Dynamic playing function.
If current network is radio data network, i.e., if the operator that largely user may be caused additional using flow Charge then further judges the preference of user, and it is automatic to judge whether user preference setting allows to start under radio data network Playing function.
S4503, if user does not allow to start automatic playing function under radio data network, load triggering play mode.
If user preference does not allow to start automatic playing function under radio data network, loads triggering and play mould Formula, load triggering play mode can by using UIWeb realize or the triggering play mode using HTML with Javascript is realized, by one of both modes, video play button is popped up at video playing interface, if not clicking video Broadcast button, then video will not play, by click video play button, the broadcasting of video can be triggered.
After step S440, following steps can also be carried out:
S460 judges whether to enable straight when video is triggering play mode according to current network conditions and user setting Connect play mode.As shown in Fig. 4 (d), step S460 can include following sub-step:
S4601 judges whether current network is radio data network.
In step, judge the networking type of user terminal, the type of networking can be GSM, CDMA, LET, LET-A, WIFI, HIFI, bluetooth, ZIGBEE, GPRS etc..
S4602 judges whether user allows to enable automatic playing function if current network is not radio data network.
If current network is not radio data network, that is, network residing for user is the carrier charge net of such as WIFI Network, further judges whether user allows to start automatic playing function.
S4603 loads automatic play mode if user allows to enable triggering playing function.
If user allows to enable automatic playing function, automatic play mode is loaded.Automatic play mode can use Such as the autoplay attributes in setting HTML audio/video attributes are realized.
Step S4603 can also be realized by the way that automatic capture is arranged and clicks broadcast button.
In one embodiment, above-mentioned video play mode judgment method is suitable for IOS systems, because being deposited in IOS systems Play mode is triggered in the automatic play mode of video and video.
In one embodiment, without loss of generality, above-mentioned video play mode can be used supports in video and audio In the other systems of the identical principle played automatically.
In conclusion the present embodiment supports the principle similitude played automatically based on video and audio, sound is judged utilizing Whether frequency plays to judge whether video plays automatically automatically, can reduce the consuming in deterministic process for system resource.And And it according to based on current network and user preference setting, may further determine whether to switch under different play mode.
As shown in figure 5, the present embodiment provides a kind of video play mode judgment means, described device includes following module:
Element variable creating unit, for creating element variable.
Registration and delay triggering adding device, for registering broadcast event for the element variable, and are the broadcasting thing Part addition delay triggering function.
Calling and judging unit, the triggering function for calling the broadcast event, if the broadcast event is triggered, Then judge the video for direct play mode;If the delay triggering function is triggered, judge the video for triggering Play mode.
Above-mentioned module utilizes the broadcasting of the triggering function pair element variable of reproduction time for executing step S210-S230 Triggering is as a result, may determine that the play mode of currently playing video is direct play mode or needs to be triggered by user Triggering play mode.But due to the element variable of establishment be must be file with video file same type to be played, That is, the element variable created is a video elementary variable, when registering broadcast event for video elementary variable, need video Element variable is embedded into broadcast event, and embedded video elementary variable can bring prodigious resource overhead in broadcast event, Execution efficiency is low.Therefore, it is also desirable to which the registration to broadcast event is optimized, to save system resource.
As shown in fig. 6, the present embodiment provides a kind of video play device, described device includes following module:
First element variable creating unit, for creating the first element variable.
First element variable refer to can be played event execution variable, the variable when being executed, resource consumption than It is relatively low, system resource is saved with this.In one example, the first element variable selection uses audio variable, because of audio variable The response of broadcast event can equally be obtained.
Second element creating unit is used for dynamic creation second element, first element variable is assigned to second yuan Element.
Second element refers to the element for triggering broadcast event, and second element can be played event execution.At one In example, second element variables choice uses video variable, and video variable is can be registered as video playing event variable. After creating second element variable, the first element variable that step S310 is created is assigned to second element.In an example In, give the audio variable assignments of establishment to video variable, since audio variable is much smaller than the system resource spent by video variable, By creating audio variable and video variable, then by audio variable assignments system can be largely reduced to video variable The consuming of resource.
Registration and delay triggering adding device, for registering broadcast event for second element, and add for the broadcast event Add delay triggering function.
After the first element is assigned to second element, broadcast event is registered for second element, is equivalent at this time to one A video with audio value registers broadcast event, and the broadcast event after registration includes the triggering function for broadcast event, is used It is triggered in broadcast event.After to registration broadcast event, delay triggering function also is added for broadcast event, delay is touched Number of sending a letter is an independent function, for clocked flip after starting for the first delay time in function.Delay triggers function Broadcast event is made an addition to, when broadcast event is triggered, the triggering timing of delay triggering function is activated.
Judging unit, the triggering function for calling the broadcast event.If the broadcast event is triggered, judge The video is direct play mode;If the delay triggering function is triggered, judge that the video plays mould for triggering Formula.
The triggering function of broadcast event is called, which, which is equivalent to, asks the primary triggering of type corresponding to second element It asks, if it is direct play mode that current video, which plays type, broadcast event is triggered immediately, and passes through broadcast event Triggering, it is direct play mode that can return to current play mode.If it is triggering play mode that current video, which plays type, Then broadcast event will not be triggered, and since when calling the triggering function of broadcast event, broadcast event is not triggered, delay Triggering function is triggered when reaching for the first delay time, and it is triggering play mode to return to current play mode.
Above-mentioned module is for executing step S310-S330.
As shown in Fig. 7 (a), the present embodiment provides a kind of video play device, described device includes following module:
First element variable establishes module, for creating Base64 MP3 variables.
First element variable refer to can be played event execution variable, the variable when being executed, resource consumption than It is relatively low, system resource is saved with this.In one example, the first element variable selection uses audio variable, because of audio variable The response of broadcast event can equally be obtained.
As shown in Fig. 7 (b), it can also include following sub-step that the first element variable, which establishes module,:
Audio file creates submodule, for creating MP3 format audio file.
Format conversion submodule, for MP3 format file to be converted to Base64 MP3 variables.
In one example, it is to accomplish variable files MP3 format audio file to be converted to Base64MP3 variables Minimum, while Base64 MP3 format files are more advantageous to and are nested into html language.It is further noted that will Mp3 file, which is converted to Base64 MP3 variables, may cause mp3 file that can not play, and be in order to obtain one in the present embodiment A Base64 mp3 files, for the triggering as broadcast event, and whether mp3 file is playable after format translation Audio file does not influence the implementation of subsequent step.
Second element creating unit is used for dynamic creation second element, first element variable is assigned to second yuan Element.
Second element refers to the element for triggering broadcast event, and second element can be played event execution.At one In example, second element variables choice uses video variable, and video variable is can be registered as video playing event variable. After creating second element variable, the first element variable that step S310 is created is assigned to second element.In an example In, give the audio variable assignments of establishment to video variable, since audio variable is much smaller than the system resource spent by video variable, By creating audio variable and video variable, then by audio variable assignments system can be largely reduced to video variable The consuming of resource.
In one example, second element is the audio element of dynamic creation, and Base64 MP3 variables are assigned to dynamic The audio element of establishment.The consuming that equally can greatly reduce resource of the Base64 MP3 variable assignments to audio file.
In one example, second element can also be the video elementary of dynamic creation, and Base64 MP3 variables are assigned To the video elementary of dynamic creation.
Registration and delay triggering adding device are registered broadcast event for second element, and are prolonged for broadcast event addition Triggering function late.
In one example, second element is video elementary, is second after the first element is assigned to second element Element registers broadcast event, is equivalent to registers broadcast event, the broadcasting thing after registration to a video with audio value at this time Part includes the triggering function for broadcast event, for being triggered to broadcast event.To registration broadcast event after, also for Broadcast event addition delay triggering function, delay triggering function is an independent function, for starting the first delay in function Clocked flip after time.Delay triggering function makes an addition to broadcast event, when broadcast event is triggered, delay triggering letter Several triggering timings is activated.
In one example, second element is audio element, is second after the first element is assigned to second element Element registers broadcast event, is equivalent to registers broadcast event, the broadcasting thing after registration to an audio with audio value at this time Part includes the triggering function for broadcast event, for being triggered to broadcast event.To registration broadcast event after, also for Broadcast event addition delay triggering function, delay triggering function is an independent function, for starting the first delay in function Clocked flip after time.Delay triggering function makes an addition to broadcast event, when broadcast event is triggered, delay triggering letter Several triggering timings is activated.
Broadcast event is registered for second element, including second element to be embedded into the process in broadcast event.Embedded is interior Appearance can be the Base64 MP3 variables after foregoing assignment, can also be a mp3 file, can also be that one includes MP3 broadcast address files.In all insertion contents, less system resource is expended using Base64 MP3 variables.
In one example, second element registration broadcast event is to be based on hypertext markup language (HTML), and postpone to touch Hair is to be based on Javascript technologies.Such as second element registration broadcast event can be play events, and postponing triggering can be with It is realized using setTimeout functions, it is, of course, also possible to realize delay triggering using other delay functions or timer Function.
In one example, why consider the first variable assignments to second element to realize to video play mode Judge, is because video playing is played with audio supports that the principle played automatically is identical, if current page supports audio It is automatic to play, then it also supports video to play automatically, since audio is compared with video file more light weight, use audio conduct Detection object expends less system resource.
Judgment module, for calling the triggering function of the broadcast event to judge if the broadcast event is triggered The video is direct play mode;If the delay triggering function is triggered, judge that the video plays mould for triggering Formula.
The triggering function (play functions) of broadcast event is called, which is equivalent to for type corresponding to second element Trigger request, if it is direct play mode that current video, which plays type, broadcast event is made an immediate response, and is played Event is triggered.By the triggering of broadcast event, it is direct play mode that can return to current play mode.If working as forward sight It is triggering play mode that frequency, which plays type, then broadcast event will not be triggered, and due in the triggering function for calling broadcast event When, broadcast event is not triggered, and delay triggering function is triggered when reaching for the first delay time, returns to current broadcasting mould Formula is triggering play mode.
In one embodiment, triggering play mode is realized using UIWeb or the triggering play mode uses HTML It is realized with Javascript, by one of both modes, pops up video play button at video playing interface, regarded if not clicking Frequency broadcast button, then video will not play, by click video play button, the broadcasting of video can be triggered.
Can also include following module in the judgment module:
First handover module, for when video is direct play mode, being sentenced according to current network conditions and user setting It is disconnected whether to load triggering play mode.
Based on the first handover module, can judge whether to convert direct play mode according to network environment core user setting To trigger play mode.As shown in Fig. 7 (c), the first handover module can include following sub-step:
Network judging submodule judges whether current network is radio data network.
The module is used to judge the networking type of user terminal, the type of networking can be GSM, CDMA, LET, LET-A, WIFI, HIFI, bluetooth, ZIGBEE, GPRS etc..
User sets judgment module, if current network is radio data network, judges whether user allows in wireless data Automatic playing function is enabled under network.
If current network is radio data network, i.e., if the operator that largely user may be caused additional using flow Charge then further judges the preference of user, and it is automatic to judge whether user preference setting allows to start under radio data network Playing function.
Switch implementation sub-module, if user does not allow to start automatic playing function under radio data network, load triggering Play mode.
If user preference does not allow to start automatic playing function under radio data network, loads triggering and play mould Formula, load triggering play mode can by using UIWeb realize or the triggering play mode using HTML with Javascript is realized, by one of both modes, video play button is popped up at video playing interface, if not clicking video Broadcast button, then video will not play, by click video play button, the broadcasting of video can be triggered.
Also include following submodule in judgment module:
Second handover module, when video be triggering play mode when, according to current network conditions and user setting judgement be It is no to enable direct play mode.As shown in Fig. 7 (d), the second handover module can include following submodule:
Network judging submodule judges whether current network is radio data network.
The module is used for, and judges the networking type of user terminal, the type of networking can be GSM, CDMA, LET, LET-A, WIFI, HIFI, bluetooth, ZIGBEE, GPRS etc..
User sets judging submodule, if current network is not radio data network, judges whether user allows to enable certainly Dynamic playing function.
If current network is not radio data network, that is, network residing for user is the carrier charge net of such as WIFI Network, further judges whether user allows to start automatic playing function.
Switch implementation sub-module, if user allows to enable triggering playing function, loads automatic play mode.
If user allows to enable automatic playing function, automatic play mode is loaded.Automatic play mode can use Such as the autoplay attributes in setting HTML audio/video attributes are realized.
Switch implementation sub-module, can also be realized by the way that automatic capture is arranged and clicks broadcast button.
In one embodiment, above-mentioned video play mode judgment method is suitable for IOS systems, because being deposited in IOS systems Play mode is triggered in the automatic play mode of video and video.
In one embodiment, without loss of generality, above-mentioned video play mode can be used supports in video and audio In the other systems of the identical principle played automatically.
In conclusion the present embodiment supports the principle similitude played automatically based on video and audio, sound is judged utilizing Whether frequency plays to judge whether video plays automatically automatically, can reduce the consuming in deterministic process for system resource.And And it according to based on current network and user preference setting, may further determine whether to switch under different play mode.
Referring to FIG. 8, it illustrates the structural schematic diagrams of terminal provided by one embodiment of the present invention.The terminal is for real The video play mode judgment method provided in above-described embodiment is provided.Specifically:
Terminal 1000 may include RF (Radio Frequency, radio frequency) circuit 110, include one or more Memory 120, input unit 130, display unit 140, video sensor 150, the voicefrequency circuit of computer readable storage medium 160, WiFi (wireless fidelity, Wireless Fidelity) module 170, include there are one or more than one processing core The components such as processor 180 and power supply 190.It will be understood by those skilled in the art that the not structure of terminal structure shown in Fig. 8 The restriction of paired terminal may include either combining certain components or different components than illustrating more or fewer components Arrangement.Wherein:
RF circuits 110 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, one or the processing of more than one processor 180 are transferred to;In addition, the data for being related to uplink are sent to Base station.In general, RF circuits 110 include but not limited to antenna, at least one amplifier, tuner, one or more oscillators, use Family identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), duplex Device etc..In addition, RF circuits 110 can also be communicated with network and other equipment by radio communication.The wireless communication can make With any communication standard or agreement, and including but not limited to GSM (Global System of Mobile communication, entirely Ball mobile communcations system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message service) etc..
Memory 120 can be used for storing software program and module, and processor 180 is stored in memory 120 by operation Software program and module, to perform various functions application and data processing.Memory 120 can include mainly storage journey Sequence area and storage data field, wherein storing program area can storage program area, the application program (ratio needed at least one function Such as sound-playing function, image player function) etc.;Storage data field can be stored uses created number according to terminal 1000 According to (such as video data, phone directory etc.) etc..In addition, memory 120 may include high-speed random access memory, can also wrap Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts. Correspondingly, memory 120 can also include Memory Controller, to provide processor 180 and input unit 130 to memory 120 access.
Input unit 130 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating lever, optics or the input of trace ball signal.Specifically, input unit 130 may include figure As input equipment 131 and other input equipments 132.Image input device 131 can be camera, can also be optoelectronic scanning Equipment.In addition to image input device 131, input unit 130 can also include other input equipments 132.Specifically, other are inputted Equipment 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse It is one or more in mark, operating lever etc..
Display unit 140 can be used for showing information input by user or the information and terminal 1000 that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and its arbitrary combination. Display unit 140 may include display panel 141, optionally, LCD (Liquid Crystal Display, liquid crystal may be used Show device), the forms such as OLED (Organic Light-Emitting Diode, 15 Organic Light Emitting Diodes) configure display panel 141。
Terminal 1000 may include that at least one video sensor 150, video sensor are used to obtain the video information of user. Terminal 1000 can also include other sensor (not shown), such as optical sensor, motion sensor and other sensors.Tool Body, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ambient light Light and shade adjusts the brightness of display panel 141, and proximity sensor can close display panel when terminal 1000 is moved in one's ear 141 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally three Axis) acceleration size, size and the direction of gravity are can detect that when static, can be used to identify mobile phone posture application (such as Horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;As for The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor that terminal 1000 can also configure, herein not It repeats again.
Video circuit 160, loud speaker 161, microphone 162 can provide the video interface between user and terminal 1000.Sound The transformed electric signal of the audio data received can be transferred to loud speaker 161, is converted to by loud speaker 161 by frequency circuit 160 Voice signal exports;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, is received by voicefrequency circuit 160 After be converted to audio data, then by after the processing of audio data output processor 180, through RF circuits 11 to be sent to such as another end End, or audio data is exported to memory 120 to be further processed.Voicefrequency circuit 160 is also possible that earphone jack, To provide the communication of peripheral hardware earphone and terminal 1000.
WiFi belongs to short range wireless transmission technology, and terminal 1000 can help user's transceiver electronics by WiFi module 70 Mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 1 is shown WiFi module 170, but it is understood that, and it is not belonging to must be configured into for terminal 1000, it completely can be as needed It is omitted in the range for the essence for not changing invention.
Processor 180 is the control centre of terminal 1000, utilizes each portion of various interfaces and connection whole mobile phone Point, by running or execute the software program and/or module that are stored in memory 120, and calls and be stored in memory 120 Interior data execute the various functions and processing data of terminal 1000, to carry out integral monitoring to mobile phone.Optionally, it handles Device 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modulation /demodulation processing Device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is mainly located Reason wireless communication.
It is understood that above-mentioned modem processor can not also be integrated into processor 180.
Terminal 1000 further includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 180 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.Power supply 190 can also include one or more direct current or AC power, recharging system, power supply event Hinder the random components such as detection circuit, power supply changeover device or inverter, power supply status indicator.
Although being not shown, terminal 1000 can also be including bluetooth module etc., and details are not described herein.
Specifically in the present embodiment, terminal 1000 further includes having memory and one or more than one program, In one either more than one program be stored in memory and be configured to be executed by one or more than one processor. Either more than one program includes the side for executing above-mentioned sender's client-side or recipient's client-side to said one The instruction of method.Described instruction is for realizing following steps when being executed by processor:Create the first element variable;Dynamic creation First element variable is assigned to second element by Was Used;Broadcast event is registered for the second element, and is broadcast to be described Put event addition delay triggering function;The triggering function for calling the broadcast event judges video playing mould according to triggering result Formula.
It should be understood that referenced herein " multiple " refer to two or more."and/or", description association The incidence relation of object indicates may exist three kinds of relationships, for example, A and/or B, can indicate:Individualism A, exists simultaneously A And B, individualism B these three situations.It is a kind of relationship of "or" that character "/", which typicallys represent forward-backward correlation object,.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (11)

1. a kind of video play mode judgment method, which is characterized in that described method includes following steps:
The first element variable is created, first element variable is audio element variable;
Dynamic creation second element, the second element is audio element or video elementary, by the first element variable assignment To second element;
Broadcast event is registered for the second element, and is broadcast event addition delay triggering function;
The triggering function for calling the broadcast event judges video play mode according to triggering result.
2. according to the method described in claim 1, it is characterized in that, judging that video play mode includes according to triggering result:
If the broadcast event is triggered, judge the video for direct play mode;
If the delay triggering function is triggered, the video is judged to trigger play mode.
3. according to the method described in claim 1, it is characterized in that, the audio element variable is Base64 MP3 variables.
4. according to the method described in claim 1, it is characterized in that, when video be direct play mode when, according to current network Environment and user setting judge whether load triggering play mode.
5. according to the method described in claim 4, it is characterized in that, judging whether to add according to current network conditions and user setting Carrying triggering play mode includes:
Judge whether current network is radio data network;
If current network is radio data network, judge whether user allows to enable automatic broadcasting work(under radio data network Energy;
If user does not allow to start automatic playing function under radio data network, load triggering play mode.
6. a kind of video play mode judgment means, which is characterized in that described device includes following module:
First element variable creation module, for creating the first element variable, first element variable is audio element variable;
Second element creation module is used for dynamic creation second element, first element variable is assigned to second element, institute It is audio element or video elementary to state second element;
Registration and delay triggering add module, for registering broadcast event for the second element, and add for the broadcast event Add delay triggering function;
Judgment module, the triggering function for calling the broadcast event judge video play mode according to triggering result.
7. device according to claim 6, which is characterized in that the judgment module judges video playing according to triggering result Pattern includes:
If the broadcast event is triggered, judge the video for direct play mode;
If the delay triggering function is triggered, the video is judged to trigger play mode.
8. device according to claim 6, which is characterized in that the audio element variable is Base64 MP3 variables.
9. device according to claim 6, which is characterized in that the judgment module includes the first switching submodule, is used for When video is direct play mode, load triggering play mode is judged whether according to current network conditions and user setting.
10. device according to claim 9, which is characterized in that first switching submodule includes:
Network judging submodule, for judging whether current network is radio data network;
User sets judging submodule, for when current network is radio data network, judging whether user allows wireless Automatic playing function is enabled under data network;
Switch implementation sub-module, starts automatic playing function under radio data network for not allowing in user, load triggering Play mode.
11. a kind of client, including the device described in one of claim 6-10.
CN201710431523.5A 2017-06-09 2017-06-09 A kind of video broadcasting method, device and client Active CN107277564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710431523.5A CN107277564B (en) 2017-06-09 2017-06-09 A kind of video broadcasting method, device and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710431523.5A CN107277564B (en) 2017-06-09 2017-06-09 A kind of video broadcasting method, device and client

Publications (2)

Publication Number Publication Date
CN107277564A CN107277564A (en) 2017-10-20
CN107277564B true CN107277564B (en) 2018-09-04

Family

ID=60066692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710431523.5A Active CN107277564B (en) 2017-06-09 2017-06-09 A kind of video broadcasting method, device and client

Country Status (1)

Country Link
CN (1) CN107277564B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872506A (en) * 2016-05-03 2016-08-17 乐视控股(北京)有限公司 Method and device for television signal processing and television
CN105898514A (en) * 2015-12-15 2016-08-24 乐视网信息技术(北京)股份有限公司 Video play method and system
CN106162362A (en) * 2015-04-20 2016-11-23 中兴通讯股份有限公司 A kind of video broadcasting method and player

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9167275B1 (en) * 2010-03-11 2015-10-20 BoxCast, LLC Systems and methods for autonomous broadcasting
CN104581320A (en) * 2013-10-16 2015-04-29 中兴通讯股份有限公司 Method, device and terminal for switching play modes
CN103686414B (en) * 2013-12-19 2018-08-07 北京奇艺世纪科技有限公司 Internet video playback method and device
CN104090766B (en) * 2014-07-17 2017-08-25 广东欧珀移动通信有限公司 The audio switching method and system of a kind of mobile terminal
CN106792112A (en) * 2016-12-07 2017-05-31 北京小米移动软件有限公司 Video broadcasting method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162362A (en) * 2015-04-20 2016-11-23 中兴通讯股份有限公司 A kind of video broadcasting method and player
CN105898514A (en) * 2015-12-15 2016-08-24 乐视网信息技术(北京)股份有限公司 Video play method and system
CN105872506A (en) * 2016-05-03 2016-08-17 乐视控股(北京)有限公司 Method and device for television signal processing and television

Also Published As

Publication number Publication date
CN107277564A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
US10701451B2 (en) Program interaction system, method, client, and backend server
CN106686396B (en) Method and system for switching live broadcast room
CN104243671B (en) Volume adjusting method, device and electronic equipment
CN105979312B (en) Information sharing method and device
CN103473092B (en) A kind of download the processing method of application, device and terminal unit
CN108259975A (en) Video broadcasting method, storage medium and terminal
CN106791955B (en) A kind of method and system of determining live streaming duration
CN106231433B (en) A kind of methods, devices and systems playing network video
US11216997B2 (en) Method and apparatus for displaying historical chat record
CN103279574A (en) Method, device and terminal device for loading explorer pictures
US12015733B2 (en) Do-not-disturb method and terminal
CN107276984B (en) Game live broadcast method and device and mobile terminal
CN108184143B (en) Method and device for acquiring resources
CN103391473A (en) Methods and devices for providing and acquiring audios and videos
CN106302087A (en) Instant communication method, Apparatus and system
CN106254903A (en) The synchronous broadcast method of a kind of multi-medium data, Apparatus and system
CN103475914A (en) Video playing method, video playing device, terminal equipment and server
CN104239332A (en) Webpage content processing method, webpage content processing device and browser client side
CN103336838B (en) A kind of processing method of webpage, device and terminal device
CN104159140A (en) Video processing method, apparatus and system
CN103458277A (en) Method and device for operating live channel programs
CN107395890A (en) A kind of method and apparatus and mobile terminal for adjusting Showing Effectiveness On Screen
CN103458286A (en) Television channel switching method and device
CN106303605B (en) A kind of methods, devices and systems to send a notification message
CN106658657A (en) Network access method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant