The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of video broadcasting method and device.It is described
Technical scheme is as follows:
First aspect includes there is provided a kind of video broadcasting method, methods described:
When receiving many video playback instructions, send many video playbacks to server and ask, many video playbacks please
Ask and carry multiple channel identications to be played so that the server returns to video flowing, and the video flowing is by the multiple channel
Corresponding Video coding is identified to obtain;
When receiving the video flowing, the video flowing is decoded, multiple videos are obtained;
According to the corresponding relation between mobile terminal posture and viewing area, the current posture institute of the mobile terminal is determined
Corresponding multiple viewing areas;
Play the multiple video respectively in the multiple viewing area.
Alternatively, according to the corresponding relation between mobile terminal posture and viewing area, determine that the mobile terminal is current
Posture corresponding to multiple viewing areas include:
, will be described when obtaining two videos to the decoding video stream and the mobile terminal posture is in transverse screen state
The on-screen display (osd) area of mobile terminal is divided into the first viewing area and the second viewing area, and first viewing area is located at institute
State on the left of the second viewing area;Two videos are shown respectively in first viewing area and second viewing area;
When obtaining two videos to the decoding video stream and the mobile terminal posture is in portrait layout state, according to pre-
If ratio, the on-screen display (osd) area of the mobile terminal is divided into the 3rd viewing area and information display area, described information
Viewing area is used to show the information beyond video, and the predeterminable area in the 3rd viewing area is defined as into the 4th viewing area
Domain;Two videos are shown respectively in the 3rd viewing area and the 4th viewing area.
Alternatively, transverse screen state is in when obtaining two videos and the mobile terminal posture to the decoding video stream
When, the on-screen display (osd) area of the mobile terminal is divided into the first viewing area and the second viewing area includes:
When obtaining two videos to the decoding video stream and the mobile terminal posture is in transverse screen state, institute is obtained
State the picture traverse of the first video and the second video in two videos;
Calculate the ratio between the picture traverse of first video and the picture traverse of second video;
The on-screen display (osd) area of the mobile terminal is divided into and described by first viewing area according to the ratio
Second viewing area so that the ratio of the width of first viewing area and the width of second viewing area and the ratio
Example is equal, and first viewing area is equal with the screen height of the mobile terminal with the height of second viewing area.
Alternatively, obtaining the picture traverse of the first video in described two videos and the second video includes:
According to the screen height of the mobile terminal, to the picture altitude and figure of first video and second video
Image width degree carries out level specific pressure contracting so that the picture altitude of first video and second video and the movement are whole after compression
The screen height at end is equal;
Obtain the picture traverse of first video after compression;
Obtain the picture traverse of second video after compression.
Alternatively, playing the multiple video respectively in the multiple viewing area includes:
Judge whether the picture traverse of first video after compression is more than the width of first viewing area;
When the picture traverse of first video after compression is more than the width of first viewing area, according to described the
The width of one viewing area, cuts to the left and right sides of first video after compression so that described first regards after cutting
The picture traverse of frequency is equal to the width of first viewing area, and first after cutting is played in first viewing area and is regarded
Frequently;Or, when the picture traverse of first video after compression is not more than the width of first viewing area, described first
Play the first video after compression in viewing area;
Judge whether the picture traverse of second video after compression is more than the width of second viewing area;
When the picture traverse of second video after compression is more than the width of second viewing area, according to described the
The width of two viewing areas, is cut to the left and right sides of second video after compression so that second video is cut
Width afterwards is equal to the width of second viewing area, and the second video after cutting is played in second viewing area;Or,
When the picture traverse of second video after compression is not more than the width of second viewing area, in second viewing area
Play the second video after compression in domain.
Alternatively, methods described also includes:
When detecting the clicking operation to second viewing area, described second is played in first viewing area
Video, first video is played in second viewing area;Or,
When detecting the clicking operation to the 4th viewing area, described second is played in the 3rd viewing area
Video, first video is played in the 4th viewing area.
Second aspect includes there is provided a kind of video play device, described device:
Request sending module, for when receiving many video playback instructions, sending many video playbacks to server and asking,
Many video playback requests carry multiple channel identications to be played so that the server returns to video flowing, the video
Stream is obtained by the corresponding Video coding of the multiple channel identication;
Decoder module, for when receiving the video flowing, being decoded to the video flowing, obtains multiple videos;
Viewing area determining module, for according to the corresponding relation between mobile terminal posture and viewing area, determining institute
State multiple viewing areas corresponding to the current posture of mobile terminal;
Playing module, for playing the multiple video respectively in the multiple viewing area.
Alternatively, the viewing area determining module includes:
First division unit, for when obtaining two videos to the decoding video stream and the mobile terminal posture is in
During transverse screen state, the on-screen display (osd) area of the mobile terminal is divided into the first viewing area and the second viewing area;Institute
State in the first viewing area and second viewing area and show two videos respectively;Or,
Second division unit, for when obtaining two videos to the decoding video stream and the mobile terminal posture is in
During portrait layout state, according to preset ratio, the on-screen display (osd) area of the mobile terminal is divided into the 3rd viewing area and information
Viewing area, described information viewing area is used to show the information beyond video, by the preset areas in the 3rd viewing area
Domain is defined as the 4th viewing area;Two videos are shown respectively in the 3rd viewing area and the 4th viewing area.
Alternatively, first division unit includes:
Width obtains subelement, the decoding video stream is obtained at two videos and the mobile terminal posture for working as
When transverse screen state, the picture traverse of the first video and the second video in described two videos is obtained;
Ratio computation subunit, for calculating the picture traverse of first video and the picture traverse of second video
Between ratio;
Region division subelement, described in the on-screen display (osd) area of the mobile terminal is divided into according to the ratio
First viewing area and second viewing area so that the width of first viewing area and second viewing area
The ratio of width is in equal proportions with described, and first viewing area and the height of second viewing area and the movement are whole
The screen height at end is equal.
Alternatively, the width, which obtains subelement, is used for the screen height according to the mobile terminal, is regarded to described first
The picture altitude and picture traverse of frequency and second video carry out level specific pressure contracting so that first video and described after compression
The picture altitude of second video is equal with the screen height of the mobile terminal;The image for obtaining first video after compression is wide
Degree;Obtain the picture traverse of second video after compression.
Alternatively, the playing module includes:
First judging unit, for judging whether the picture traverse of first video after compression is more than the described first display
The width in region;
First broadcast unit, the picture traverse for first video after compression is more than first viewing area
During width, according to the width of first viewing area, the left and right sides of first video after compression is cut so that
The picture traverse of first video is equal to the width of first viewing area after cutting, is played in first viewing area
The first video after cutting;Or, first broadcast unit be additionally operable to when compression after first video picture traverse it is little
When the width of first viewing area, the first video after playing compression in first viewing area;
Second judging unit, for judging whether the picture traverse of second video after compression is more than the described second display
The width in region;
Second broadcast unit, the picture traverse for second video after compression is more than second viewing area
During width, according to the width of second viewing area, the left and right sides of second video after compression is cut so that
Width after the second video cutting is equal to the width of second viewing area, plays and cuts in second viewing area
The second video afterwards;Or, second broadcast unit is additionally operable to the picture traverse no more than institute of second video after compression
When stating the width of the second viewing area, the second video after playing compression in second viewing area.
Alternatively, described device also includes:
First switching playing module, for when detecting the clicking operation to second viewing area, described the
Second video is played in one viewing area, and first video is played in second viewing area;Or,
Second switching playing module, for when detecting the clicking operation to the 4th viewing area, described the
Second video is played in three viewing areas, and first video is played in the 4th viewing area.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
Method and apparatus provided in an embodiment of the present invention, by when the mobile terminal needs to show multiple videos, according to
Corresponding relation between mobile terminal posture and viewing area, determines multiple displays corresponding to the current posture of the mobile terminal
Region so that mobile terminal can change the viewing area of video according to the change of posture, realize multiple video display areas
Flexible display, improve flexibility.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is a part of embodiment of the invention, rather than whole embodiments.Based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made
Example, belongs to the scope of protection of the invention.
Fig. 1 is a kind of flow chart of video broadcasting method provided in an embodiment of the present invention, and referring to Fig. 1, this method includes:
101st, when receiving many video playback instructions, many video playbacks is sent to server and are asked, many video playbacks
Request carries multiple channel identications to be played so that the server returns to video flowing, and the video flowing is by the plurality of channel identication
Corresponding Video coding is obtained.
102nd, when receiving the video flowing, the video flowing is decoded, multiple videos are obtained.
103rd, according to the corresponding relation between mobile terminal posture and viewing area, the current posture of the mobile terminal is determined
Corresponding multiple viewing areas.
104th, the plurality of video is played respectively in the plurality of viewing area.
Method provided in an embodiment of the present invention, by when the mobile terminal needs to show multiple videos, according to mobile whole
The corresponding relation between posture and viewing area is held, multiple viewing areas corresponding to the current posture of the mobile terminal are determined,
Enable mobile terminal to change the viewing area of video according to the change of posture, realize the flexible of multiple video display areas
It has been shown that, improves flexibility.
Alternatively, according to the corresponding relation between mobile terminal posture and viewing area, determine that the mobile terminal is current
Multiple viewing areas corresponding to posture include:
It is when obtaining two videos to the decoding video stream and the mobile terminal posture is in transverse screen state, the movement is whole
The on-screen display (osd) area at end is divided into the first viewing area and the second viewing area, and first viewing area is located at second display
On the left of region;Two videos are shown respectively in first viewing area and second viewing area;
When obtaining two videos to the decoding video stream and the mobile terminal posture is in portrait layout state, according to default ratio
Example, is divided into the 3rd viewing area and information display area, the information display area by the on-screen display (osd) area of the mobile terminal
For showing the information beyond video, the predeterminable area in the 3rd viewing area is defined as the 4th viewing area;This
Two videos are shown respectively in three viewing areas and the 4th viewing area.
Alternatively, will when obtaining two videos to the decoding video stream and the mobile terminal posture is in transverse screen state
The on-screen display (osd) area of the mobile terminal, which is divided into the first viewing area and the second viewing area, to be included:
When obtaining two videos to the decoding video stream and the mobile terminal posture is in transverse screen state, this two are obtained
The picture traverse of the first video and the second video in video;
Calculate the ratio between the picture traverse of first video and the picture traverse of second video;
The on-screen display (osd) area of the mobile terminal is divided into by first viewing area and second display according to the ratio
Region so that the ratio of the width of first viewing area and the width of second viewing area is in equal proportions with this, and this first
Viewing area is equal with the height of second viewing area and the screen height of the mobile terminal.
Alternatively, obtaining the picture traverse of the first video in two videos and the second video includes:
According to the screen height of the mobile terminal, to the picture altitude and picture traverse of first video and second video
Carry out level specific pressure contracting so that the picture altitude of first video and second video and the screen height of the mobile terminal after compression
It is equal;
Obtain the picture traverse of first video after compression;
Obtain the picture traverse of second video after compression.
Alternatively, playing the plurality of video respectively in the plurality of viewing area includes:
Judge whether the picture traverse of first video after compression is more than the width of first viewing area;
When the picture traverse of first video after compression is more than the width of first viewing area, according to first display
The width in region, cuts to the left and right sides of first video after compression so that the image of first video is wide after cutting
Degree plays the first video after cutting equal to the width of first viewing area in first viewing area;Or, should after compression
When the picture traverse of first video is not more than the width of first viewing area, the after compression is played in first viewing area
One video;
Judge whether the picture traverse of second video after compression is more than the width of second viewing area;
When the picture traverse of second video after compression is more than the width of second viewing area, according to second display
The width in region, cuts to the left and right sides of second video after compression so that width after second video cutting etc.
Width in second viewing area, the second video after cutting is played in second viewing area;Or, when compression after this second
When the picture traverse of video is not more than the width of second viewing area, second after compression is played in second viewing area and is regarded
Frequently.
Alternatively, this method also includes:
When detecting the clicking operation to second viewing area, second video is played in first viewing area,
First video is played in second viewing area;Or,
When detecting the clicking operation to the 4th viewing area, second video is played in the 3rd viewing area,
First video is played in the 4th viewing area.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the present invention, herein no longer using any combination
Repeat one by one.
Fig. 2 a are a kind of flow charts of video broadcasting method provided in an embodiment of the present invention.The execution master of the inventive embodiments
Body is mobile terminal, and referring to Fig. 2 a, this method includes:
201st, when the mobile terminal receives the double vision frequency play instruction of the first channel identication of carrying and the second channel identication
When, double vision frequency playing request is sent to server, the double vision frequency playing request carries first channel identication and second channel
Mark so that the server returns to video flowing, and the second channel identication is corresponding regards with this by first channel identication for the video flowing
Frequency coding is obtained.
Wherein, channel identication refers to title or numbering of channel etc., can be generated by the server for the channel.It is mobile whole
End enters the channel by selecting video labeling or input video to identify, then the server provides the video for the mobile terminal
Identify corresponding video flowing so that the mobile terminal playing video.
When user wishes the video of two channels of broadcasting, first channel identication and second channel identication are selected, and
Double vision frequency play instruction is triggered, the mobile terminal sends double vision frequency when receiving the double vision frequency play instruction to the server
Playing request, the double vision frequency playing request carries first channel identication and second channel identication, and the server is being received
During the double vision frequency playing request, corresponding first video of first channel identication and second channel identication corresponding second are obtained
Video, obtains the video flowing after being encoded, return to the mobile terminal.
It should be noted that the embodiment of the present invention is illustrated by taking two videos of the mobile terminal playing as an example, and in reality
In the application of border, the mobile terminal can also play multiple videos.Many videos are triggered when user have selected multiple channel identications to broadcast
Instruction is put, the mobile terminal sends many video playbacks to the server and asked, this is more when receiving many video playback instructions
Video playback request carries multiple channel identications, and the server is when receiving many video playback requests, according to the plurality of frequency
Road mark obtains corresponding video, video flowing is obtained after being encoded, and return to the mobile terminal.The embodiment of the present invention is treated
The number of the video of broadcasting is not limited.
202nd, when the mobile terminal receives the video flowing, the video flowing is decoded, the first video and is obtained
Two videos.
Alternatively, the server is according to first video labeling and second video labeling, to first video and this
Two videos are encoded, in order to make a distinction.The mobile terminal is when receiving the video flowing, according to first video labeling
Decoded with second video labeling, obtain first video and second video.
203rd, the mobile terminal judges whether current posture is transverse screen state, if it is, step 204 is performed, if not,
Perform step 208.
The posture of mobile terminal includes two kinds:Portrait layout state and transverse screen state, and the mobile terminal configuration has sensor, root
The sensor information passed back according to the sensor of the mobile terminal configuration, it can be determined that the current posture of the mobile terminal is transverse screen shape
State or portrait layout state.
In embodiments of the present invention, the mobile terminal can configure magnetic field sensor, gyro sensor, six axles towards biography
Sensor or nine axle rotating vector sensors etc., the embodiment of the present invention is not limited this.
Alternatively, the mobile terminal configuration has direction sensor, obtains the angle value that direction sensor is passed back, and judging should
Whether angle value belongs in the range of default transverse screen, and the default transverse screen scope is used to determine that the mobile terminal posture is in transverse screen state
When the angle value span.When the angle value belongs in the range of the default transverse screen, the current appearance of the mobile terminal is determined
State is transverse screen state, when the angle value is not belonging in the range of the default transverse screen, determines that the current posture of the mobile terminal is perpendicular
Screen state.
Wherein, the default transverse screen may range from(45,135)With(225,315).Certainly, the default transverse screen scope can be with
Rule of thumb set, or set according to the requirement for judging precision, the embodiment of the present invention is not limited this.
204th, the mobile terminal is according to screen height, and the picture altitude and image to first video and second video are wide
Degree carries out level specific pressure contracting so that the picture altitude of first video and second video and the screen of the mobile terminal are high after compression
Degree is equal, obtains the picture traverse of the picture traverse of first video and second video after compression.
First video and second video are laterally played when the mobile terminal posture is in transverse screen state, this first is regarded
Height when frequency and second video playback should be equal with the screen height of the mobile terminal, due to the picture altitude one of video
As be more than the screen height of mobile terminal, therefore the mobile terminal is needed to the picture altitude of first video and second video
It is compressed.And in order to ensure that the image scaled of video is constant, the picture altitude of video and the compression factor of picture traverse should
It is equal.It that is to say, the mobile terminal is compressed to the picture altitude of first video, until the picture altitude of first video
When equal with the screen height, the compression factor of first video is determined, it is right according to the compression factor of first video of determination
The picture traverse of first video is compressed, the picture traverse of first video after being compressed.The mobile terminal to this
The picture altitude of two videos is compressed, until when the picture altitude of second video is equal with the screen height, determine this
The compression factor of two videos, according to the compression factor of second video of determination, is pressed the picture traverse of second video
Contracting, the picture traverse of second video after being compressed.
Referring to Fig. 2 b, the height of the mobile terminal screen viewing area is 30mm, and width is 50mm, first video height
For 60mm, width is 120mm, then the mobile terminal carries out level specific pressure contracting to first video so that first video after compression
Picture altitude be changed into 30mm, now the picture traverse of first video be 60mm.
205th, the mobile terminal calculate compression after first video picture traverse and second video picture traverse it
Between ratio, according to the ratio by the on-screen display (osd) area of the mobile terminal be divided into first viewing area and this second display
Region so that the ratio of the width of first viewing area and the width of second viewing area is in equal proportions with this, and this first
Viewing area is equal with the height of second viewing area and the screen height of the mobile terminal, and first viewing area is located at
On the left of second viewing area.
In embodiments of the present invention, on-screen display (osd) area can laterally be divided into equal first of width by the mobile terminal
Viewing area and the second viewing area.But due to the picture traverse of first video after compression and the picture traverse of second video
May be different, or even differ greatly.If first viewing area is identical with the width of second viewing area, first video
Picture traverse when being more than the picture traverse of second video, it is possible that first viewing area can not completely show this
The image of one video, and second viewing area shows after the image of second video also there is remaining area, this is resulted in
The waste of viewing area.
In order to improve the utilization rate of the on-screen display (osd) area, the mobile terminal is wide according to the image of first video after compression
Ratio between degree and the picture traverse of second video, divides to the on-screen display (osd) area, the screen will be located at after division
Viewing area on the left of curtain viewing area will be used as second display as first viewing area positioned at the viewing area on right side
Region so that the ratio of the width of first viewing area and the width of second viewing area is in equal proportions with this.
Further, can be wide according to the image of the plurality of video after compression when the multiple videos of the mobile terminal playing
Ratio between degree, is divided to the on-screen display (osd) area.As obtained N number of video to the decoding video stream when the mobile terminal
When, according to the ratio between the picture traverse of N number of video after compression, the on-screen display (osd) area is laterally divided into N number of viewing area
Domain, N number of viewing area is used to play N number of video.
206th, the first video after the mobile terminal plays the compression in first viewing area, in second viewing area
Play the second video after the compression.
In embodiments of the present invention, the mobile terminal includes in the first video that first viewing area is played after the compression
Following steps(2061)-(2063):
(2061)The mobile terminal judges whether the picture traverse of first video after compression is more than first viewing area
Width.
(2062)The picture traverse of first video is more than first viewing area after mobile terminal determines to compress
During width, according to the width of first viewing area, the left and right sides of first video after compression is cut so that cut
The picture traverse of first video is equal to the width of first viewing area afterwards, and the after cutting is played in first viewing area
One video.
Alternatively, the mobile terminal by the width of the picture traverse of first video after compression and first viewing area it
Difference cuts from the left side of the first video after compression as unnecessary video width and goes the half of the unnecessary video width is corresponding to regard
Frequently, the corresponding video of half for removing the unnecessary video width is cut from right side so that the picture traverse of the first video after the cutting
Equal to the width of first viewing area, and the image of first video can be shown centered in first viewing area.
Referring to Fig. 2 b, the picture traverse of first video is 60mm after compression, and the width of first viewing area is 50mm,
When playing first video in first viewing area, by have width be 10mm video outside first viewing area, then
The mobile terminal is cut to the first video after the compression, and the video that width is 5mm is cut off from first video left side, from
Right side cuts off the video that width is 5mm so that the picture traverse of the first video after cutting and the width of first viewing area
It is equal.
(2063)The picture traverse of first video is not more than first viewing area after mobile terminal determines to compress
Width when, first viewing area play compression after the first video.
When the picture traverse of first video after compression is less than the width of first viewing area, the figure of first video
As that can not be covered with first viewing area, first viewing area can also exist remaining after the image of first video is shown
The region of non-display image, then the first video after the mobile terminal plays compression in first viewing area, and with the screen
The background colour of viewing area fills the region of the non-display image of residue in first viewing area.Further, the movement is whole
When the first video after compression is played at end, the image for the first video being shown centered in first viewing area after compression, with this
Background colour fills the left and right sides of first viewing area.
Referring to Fig. 2 c, the height of the on-screen display (osd) area is 30mm, and width is 50mm, and the picture altitude of first video is
60mm, width is 80mm, then the picture traverse of first video is 40mm, the picture traverse of first video after compression after compressing
Less than the width of first viewing area, then what the mobile terminal was shown centered in first viewing area after the compression first regards
The image of frequency, and the area for the non-display image in the left and right sides that first viewing area is filled with the on-screen display (osd) area background colour
Domain.
In embodiments of the present invention, the mobile terminal includes in the second video that second viewing area is played after the compression
Following steps(2064)-(2066):
(2064)Judge whether the picture traverse of second video after compression is more than the width of second viewing area.
(2065)When the picture traverse of second video after compression is more than the width of second viewing area, according to this
The width of two viewing areas, cuts to the left and right sides of second video after compression so that after second video is cut
Width is equal to the width of second viewing area, and the second video after cutting is played in second viewing area.
(2066)When the width after second video compress is not more than the width of second viewing area, this second show
Show that the second video after compression is played in region.
The mobile terminal plays the process of the second video after the compression in second viewing area and in first display
The process that the first video after the compression is played in region is similar, will not be repeated here.
Further, when the mobile terminal posture is in transverse screen state, in order to ensure the continuity at interface, the movement is whole
End can adjust first video in the display location of first viewing area and second video in second viewing area
Display location so that first video is connected with the image of second video and is shown centered on the screen of the mobile terminal.
It that is to say, the picture traverse of first video is less than in the width of first viewing area, first viewing area after compression
When also there is the region of remaining non-display image, or after compression second video picture traverse less than second viewing area
When also there is the region of remaining non-display image in the width in domain, second viewing area, the mobile terminal by after compression should
The image of first video Right Aligns in first viewing area shows, by the image of second video after compression this second
Left-justify is shown in viewing area so that first video is connected with the image of second video and on the on-screen display (osd) area
It is shown centered on, the zone leveling of the non-display image of the residue is distributed in the left and right sides of the on-screen display (osd) area, and with the back of the body
Scenery is filled.
Referring to Fig. 2 d, the picture traverse of first video is less than the width of first viewing area after compression, and this second is regarded
The picture traverse of frequency, which is less than in the width of second viewing area, first viewing area and second viewing area, has residue
The region of non-display image, if directly displayed, display effect as shown in Figure 2 d, in the middle of first video and second video
There is gap, unsightly, then Right Aligns is shown in first viewing area by the image of first video after compression at interface,
By the image of second video after compression, left-justify is shown in second viewing area so that first video with this second
The image of video is connected and entirety is shown centered on, and display effect is as shown in Figure 2 e.
It should be noted that the embodiment of the present invention in first viewing area to play first video, second show at this
Show that region is illustrated exemplified by playing second video.And in actual application, first viewing area can be preset
The main view frequency that domain is used to show in two videos to be played, second viewing area is used to show in two videos to be played
Secondary video, then the mobile terminal is according to the selection of user, determines main view frequency in first video and second video and secondary
After video, main view frequency is shown on first viewing area, secondary video is shown on second viewing area.
207th, capture the attitudes vibration of the mobile terminal, when the mobile terminal from transverse screen state change be portrait layout state when,
Perform step 208.
As user is during using the mobile terminal, holds the mobile terminal or place the shape of the mobile terminal
When state changes, the attitudes vibration of the mobile terminal can be caused, and when the biography for the sensor output for being configured at the mobile terminal
When sensor information changes, the attitudes vibration of the mobile terminal can be captured.
208th, the on-screen display (osd) area is divided into the 3rd viewing area and information by the mobile terminal according to preset ratio
Viewing area.
When the mobile terminal posture is in transverse screen state, the mobile terminal vertically plays first video and this second is regarded
Frequently.And in order to avoid omitting the information beyond the video that first channel and second channel are provided, the screen can be shown
Show that region is reclassified as the 3rd viewing area and information display area.Wherein, the information display area be used to playing this
The comment information of user's issue in information beyond one video and second video, such as first channel or second channel,
User passes to virtual present data message of the publisher of first video etc., and the embodiment of the present invention is not limited this.
Alternatively, the preset ratio is used to determine the ratio between the 3rd viewing area and the height of the information display area
Example.3rd viewing area is located above the information display area, the width of the 3rd viewing area and the information display area
It is equal with the width of the on-screen display (osd) area, the ratio between the height of the 3rd viewing area and the height of the information display area
Example is equal to the preset ratio.
Using the preset ratio as 1:Exemplified by 1, referring to Fig. 2 f, the mobile terminal is according to the preset ratio by the screen display area
Domain is equally divided into the 3rd viewing area and the information display area.
Still optionally further, when the mobile terminal switches to portrait layout state from transverse screen state, Merge can be passed through
Video(Merge video)The channel viewing area is repartitioned, first viewing area, which is located at, from the on-screen display (osd) area is somebody's turn to do
The 3rd viewing area is switched to be located above the information display area on the left of second viewing area.
209th, the predeterminable area in the 3rd viewing area is defined as the 4th viewing area by the mobile terminal.
In order to improve the utilization rate of the on-screen display (osd) area, when the mobile terminal posture is in portrait layout state, by this
Predeterminable area in three viewing areas is defined as the 4th viewing area.Wherein, the predeterminable area can be the 3rd viewing area
The lower left corner, the lower right corner, the upper left corner or the upper right corner in domain, the height and width of the predeterminable area can be preset, the present invention
Embodiment is not limited this.Alternatively, the width of the predeterminable area is more than 1/3rd of the screen width, and the preset areas
The width in domain is less than 1/2nd of the screen width.Still optionally further, the area of the predeterminable area be less than or equal to this
The a quarter of three viewing area areas.
Further, when the multiple videos of the mobile terminal playing, it can choose multiple pre- in the 3rd viewing area
If region, the plurality of predeterminable area is used to play multiple videos beyond first video.Such as, the mobile terminal is to the video flowing
When decoding obtains 5 videos, the 3rd viewing area is determined, and in the upper left corner, the lower right corner, the upper left corner of the 3rd viewing area
And the upper right corner determines the 4th viewing area respectively, then the mobile terminal can play wherein one in the 3rd viewing area
Individual video, it is determined that 4 the 4th viewing areas in play remaining 4 video respectively.
210th, the mobile terminal plays first video in the 3rd viewing area, played in the 4th viewing area this
Two videos, second video is covered in the first video in the 4th viewing area.
In embodiments of the present invention, the mobile terminal can draw first video in the bottom of the 3rd viewing area,
Top layer in the 4th viewing area draws second video, then the mobile terminal is played this in the 3rd viewing area and first regarded
Frequently, when playing second video in second viewing area, what second video was covered in the 4th viewing area first regards
Frequently.
Referring to Fig. 2 f, the 4th viewing area is located at the lower left corner of the 3rd viewing area, and the 4th viewing area is played
Play first video in region in second video, the 3rd viewing area in addition to the 4th viewing area.
Comprise the following steps in addition, the mobile terminal plays first video in the 3rd viewing area(2101)-
(2104):
(2101)The mobile terminal carries out level specific pressure contracting according to screen width to first video height and picture traverse,
So that the picture traverse of first video is equal with the screen width of the mobile terminal after compression, first video after compression is obtained
Picture traverse.
(2102)The mobile terminal judges whether the picture altitude of first video after compression is more than the 3rd viewing area
Height.
(2103)The picture altitude of first video is more than the 3rd viewing area after the mobile terminal determines to compress
During height, according to the height of the 3rd viewing area, the both sides up and down of the first video after compression are cut so that cut
The picture altitude of first video is equal to the height of the 3rd viewing area afterwards, and the after cutting is played in the 3rd viewing area
One video.
(2104)The picture altitude of first video is not more than the 3rd viewing area after the mobile terminal determines to compress
Height when, the 3rd viewing area play compression after the first video.
The mobile terminal is played second video in the 4th viewing area and comprised the following steps(2105)-(2108):
(2105)The mobile terminal carries out level specific pressure contracting according to screen width to second video height and picture traverse,
So that the picture traverse of second video is equal with the screen width of the mobile terminal after compression, second video after compression is obtained
Picture traverse.
(2106)The mobile terminal judges whether the picture altitude of second video after compression is more than the 4th viewing area
Height.
(2107)The picture altitude of second video is more than the 4th viewing area after the mobile terminal determines to compress
During height, according to the height of the 4th viewing area, the both sides up and down of the second video after compression are cut so that cut
The picture altitude of second video is equal to the height of the 4th viewing area afterwards, and the after cutting is shown in the 4th viewing area
Two videos.
(2108)The picture altitude of second video is not more than the 4th viewing area after the mobile terminal determines to compress
Height when, the 4th viewing area play compression after the second video.
Being played when the posture of the mobile terminal is in portrait layout state in first viewing area and second viewing area should
When the process of first video and second video and the posture of the mobile terminal are in transverse screen state in the 3rd viewing area and
It is similar with the process of second video that first video is played in 4th viewing area, will not be repeated here.
211st, when the mobile terminal detects the clicking operation to the 4th viewing area, broadcast in the 3rd viewing area
Second video is put, first video is played in the 4th viewing area.
In the embodiment of the present invention, when the mobile terminal posture is in portrait layout state, main view is shown in the 3rd viewing area
Frequently, secondary video is shown in the 4th viewing area, the area of the 3rd viewing area is more than the area of the 4th viewing area.
The embodiment of the present invention is so that first video is main video as an example, when user wishes second video switching to main view
During frequency, the 4th viewing area is clicked on, will when the mobile terminal detects user to the clicking operation of the 4th viewing area
Second video switches to main view frequency, and first video is switched into secondary video, and this is played in the 3rd viewing area and second is regarded
Frequently, first video is played in the 4th viewing area.
Alternatively, the mobile terminal passes through Switch Video(Switch Video)Switch main view frequency and secondary video, this
Second video is played in three viewing areas, and first video is played in the 4th viewing area.
Due to the area very little of the 4th viewing area, when user clicks on four viewing areas, the finger of user
Contact may be on the boundary line of the 3rd viewing area and the 4th viewing area, i.e. the corresponding click on area of the clicking operation
Intersect with the boundary line of the 3rd viewing area and the 4th viewing area, then in order to prevent maloperation, the acquisition for mobile terminal
Ratio between the click on area and the overlapping region and the click on area of the 4th viewing area, judges whether the ratio exceedes
Predetermined threshold value, when the ratio exceedes the predetermined threshold value, the mobile terminal determines to detect the click to the 4th viewing area
Operation.Alternatively, the predetermined threshold value is 80%.
The embodiment of the present invention is switched over being detected when the mobile terminal during clicking operation to the 4th viewing area
Exemplified by, actually the mobile terminal can also be switched over when detecting the clicking operation to the 3rd viewing area, at this
Second video is played in 3rd viewing area, and first video is played in the 4th viewing area.Certainly, the mobile terminal posture
During in transverse screen state, it can also detect to the clicking operation of first viewing area or to second viewing area
Switched over during clicking operation, the embodiment of the present invention is not limited this.
It should be noted that after the step 211, the mobile terminal continues to capture the change of posture, when detecting this
Mobile terminal from portrait layout state switch to transverse screen state when, perform step 205.Alternatively, the mobile terminal is cut from portrait layout state
When being changed to transverse screen state, pass through Split Video(Divide video)The channel viewing area is repartitioned, from the screen display area
The 3rd viewing area, which is located above the information display area, in domain switches to first viewing area to be located at second viewing area
On the left of domain.
In embodiments of the present invention, when the posture of the mobile terminal is in transverse screen state and portrait layout state, using difference
Method divide viewing area, then this can be moved while watching first video and during second video when user wishes
Terminal is placed as transverse screen state so that the mobile terminal by the on-screen display (osd) area be divided into first viewing area and this second
Viewing area.And when user wishes to browse the information such as the comment message in channel, the mobile terminal can be placed as portrait layout
State so that the on-screen display (osd) area is divided into the 3rd viewing area and the information display area by the mobile terminal, by this
Predeterminable area in 3rd viewing area is defined as the 4th viewing area.First video is played in the 3rd viewing area,
During second video is played in 4th viewing area, when user is wished second video as main view frequency, click on
4th viewing area can be switched over, and second video is played in the 3rd viewing area, be broadcast in the 4th viewing area
First video is put, flexibility is strong, simple and efficient to handle.
Method provided in an embodiment of the present invention, by needing the first video of display and during the second video when the mobile terminal,
According to the corresponding relation between mobile terminal posture and viewing area, the display corresponding to the current posture of the mobile terminal is determined
Region so that mobile terminal can change the viewing area of video according to the change of posture, realize multiple video display areas
Flexible display, improve flexibility.Further, when the mobile terminal posture is in transverse screen state by the screen display area
Domain is divided into first viewing area and second viewing area, when the mobile terminal posture is in portrait layout state by the screen
Viewing area is divided into the 3rd viewing area and information display area, and the predeterminable area in the 3rd viewing area is determined
For the 4th viewing area, while information omission is avoided, the utilization rate of on-screen display (osd) area is improved.
Fig. 3 is a kind of video play device structural representation provided in an embodiment of the present invention, and referring to Fig. 3, the device includes:
Request sending module 301, for when receiving many video playback instructions, sending many video playbacks to server please
Ask, many video playbacks request carries multiple channel identications to be played so that the server returns to video flowing, the video flowing by
The corresponding Video coding of the plurality of channel identication is obtained;
Decoder module 302 is connected with request sending module 301, for when receiving the video flowing, being flowed into the video
Row decoding, obtains multiple videos;
Viewing area determining module 303 is connected with decoder module 302, for according to mobile terminal posture and viewing area it
Between corresponding relation, determine multiple viewing areas corresponding to the current posture of the mobile terminal;
Playing module 304 is connected with decoder module 302 and viewing area determining module 303 respectively, for the plurality of aobvious
Show and play the plurality of video in region respectively.
Alternatively, the viewing area determining module 303 includes:
First division unit, for being in transverse screen when obtaining two videos and the mobile terminal posture to the decoding video stream
During state, the on-screen display (osd) area of the mobile terminal is divided into the first viewing area and the second viewing area;This first show
Show in region and second viewing area and show two videos respectively;
Second division unit, for being in portrait layout when obtaining two videos and the mobile terminal posture to the decoding video stream
During state, according to preset ratio, the on-screen display (osd) area of the mobile terminal is divided into the 3rd viewing area and information display area
Domain, the information display area is used to show information beyond video, and the predeterminable area in the 3rd viewing area is defined as into the
Four viewing areas;Two videos are shown respectively in the 3rd viewing area and the 4th viewing area.
Alternatively, first division unit includes:
Width obtains subelement, for being in horizontal stroke when obtaining two videos and the mobile terminal posture to the decoding video stream
During screen state, the picture traverse of the first video and the second video in two videos is obtained;
Ratio computation subunit, for calculating between the picture traverse of first video and the picture traverse of second video
Ratio;
Region division subelement, first shows for the on-screen display (osd) area of the mobile terminal to be divided into this according to the ratio
Show region and second viewing area so that the ratio of the width of the width of first viewing area and second viewing area with
This is in equal proportions, and first viewing area is equal with the height of second viewing area and the screen height of the mobile terminal.
Alternatively, the width, which obtains subelement, is used for the screen height according to the mobile terminal, to first video and this
The picture altitude and picture traverse of second video carry out level specific pressure contracting so that the figure of first video and second video after compression
Image height degree is equal with the screen height of the mobile terminal;Obtain the picture traverse of first video after compression;Obtaining should after compression
The picture traverse of second video.
Alternatively, the playing module 304 includes:
First judging unit, for judging whether the picture traverse of first video after compression is more than first viewing area
Width;
First broadcast unit, the picture traverse for first video after compression is more than the width of first viewing area
When, according to the width of first viewing area, the left and right sides of first video after compression is cut so that should after cutting
The picture traverse of first video is equal to the width of first viewing area, and first after cutting is played in first viewing area and is regarded
Frequently;Or, first broadcast unit be additionally operable to when compression after first video picture traverse be not more than first viewing area
During width, the first video after playing compression in first viewing area;
Second judging unit, for judging whether the picture traverse of second video after compression is more than second viewing area
Width;
Second broadcast unit, the picture traverse for second video after compression is more than the width of second viewing area
When, according to the width of second viewing area, the left and right sides of second video after compression is cut so that this second is regarded
Width after frequency cutting is equal to the width of second viewing area, and the second video after cutting is played in second viewing area;
Or, second broadcast unit is additionally operable to the picture traverse of second video after compression and is not more than the width of second viewing area
When, the second video after playing compression in second viewing area.
Alternatively, the device also includes:
First switching playing module, for when detecting the clicking operation to second viewing area, first shows at this
Show that second video is played in region, first video is played in second viewing area;Or,
Second switching playing module, it is aobvious the 3rd for when detecting the clicking operation to the 4th viewing area
Show that second video is played in region, first video is played in the 4th viewing area.
Device provided in an embodiment of the present invention, by when the mobile terminal needs to show multiple videos, according to mobile whole
The corresponding relation between posture and viewing area is held, multiple viewing areas corresponding to the current posture of the mobile terminal are determined,
Enable mobile terminal to change the viewing area of video according to the change of posture, realize the flexible of multiple video display areas
It has been shown that, improves flexibility.
It should be noted that:The video play device that above-described embodiment is provided is when playing video, only with above-mentioned each function
The division progress of module is for example, in practical application, as needed can distribute above-mentioned functions by different function moulds
Block is completed, i.e., the internal structure of mobile terminal is divided into different functional modules, to complete whole described above or portion
Divide function.In addition, the video play device that above-described embodiment is provided belongs to same design with video broadcasting method embodiment, it has
Body implementation process refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.