Summary of the invention
The object of the embodiment of the present invention is to provide a kind of video broadcasting method and device, to improve the experience effect of user.
For achieving the above object, the embodiment of the invention discloses a kind of video broadcasting method, being applied to the mobile terminal with touch screen, comprising:
In the process playing target video, detect and whether have the slide for the touch screen of described mobile terminal to produce;
When having detected that slide produces, sliding distance x and glide direction are determined;
According to described glide direction, determine the redirect direction of the described target video that described slide is corresponding;
Judge whether described sliding distance x is less than default threshold value A, if so, then determine that the redirect time interval is: y=ax, otherwise, determine that the redirect time interval is: y=bx+C, wherein, a is original rate of change, and b is for regulating rate of change, a is less than b, and C is constant, and C >=(Aa-Ab);
According to described target video current broadcasting moment, determined redirect time interval y and determined redirect direction, the moment will play after determining described target video redirect;
The moment will play after determined redirect plays described target video.
Preferably, described C is: Aa-Ab.
Preferably, the determination of described sliding distance x, comprising:
Obtain starting point and the terminal of described slide, by the air line distance between described starting point and described terminal, be defined as described sliding distance x.
Preferably, the determination of described sliding distance x, comprising:
Obtain the sliding trace of described slide, the length of described sliding trace is defined as described sliding distance x.
Preferably, described according to described target video current broadcasting moment, determined redirect time interval y and determined redirect direction, in the moment will play after determining described target video redirect, comprising:
When determined redirect direction be video forward redirect, judge that the described target video current broadcasting moment adds whether the redirect time interval determined is greater than the duration of described target video; If not, then current for the described target video broadcasting moment is added the moment that the redirect time interval determined obtains, the moment will play after being defined as described target video redirect; If so, then by the broadcasting terminal of described target video, the moment will play after being defined as described target video redirect;
When determined redirect direction be video backward redirect, judge that the described target video current broadcasting moment deducts the redirect time interval determined and whether is less than zero; If not, is then deducted the moment that redirect time interval of determining obtains current for the described target video broadcasting moment, the moment will play after being defined as described target video redirect; If so, then by the broadcasting starting point of described target video, the moment will play after being defined as described target video redirect.
For achieving the above object, the embodiment of the invention discloses a kind of video play device, be applied to the mobile terminal with touch screen, comprise: slide detection module, the first determination module, the second determination module, judge module, the 3rd determination module, the 4th determination module and playing module, wherein
Whether described slide detection module, in the process playing target video, detect and have the slide for the touch screen of described mobile terminal to produce;
Described first determination module, for when described slide detection module has detected that slide produces, has determined sliding distance x and glide direction;
Described second determination module, for the glide direction determined according to described first determination module, determines the redirect direction of the described target video that described slide is corresponding;
Described judge module, for judging whether the sliding distance x that described first determination module is determined is less than default threshold value A;
Described 3rd determination module, for when described judge module judged result is for being, determine that the redirect time interval is: y=ax, when described judge module judged result is no, determine that the redirect time interval is: y=bx+C, wherein, a is original rate of change, and b is for regulating rate of change, and a is less than b, C is constant, and C >=(Aa-Ab);
Described 4th determination module, for the redirect direction that the redirect time interval y that determines according to the current broadcasting of described target video moment, described 3rd determination module and described second determination module determine, the moment will play after determining described target video redirect;
Described playing module, plays target video for the moment will play after the redirect determined from described 4th determination module.
Preferably, described C is: Aa-Ab.
Preferably, described first determination module, comprising: the first sliding distance determination submodule and the first glide direction determination submodule, wherein,
Described first sliding distance determination submodule, for when described slide detection module has detected that slide produces, obtain starting point and the terminal of described slide, by the air line distance between described starting point and described terminal, be defined as described sliding distance x;
Described first glide direction determination submodule, for when described slide detection module has detected that slide produces, has determined glide direction.
Preferably, described first determination module, comprising: the second sliding distance determination submodule and the second glide direction determination submodule, wherein,
Described second sliding distance determination submodule, for when described slide detection module has detected that slide produces, has obtained the sliding trace of described slide, the length of described sliding trace has been defined as described sliding distance x;
Described second glide direction determination submodule, for when described slide detection module has detected that slide produces, has determined glide direction.
Preferably, described 4th determination module, comprising: first judges that submodule, second judges that submodule and redirect moment determine submodule, wherein,
Described first judges submodule, redirect direction for determining at described second determination module be video forward redirect, judge that the described target video current broadcasting moment adds whether redirect time interval that described 3rd determination module is determined is greater than the duration of described target video;
Described second judges submodule, the redirect direction for determining at described second determination module be video backward redirect, judge that the described target video current broadcasting moment deducts the redirect time interval that described 3rd determination module determines and whether is less than zero;
The described redirect moment determines submodule, for when described first judges that submodule judged result is no, current for the described target video broadcasting moment is added the moment that the redirect time interval that described 3rd determination module is determined obtains, the moment will play after being defined as described target video redirect; When described first judges submodule judged result for being, by the broadcasting terminal of described target video, the moment will play after being defined as described target video redirect; When described second judges that submodule judged result is no, is deducted the moment that redirect time interval that described 3rd determination module determines obtains current for the described target video broadcasting moment, the moment will play after being defined as described target video redirect; When described second judges submodule judged result for being, by the broadcasting starting point of described target video, the moment will play after being defined as described target video redirect.
As seen from the above technical solutions, embodiments provide a kind of video broadcasting method and device, be applied to the mobile terminal with touch screen, in the process playing target video, detect and whether have the slide for the touch screen of described mobile terminal to produce; When having detected that slide produces, sliding distance x and glide direction are determined; According to described glide direction, determine the redirect direction of the described target video that described slide is corresponding; Judge whether described sliding distance x is less than default threshold value A, if so, then determine that the redirect time interval is: y=ax, otherwise, determine that the redirect time interval is: y=bx+C, wherein, a is original rate of change, and b is for regulating rate of change, a is less than b, and C is constant, and C >=(Aa-Ab); According to described target video current broadcasting moment, determined redirect time interval y and determined redirect direction, the moment will play after determining described target video redirect; The moment will play after determined redirect plays described target video.When user makes video fast forward/rewind long period, for the mobile terminal that screen size is less, without the need to the screen of repeatedly sliding mobile terminal, for the mobile terminal that screen size is larger, also without the need to significantly increasing sliding screen distance, namely video fast forward/rewind long period can be realized, easy to operate, improve the experience effect of user.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, embodiments of the invention are preferably applicable to the mobile terminal with touch screen, such as, the mobile terminal of IOS (IOS is the handheld equipment operating system developed by Apple), Android operation system (android system is a kind of based on the freedom of Linux and the operating system of open source code), WindowsPhone operating system (Windows Phone is the Mobile phone operating system that Microsoft issues), certainly be also applicable to other intelligent mobile terminals, the present invention is not construed as limiting this.
Below by specific embodiment, the present invention is described in detail.
The schematic flow sheet of a kind of video broadcasting method that Fig. 1 provides for the embodiment of the present invention, can comprise:
Whether S101: in the process playing target video, detect and have the slide for the touch screen of described mobile terminal to produce;
S102: when having detected that slide produces, determines sliding distance x and glide direction;
Exemplary, suppose that video watched by the current mobile phone that utilizes of user, this video duration is 15 minutes, and user slides the screen of mobile phone, according to the slide of user, determines the sliding distance that slide is corresponding and glide direction.
In actual applications, starting point and the terminal of slide can be obtained, by the air line distance between described starting point and described terminal, be defined as sliding distance.
Exemplary, suppose that the screen size of the mobile phone of the current use of user is 5 inches, resolution is 1920*1080 pixel, and the starting point coordinate P0 of slide is a pixel in mobile phone, the coordinate of this pixel is (X1, Y1), terminal point coordinate P1 is a pixel in mobile phone, and the coordinate of this pixel is (X2, Y2), then by the air line distance between P0 to P1, be defined as sliding distance, glide direction is that P0 points to P1.
Suppose that P0 coordinate is for (500,500), P1 coordinate is (200,900), then according to mobile phone screen size and resolution, calculate sliding distance P0P1=2.88 centimetre.
In actual applications, the sliding trace of described slide can also be obtained, the length of described sliding trace is defined as described sliding distance.
Exemplary, suppose that the screen size of the mobile phone of the current use of user is 5 inches, resolution is 1920*1080 pixel, the starting point coordinate P0 of slide is a pixel in mobile phone, the coordinate of this pixel is (X1, Y1), terminal point coordinate P1 is a pixel in mobile phone, the coordinate of this pixel is (X2, Y2), wherein, P1 is slid into through Pn by P0, sliding into Pn by P0 is linear slide, sliding into P1 by Pn is also linear slide, wherein Pn is a pixel in mobile phone, the coordinate of this pixel is (Xn, Yn), then the sliding distance of slide is P0Pn+PnP1, glide direction is that P0 points to P1.
S103: according to described glide direction, determines the redirect direction of the described target video that described slide is corresponding;
Exemplary, with above-mentioned starting point coordinate P0 (X1, Y1), terminal point coordinate P1 (X2, Y2) is example, if Y2>Y1, then the redirect direction of the described target video that slide is corresponding is video redirect forward, i.e. video fast forward, if Y2<Y1, then the redirect direction of the described target video that slide is corresponding is video redirect backward, i.e. video rewind.
S104: judge whether described sliding distance x is less than default threshold value A, if so, performs S105, if not, performs S106;
S105: determine that the redirect time interval is: y=ax; Wherein, a is original rate of change;
S106: determine that the redirect time interval is: y=bx+C; Wherein, b is for regulating rate of change, and a is less than b, and C is constant, and C >=(Aa-Ab);
Wherein, original rate of change a can, for the rate of change used in prior art, also can, for the rate of change set in the embodiment of the present invention, regulate rate of change b to be the rate of change set in the embodiment of the present invention, and b be greater than a.
In actual applications, constant C is specially: Aa-Ab.When constant C is Aa-Ab, avoiding at sliding distance is continually varying value, and redirect time interval value is the generation of the situation of the value of discontinuous change.
Exemplary, suppose that the threshold value A preset is 5 centimetres, original rate of change a value is 1, and regulating rate of change b value to be 1.8, C is 1*5-1.8*5=-4.
Suppose that the sliding distance determined is 1 centimetre, be less than default threshold value 5 centimetres, then redirect time interval y=1*1=1 minute;
Suppose that the sliding distance determined is 10 centimetres, equal default threshold value 5 centimetres, then redirect time interval y=1.8*10-4=14 minute.
Suppose, rate of change of the prior art is 1, when namely sliding screen distance is 1 centimetre, and video redirect 1 minute; When sliding screen distance is 2 centimetres, video redirect 2 minutes; Suppose that user is for by video redirect 14 minutes, for the mobile terminal that screen size is less, need repeatedly the screen of sliding mobile terminal, for the mobile terminal that screen size is larger, then need slip screen 14 centimetres, and for the example that the embodiment of the present invention uses, only need slip screen 10 centimetres, reduce the distance of slip screen, easy to operate, improve the experience effect of user.
S107: according to described target video current broadcasting moment, determined redirect time interval y and determined redirect direction, the moment will play after determining described target video redirect;
In actual applications, can when determined redirect direction be video forward redirect, judge that the described target video current broadcasting moment adds whether the redirect time interval determined is greater than the duration of described target video; If not, then current for the described target video broadcasting moment is added the moment that the redirect time interval determined obtains, the moment will play after being defined as described target video redirect; If so, then by the broadcasting terminal of described target video, the moment will play after being defined as described target video redirect;
When determined redirect direction be video backward redirect, judge that the described target video current broadcasting moment deducts the redirect time interval determined and whether is less than zero; If not, is then deducted the moment that redirect time interval of determining obtains current for the described target video broadcasting moment, the moment will play after being defined as described target video redirect; If so, then by the broadcasting starting point of described target video, the moment will play after being defined as described target video redirect.
Exemplary, be example with above-mentioned starting point coordinate P0 (X1, Y1), terminal point coordinate P1 (X2, Y2),
If Y2>Y1, then the redirect direction of the described target video that slide is corresponding is video redirect forward, i.e. video fast forward.
The hypothetical target video current broadcasting moment be 1 point 10 seconds, the redirect time interval determined is 1 minute, 1 point 10 seconds+1 minute=2 points durations being less than video for 10 seconds 15 minutes, then by 10 seconds moment 2 points, the moment will play after being defined as target video redirect;
The hypothetical target video current broadcasting moment be 1 point 10 seconds, the redirect time interval determined is 14 minutes, 1 point 10 seconds+14 minutes=15 points durations being greater than video for 10 seconds 15 minutes, then by the broadcasting terminal of target video, the moment will play after being defined as described target video redirect, namely now by the broadcasting terminal of video fast forward to video;
If Y2<Y1, then the redirect direction of the described target video that slide is corresponding is video redirect backward, i.e. video rewind.
The hypothetical target video current broadcasting moment be 1 point 10 seconds, the redirect time interval determined is 1 minute, 1 point 10 seconds-1 minute=0 point duration being less than video for 10 seconds 15 minutes, then by 10 seconds moment 0 point, the moment will play after being defined as target video redirect;
The hypothetical target video current broadcasting moment be 1 point 10 seconds, the redirect time interval determined is 14 minutes, 1 point 10 seconds-14 minutes=-12 points are less than zero in 50 seconds, then by the broadcasting starting point of target video, in the moment will play after being defined as described target video redirect, namely now video is fallen back on soon the broadcasting starting point of video.
S108: the moment will play after determined redirect plays described target video.
Exemplary, the moment will play after supposing the target video redirect determined be 2 points 10 seconds, then from 2 points of 10 seconds displaying videos;
The moment will play after supposing the target video redirect determined is the broadcasting terminal of video, then from the broadcasting terminal displaying video of video;
The moment will play after supposing the target video redirect determined is the broadcasting starting point of video, then from the broadcasting starting point displaying video of video.
It should be noted that, above-mentionedly utilize mobile phone to watch video with user, this video duration is 15 minutes, and the slide screen of mobile phone of user is that example is described, and is only an instantiation of the embodiment of the present invention, does not form restriction to the present invention.
The present invention is embodiment illustrated in fig. 1 in application, when user makes video fast forward/rewind long period, for the mobile terminal that screen size is less, without the need to the screen of repeatedly sliding mobile terminal, for the mobile terminal that screen size is larger, also without the need to significantly increasing sliding screen distance, namely can realize video fast forward/rewind long period, easy to operate, improve the experience effect of user.
Corresponding with above-mentioned embodiment of the method, the embodiment of the present invention additionally provides a kind of video play device.
The structural representation of a kind of video play device that Fig. 2 provides for the embodiment of the present invention, can comprise: slide detection module 201, first determination module 202, second determination module 203, judge module 204, the 3rd determination module 205, the 4th determination module 206 and playing module 207, wherein
Whether slide detection module 201, in the process playing target video, detect and have the slide for the touch screen of described mobile terminal to produce;
First determination module 202, for when slide detection module 201 has detected that slide produces, has determined sliding distance x and glide direction;
The first determination module 202 in the embodiment of the present invention, can comprise: the first sliding distance determination submodule and the first glide direction determination submodule (not shown), wherein,
First sliding distance determination submodule, for when slide detection module 201 has detected that slide produces, obtain starting point and the terminal of described slide, by the air line distance between described starting point and described terminal, be defined as described sliding distance x;
First glide direction determination submodule, for when slide detection module 201 has detected that slide produces, has determined glide direction.
The first determination module 202 in the embodiment of the present invention, can comprise: the second sliding distance determination submodule and the second glide direction determination submodule (not shown), wherein,
Second sliding distance determination submodule, for when slide detection module 201 has detected that slide produces, has obtained the sliding trace of described slide, and the length of described sliding trace is defined as described sliding distance x;
Described second glide direction determination submodule, for when slide detection module 201 has detected that slide produces, has determined glide direction.
Second determination module 203, for the glide direction determined according to the first determination module 202, determines the redirect direction of the described target video that described slide is corresponding;
Judge module 204, for judging whether the sliding distance x that the first determination module 202 is determined is less than default threshold value A;
3rd determination module 205, for when judge module 204 judged result is for being, determine that the redirect time interval is: y=ax, when judge module 204 judged result is no, determine that the redirect time interval is: y=bx+C, wherein, a is original rate of change, and b is for regulating rate of change, and a is less than b, C is constant, and C >=(Aa-Ab);
Constant C in the embodiment of the present invention, is specially: Aa-Ab.
4th determination module 206, for the redirect direction that the redirect time interval y that determines according to the current broadcasting of described target video moment, the 3rd determination module 205 and the second determination module 203 determine, the moment will play after determining described target video redirect;
The 4th determination module 206 in the embodiment of the present invention, can comprise: first judges that submodule, second judges that submodule and redirect moment determine submodule (not shown), wherein,
First judges submodule, redirect direction for determining at the second determination module 203 be video forward redirect, judge that the described target video current broadcasting moment adds whether redirect time interval that the 3rd determination module 205 is determined is greater than the duration of described target video;
Second judges submodule, the redirect direction for determining at the second determination module 203 be video backward redirect, judge that the described target video current broadcasting moment deducts the redirect time interval that the 3rd determination module 205 determines and whether is less than zero;
The redirect moment determines submodule, for when first judges that submodule judged result is no, current for the described target video broadcasting moment is added the moment that the redirect time interval that the 3rd determination module 205 is determined obtains, the moment will play after being defined as described target video redirect; When first judges submodule judged result for being, by the broadcasting terminal of described target video, the moment will play after being defined as described target video redirect; When second judges that submodule judged result is no, is deducted the moment that redirect time interval that the 3rd determination module 205 determines obtains current for the described target video broadcasting moment, the moment will play after being defined as described target video redirect; When second judges submodule judged result for being, by the broadcasting starting point of described target video, the moment will play after being defined as described target video redirect.
Playing module 207, plays target video for the moment will play after the redirect determined from the 4th determination module 206.
The present invention is embodiment illustrated in fig. 2 in application, when user makes video fast forward/rewind long period, for the mobile terminal that screen size is less, without the need to the screen of repeatedly sliding mobile terminal, for the mobile terminal that screen size is larger, also without the need to significantly increasing sliding screen distance, namely can realize video fast forward/rewind long period, easy to operate, improve the experience effect of user.
It should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
Each embodiment in this specification all adopts relevant mode to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realized in said method execution mode is that the hardware that can carry out instruction relevant by program has come, described program can be stored in computer read/write memory medium, here the alleged storage medium obtained, as: ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.