Summary of the invention
This application provides a kind of video broadcasting method, device and computer readable storage mediums, can solve related skill
The problem of successfully video can not be redirected in art.The technical solution is as follows:
In a first aspect, a kind of video broadcasting method is provided, applied to the virtual machine installed in virtual desktop server, institute
The method of stating includes:
When receiving the access instruction of target webpage of terminal transmission, the target webpage is sent to web page server
Web-page requests;Receive the webpage information for the target webpage that the web page server is sent;Exist when in the target webpage
When video, the video identifier of the video is obtained from the webpage information;According to the video identifier of the video, described in generation
The page address of video;Floating frame (iframe) label is constructed, and sets the iframe label for the page address
Src attribute value;The iframe label is sent to the terminal, institute is obtained according to the iframe label by the terminal
It states video and plays.
It should be noted that the page address of the video can indicate the position of the page where the video, i.e. basis should
The available page to where the video in the page address of video, playing in the page has the video.In addition, in the page also
It may include having for playing the player of the video in target webpage, the video is the broadcasting for including in the page at this time
It is played in the forms of device.
In addition, iframe label is for creating the inline frame comprising another document.Iframe label has multiple
Attribute, wherein the src attribute value of iframe label is the address of document of document to be shown.
In the embodiment of the present application, due to the virtual machine be according to the video identifier of the video building iframe label simultaneously
It is sent to terminal, so terminal, which can successfully get broadcasting according to the src attribute value of the iframe label received, to be had
The page of the video, so as to successfully realize the redirection to the video.
Wherein, described when, there are when video, the view of the video being obtained from the webpage information in the target webpage
Frequency marking is known, comprising: when there are with when video, obtaining the video of the video from the webpage information in the target webpage
Location;When the video address is unsatisfactory for preset condition, the video identifier of the video is obtained from the webpage information.
Further, when the video address meets the preset condition, the video address is sent to the end
End is obtained the video according to the video address by the terminal and is played.
It should be noted that the video address of the video can indicate the position of the video, i.e., according to the video of the video
The available video in address.
In addition, preset condition can be configured in advance, and preset condition is for judging to obtain from webpage information
Video address whether be true address condition, be for judging whether according to the video address that obtains from webpage information
Enough conditions for successfully getting video.
In the embodiment of the present application, when the video address is unsatisfactory for preset condition, it is true for showing the video address not
Address, the video identifier of the available video of the virtual machine at this time, to accordingly generate the page address of the video.And work as the view
When frequency address meets preset condition, show that the video address is true address, the virtual machine can send out the video address at this time
Terminal is given, so that terminal directly acquires the video according to the video address and plays.
Further, described when, there are when video, the video being obtained from the webpage information in the target webpage
Video address before, further includes: when, there are when video label, determining and exist in the target webpage in the webpage information
Video.Correspondingly, described when, there are when video, the video of the video being obtained from the webpage information in the target webpage
Address, comprising: when there are when video label, obtain the src attribute value of the video label as institute in the webpage information
State the video address of video.
It should be noted that video label for defining video, such as defines vidclip or other video flowings.Video mark
Label have multiple attributes, and wherein the src attribute value of video label is the video address for the video to be played.
In the embodiment of the present application, which can quickly judge target webpage according to the presence or absence of video label
In whether there is video, and when in target webpage there are when video, can be according in video label quick obtaining target webpage
Video, so as to improve the speed of video redirection.
Further, described when the video address is unsatisfactory for preset condition, from the webpage information described in acquisition
Before the video identifier of video, further includes: when in the video address not including preset characters string, determine the video address
It is unsatisfactory for the preset condition.When the video address includes preset characters string, determine that the video address meets default item
Part.
Wherein, when whether judging in the video address including preset characters string, it can be determined that after the video address
Whether be preset characters string, when the suffix of the video address is not preset characters string, determine that the video address is discontented if sewing
Sufficient preset condition determines that the video address meets preset condition when the suffix of the video address is preset characters string.
Wherein, the video identifier according to the video, generates the page address of the video, comprising: described in acquisition
The corresponding building rule of target webpage;Obtain the multiple building elements indicated in the building rule, the multiple building element
In one building element be the video video identifier;The multiple building element is subjected to group according to the building rule
It closes, obtains the page address of the video.
It should be noted that the corresponding building rule of target webpage is the page address of the video in building target webpage
Rule.
In addition, page address institute of the multiple building elements indicated in building rule for the video in building target webpage
The multiple information needed.
It is worth noting that, when the virtual machine successfully get the corresponding building of target webpage it is regular when, show target network
Page supports the sharing of the page address of video, can generate the page address of the video according to the building rule at this time.When the void
Quasi- machine have not been obtained the corresponding building of target webpage it is regular when, show that target webpage does not support the sharing of the page address of video,
It at this time can be with end operation.
Further, the method also includes: obtain the window parameter of the video, the window parameter includes window position
It sets, window size and block information;The window parameter is sent to the terminal, by the terminal according to the window parameter
Show video window, the video window is for playing the video.
In the embodiment of the present application, which timing or can obtain in real time the window parameter of the video, once discovery
The window parameter of the video changes, just to terminal send variation after window parameter, so as to terminal can be according to variation after
Window parameter quickly adjust the video window for playing the video.
Further, the method also includes: receive the log-on message that the web page server sends;The login is believed
Breath is sent to the terminal, and the log-on message is used to obtain the access authority of the video.
It should be noted that log-on message is used to obtain the access authority of the video, log-on message is that the virtual machine is being visited
Ask that the used information for being used to distinguish user identity, the usually virtual machine are accessing web service for the first time when web page server
It is generated and sent by web page server to the virtual machine when device.In practical application, in order to guarantee the safety of the log-on message,
First the log-on message can be encrypted, then the encrypted log-on message is sent to terminal.
In the embodiment of the present application, which can be sent to log-on message terminal, this can be used in terminal at this time
Log-on message obtains video from web page server, thereby may be ensured that there is terminal enough permissions to access web page server
Video is obtained, and then the success rate of video redirection can be improved.
Second aspect provides a kind of video broadcasting method, is applied to terminal, which comprises
The virtual machine installed into virtual desktop server sends the access instruction of target webpage;Receive the virtual machine hair
The iframe label sent, the src attribute value of the iframe label are the page address of video present in the target webpage,
The page address is to generate to obtain according to the video identifier of the video, and the video identifier of the video is from the target network
It is acquired in the webpage information of page;According to the iframe label, obtains the video and play.
In the embodiment of the present application, the virtual machine that terminal is installed into virtual desktop server sends the access of target webpage
Instruction.Then terminal receives the iframe label of virtual machine transmission, and the src attribute value of the iframe label is in target webpage
The page address of existing video, the page address are to generate to obtain according to the video identifier of the video, the video mark of the video
Knowledge is acquired from the webpage information of target webpage.Later, terminal obtains the video according to the iframe label and plays.
Since the embodiment of the present application is the iframe label constructed according to the video identifier of the video, so terminal is marked according to the iframe
The src attribute value of label can successfully get the page for playing and having the video, reset so as to successfully realize to the video
To.
Further, the virtual machine installed into virtual desktop server send target webpage access instruction it
Afterwards, further includes: receive the video address for the video that the virtual machine is sent, the video address is from the target webpage
Webpage information in acquire;According to the video address, obtains the video and play.
In the embodiment of the present application, terminal can not only obtain video and be played according to the iframe label received,
Video can also be obtained according to the video address received and is played, to improve the flexibility of video acquisition, Jin Erti
The success rate that high video redirects.
Further, the virtual machine installed into virtual desktop server send target webpage access instruction it
Afterwards, further includes: receive the window parameter for the video that the virtual machine is sent, the window parameter includes the window's position, window
Mouth size and block information;Video window is shown according to the window parameter.It is correspondingly, described to obtain the video and play,
It include: to obtain the video, and the video is played in the video window.
Wherein, when terminal shows video window according to the window parameter, which can be dimensioned to this
The video window is shown the window's position in the window parameter, and is joined according to the window by the window size in window parameter
Block information in number determines the part being blocked in the video window, sets the part being blocked in the video window to
Bright state.
Further, the virtual machine installed into virtual desktop server send target webpage access instruction it
Afterwards, further includes: receive the log-on message that the virtual machine is sent, the log-on message is used to obtain the access right of the video
Limit;Correspondingly, described according to the iframe label, it obtains the video and plays, comprising: generation carries the iframe
The page access request of the src attribute value of label, src of the page access request for iframe label described in request
The page that attribute value is directed toward, playing in the page has the video;To web page server send the page access request and
The log-on message;When receiving the page info for the page that the web page server is sent, according to the page
Page info shows the page.
In the embodiment of the present application, when terminal receives the log-on message of virtual machine transmission, login letter can be used
Breath obtains video from web page server, thereby may be ensured that there is terminal enough permissions access web page server to obtain view
Frequently, and then the success rate that video redirects can be improved.Also, for the safety for guaranteeing the log-on message, the log-on message
Encrypted transmission can be used, and uses the log-on message after obtaining video in web page server in terminal, terminal can delete
The log-on message.
The third aspect provides a kind of video play device, and the video play device, which has, realizes above-mentioned first aspect
The function of middle video broadcasting method behavior.The video play device includes at least one module, at least one described module is used
The video broadcasting method provided by the above-mentioned first aspect of realization.
Fourth aspect provides a kind of video play device, and the video play device, which has, realizes above-mentioned second aspect
The function of middle video broadcasting method behavior.The video play device includes at least one module, at least one described module is used
The video broadcasting method provided by the above-mentioned second aspect of realization.
5th aspect, provides a kind of video play device, include in the structure of the video play device processor and
Memory, the memory support video play device to execute video broadcasting method provided by above-mentioned first aspect for storing
Program, and storage for realizing data involved in video broadcasting method described in above-mentioned first aspect.The processor
It is configurable for executing the program stored in the memory.The video play device can also include communication bus, institute
Communication bus is stated for establishing connection between the processor and the memory.
6th aspect, provides a kind of video play device, include in the structure of the video play device processor and
Memory, the memory support video play device to execute video broadcasting method provided by above-mentioned second aspect for storing
Program, and storage for realizing data involved in video broadcasting method described in above-mentioned second aspect.The processor
It is configurable for executing the program stored in the memory.The video play device can also include communication bus, institute
Communication bus is stated for establishing connection between the processor and the memory.
7th aspect, provides a kind of computer readable storage medium, is stored in the computer readable storage medium
Instruction, when run on a computer, so that computer executes video broadcasting method described in above-mentioned first aspect.
Eighth aspect provides a kind of computer readable storage medium, is stored in the computer readable storage medium
Instruction, when run on a computer, so that computer executes video broadcasting method described in above-mentioned second aspect.
9th aspect, provides a kind of computer program product comprising instruction, when run on a computer, so that
Computer executes video broadcasting method described in above-mentioned first aspect.
Tenth aspect, provides a kind of computer program product comprising instruction, when run on a computer, so that
Computer executes video broadcasting method described in above-mentioned second aspect.
The above-mentioned third aspect, the 5th aspect, the 7th aspect and the 9th aspect technical effect obtained and above-mentioned first party
The technical effect that corresponding technological means obtains in face is approximate, repeats no more herein.
Above-mentioned fourth aspect, the 6th aspect, eighth aspect and the tenth aspect technical effect obtained and above-mentioned second party
The technical effect that corresponding technological means obtains in face is approximate, repeats no more herein.
Technical solution provided by the present application can at least be brought following the utility model has the advantages that installing in the virtual desktop server
When virtual machine receives the access instruction of the target webpage of terminal transmission, the webpage for sending target webpage to web page server is asked
It asks.Later, which receives the webpage information for the target webpage that web page server is sent, when there are videos in target webpage
When, the video identifier of the video is obtained from the webpage information of target webpage, further according to the video identifier of the video, generates the view
Then the page address of frequency constructs iframe label, and the src that the page address of the video is set as the iframe label is belonged to
Property value.Later, which is sent to terminal for the iframe label, obtains the video simultaneously according to the iframe label by terminal
It plays.Since the embodiment of the present application is the iframe label constructed according to the video identifier of the video, so terminal is according to this
The src attribute value of iframe label can successfully get the page for playing and having the video, so as to successfully realize to the view
The redirection of frequency.
Specific embodiment
Implementation to keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application
Mode is described in further detail.
Before to the embodiment of the present application carrying out that explanation is explained in detail, to the invention relates to application scenarios and
System architecture is explained.
Firstly, the application scenarios to the embodiment of the present application are illustrated.
Virtual desktop is a kind of typical cloud computing application, and the remote computer table of deployment beyond the clouds can be provided for user
Face service, specifically turns to more virtual machines for server virtual using virtualization technology, and runs and use in each virtual machine
Operating system needed for family and application software, user can log in virtual machine in terminal and access resources of virtual machine.Due to virtual
All business are handled in virtual machine in desktop, so virtual desktop is at every moment all in the money for consuming server
Video playing in source, especially virtual desktop is quite big to the resource consumption of server, it is more likely that will affect server
Performance, therefore, redirecting to video has great significance for the experience for promoting virtual desktop.The embodiment of the present application is just
It is redirected in scene applied to the video under virtual desktop.
Secondly, the system architecture to the embodiment of the present application is illustrated.
Fig. 1 is a kind of structural schematic diagram of virtual desktop system provided by the embodiments of the present application.Referring to Fig. 1, the virtual table
Plane system includes: virtual desktop server 110 and terminal 120.It can pass through between virtual desktop server 110 and terminal 120
Desktop protocol is communicated, which can be Remote Desktop Protocol (Remote Desktop Protocol, RDP) etc.,
The embodiment of the present application is not construed as limiting this.
Virtual desktop server 110 can provide the software runtime environment and virtual machine control platform of virtual machine, virtual machine
For providing virtual desktop environment, virtual desktop serve can be installed to handle the operation system of client and virtual machine in virtual machine
Interacting message between system, and the message of the operating system is received desktop is presented.Virtual desktop server 110 can be one
Server, or the server cluster of multiple server compositions, the embodiment of the present application are not construed as limiting this.
The virtual desktop environment that virtual machine in the accessible virtual desktop server 110 of terminal 120 provides, terminal 120
In client can be installed to receive and handle desktop protocol message.Terminal 120 can be personal computer (personal
Computer, PC), thin client (thin client, TC), Android (Android) system equipment, ios system equipment etc., this
Application embodiment is not construed as limiting this.
Wherein, virtual machine 111 is installed in virtual desktop server 110, can be equipped in virtual machine 111 browser and
Browser plug-in.Browser can call browser plug-in to carry out video redirection, specifically, browse when opening webpage
Device plug-in unit can first judge with the presence or absence of video in the webpage, if there are videos in the webpage, believe from the webpage of the webpage
The video identifier of the video is obtained in breath, and generates the page address of the video according to the video identifier of the video, by the page
Face address is sent to terminal 120.
Wherein, client 121 and browser engine 122 are installed in terminal 120.Client 121 receives virtual desktop
When the page address that the virtual machine 111 installed in server 110 is sent, browser engine 122 can be called to obtain video, had
Body, browser engine 122 can obtain the page and be shown according to the page address, which wherein plays after showing view
Frequently.In addition, can also include output equipment (such as display) in terminal 120, showing desktop contents, and can wrap
Input equipment (such as mouse, keyboard) is included, to carry out user's input.
Fig. 2 is a kind of structural schematic diagram of computer equipment provided by the embodiments of the present application, which can be
Virtual desktop server 110 or terminal 120 shown in Fig. 1.Referring to fig. 2, which includes at least one processor
201, communication bus 202, memory 203 and at least one communication interface 204.
Processor 201 can be general central processor (Central Processing Unit, CPU), micro process
Device, application-specific integrated circuit (application-specific integrated circuit, ASIC), or can be
One or more is for controlling the integrated circuit of application scheme program execution.
Communication bus 202 may include an access, for transmitting information between said modules.
Memory 203 can be read-only memory (read-only memory, ROM) or can store static information and instruction
Other types of static storage device, be also possible to random access memory (random access memory, RAM) or
The other types of dynamic memory that information and instruction can be stored, is also possible to Electrically Erasable Programmable Read-Only Memory
(Electrically Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact
Disc Read-Only Memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, light
Dish, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium perhaps other magnetic storage apparatus or can be used for carrying
Storage have instruction or data structure form desired program code and can by any other medium of computer access,
But not limited to this.Memory 203, which can be, to be individually present, and is connected by communication bus 202 with processor 201.Memory
203 can also integrate with processor 201.
Communication interface 204 using any transceiver one kind device, be used for other equipment or communication, such as with
Too net, wireless access network (Radio Access Network, RAN), WLAN (Wireless Local Area
Networks, WLAN) etc..
In the concrete realization, as one embodiment, processor 201 may include one or more CPU, such as institute in Fig. 2
The CPU0 and CPU1 shown.
In the concrete realization, as one embodiment, computer equipment may include multiple processors, as shown in Figure 2
Processor 201 and processor 205.Each of these processors can be a single core processor (single-CPU),
It is also possible to a multi-core processor (multi-CPU).Here processor can refer to one or more equipment, circuit, and/or
For handling the processing core of data (such as computer program instructions).
In the concrete realization, as one embodiment, computer equipment can also include output equipment 206 and input equipment
207.Output equipment 206 and processor 201 communicate, and can show information in many ways.For example, output equipment 206 can be with
It is liquid crystal display (liquid crystal display, LCD), Light-Emitting Diode (light emitting diode, LED)
Show that equipment, cathode-ray tube (cathode ray tube, CRT) show equipment or projector (projector) etc..Input is set
It is communicated for 207 and processor 201, the input of user can be received in many ways.For example, input equipment 207 can be mouse,
Keyboard, touch panel device or sensing equipment etc..
Above-mentioned computer equipment can be a general purpose computing device or a dedicated computing machine equipment.Specific real
In existing, computer equipment can be desktop computer, portable computer, network server, palm PC (Personal Digital
Assistant, PDA), cell phone, tablet computer, wireless terminal device, communication equipment or embedded device, the application implemented
The unlimited type for determining computer equipment of example.
Wherein, memory 203 is used to store the program code 210 for executing application scheme, and processor 201 is deposited for executing
The program code 210 stored in reservoir 203.The computer equipment can pass through the program in processor 201 and memory 203
Code 210, to realize the video broadcasting method of following FIG. 3 embodiment offer.
It is worth noting that, terminal can be used first before executing video broadcasting method provided by the embodiments of the present application
Desktop protocol is connected to the virtual machine in virtual desktop server, and the virtual machine can provide virtual desktop ring at this time for terminal
Border can install browser and browser plug-in to realize video redirecting technique later in the virtual machine.Also, terminal
It can notify that the facility information of terminal, the facility information may include that terminal type (can be come with operating system to the virtual machine
Divide), whether support video redirect etc..It, can be by provided by the embodiments of the present application when terminal supports video redirects
Video broadcasting method come realize the video under virtual desktop redirect.
Fig. 3 is a kind of flow chart of video broadcasting method provided by the embodiments of the present application, and this method is applied to shown in FIG. 1
In virtual desktop system.Referring to Fig. 3, this method comprises:
Step 301: the virtual machine that terminal is installed into virtual desktop server sends the access instruction of target webpage.
It should be noted that step 301 can be by the client executing installed in terminal.
It in addition, target webpage can be html web page, such as can be HTML5 webpage, the embodiment of the present application does not make this
It limits.
Furthermore the access instruction of target webpage, which is used to indicate, accesses to target webpage, the access instruction of target webpage
It can be triggered by user, user can be triggered by operations such as mouse action, keyboard operations.
Step 302: when the virtual machine receives the access instruction of the target webpage of terminal transmission, being sent out to web page server
Send the web-page requests of target webpage.
It should be noted that step 302 can be executed by the browser installed in the virtual machine.
It can be in addition, the web-page requests of target webpage are used for request target webpage, in the web-page requests of target webpage
The web page address for carrying target webpage, can such as carry uniform resource locator (the Uniform Resource of target webpage
Locator, URL) etc..
Furthermore after web page server receives the web-page requests of target webpage, the webpage information of available target webpage
And the webpage information of target webpage is returned into the virtual machine.
Step 303: the virtual machine receives the webpage information for the target webpage that web page server is sent.
It should be noted that step 303 can be executed by the browser installed in the virtual machine.
In addition, the webpage information of target webpage includes the relevant information of all the elements in target webpage, such as may include
The relevant information of the contents such as text, picture, music in target webpage.
It is worth noting that, this is clear after the browser installed in the virtual machine gets the webpage information of target webpage
Device of looking at can call the browser plug-in installed in the virtual machine to carry out video redirection, specifically can be as follows
304- step 308 is realized.
Step 304: the virtual machine judges in target webpage with the presence or absence of video.
It should be noted that step 304 can be executed by the browser plug-in installed in the virtual machine.
Specifically, which may determine that in the webpage information of target webpage with the presence or absence of video label;Work as target network
There are when video label in the webpage information of page, determine that there are videos in target webpage;When in the webpage information of target webpage not
There are when video label, determine that there is no videos in target webpage.It is of course also possible to judge target webpage otherwise
In whether there is video, the embodiment of the present application is not construed as limiting this.
It should be noted that video label for defining video, such as defines vidclip or other video flowings.Video mark
Label have multiple attributes, and wherein the src attribute value of video label is the video address for the video to be played, and such as can be to broadcast
The URL for the video put.
Step 305: when, there are when video, which obtains the view from the webpage information of target webpage in target webpage
The video identifier of frequency.
It should be noted that step 305 can be executed by the browser plug-in installed in the virtual machine.
In addition, the video identifier of the video is used for the unique identification video, the video identifier of the video can be from target network
It obtains, can also be obtained from the web page code of target webpage, the embodiment of the present application is not construed as limiting this in the web page address of page.
Specifically, when, there are when video, which can be directly from the webpage information of target webpage in target webpage
Obtain the video identifier of the video;Alternatively, when, there are when video, which can be first from the net of target webpage in target webpage
Obtain the video address of the video in page information, then judge whether the video address meets preset condition, when the video address not
When meeting preset condition, the video identifier of the video is obtained from the webpage information of target webpage.
Further, when the video address meets preset condition, which can be sent to end for the video address
End.
It should be noted that the video address of the video can indicate the position of the video, i.e., according to the video of the video
The available video in address.
In addition, preset condition can be configured in advance, and preset condition is for judging to obtain from webpage information
Video address whether be true address condition, be for judging whether according to the video address that obtains from webpage information
Enough conditions for successfully getting video.
Furthermore when the video address is unsatisfactory for preset condition, show that the video address is not true address, it at this time can be with
The video identifier of the video is obtained, to accordingly generate the page address of the video.And when the video address meets preset condition,
Show that the video address is true address, the video address can be sent to terminal at this time, according to the video for terminal
Location directly acquires the video and plays.
Wherein, when, there are when video, which obtains the video from the webpage information of target webpage in target webpage
The operation of video address can be with are as follows: when, there are when video label, obtaining the video label in the webpage information of target webpage
Video address of the src attribute value as the video.
Wherein, the virtual machine judge whether the video address meets the operation of preset condition can be with are as follows: virtual machine judgement
It whether include preset characters string in the video address;When in the video address not including preset characters string, with determining the video
Location is unsatisfactory for preset condition;When the video address includes preset characters string, determine that the video address meets preset condition.
It should be noted that preset characters string can be configured in advance, if preset characters string can be video type, depending on
Frequency type may include Audio Video Interleaved (audio video interleaved, avi) type, Motion Picture Experts Group
(Motion Picture Experts Group, MPEG) 4 types etc..
In addition, when whether judging in the video address including preset characters string, after specifically may determine that the video address
Whether be preset characters string, when the suffix of the video address is not preset characters string, it is pre- to determine that the video address is unsatisfactory for if sewing
If condition, when the suffix of the video address is preset characters string, determine that the video address meets preset condition.
Step 306: the virtual machine generates the page address of the video according to the video identifier of the video.
It should be noted that step 306 can be executed by the browser plug-in installed in the virtual machine.
In addition, the page address of the video can indicate the position of the page where the video, i.e., according to the page of the video
The available page to where the video in face address, playing in the page has the video.In addition, can also include in the page
Have for playing the player of the video in target webpage, the video is the forms for the player for including in the page at this time
Middle broadcasting.
Specifically, the corresponding building rule of the available target webpage of the virtual machine;It obtains and is indicated in building rule
Multiple building elements, multiple building element constructed in element are the video identifier of the video;According to building rule
Multiple building element is combined, the page address of the video is obtained.It is of course also possible to according to the video mark of the video
Know, generates the page address of the video in other ways, the embodiment of the present application is not construed as limiting this.
It should be noted that the corresponding building rule of target webpage is the page address of the video in building target webpage
Rule.For example, the corresponding building rule of target webpage can be " domain name of place website/embed/ video identifier " etc..
In addition, page address institute of the multiple building elements indicated in building rule for the video in building target webpage
The multiple information needed.For example, when the building rule is " domain name of place website/embed/ video identifier ", building rule
The multiple building elements indicated are the video identifier of the domain name of website where target webpage, embed and the video.
It wherein, can be according to website where target webpage when the corresponding building of virtual machine acquisition target webpage is regular
Website logo obtains corresponding building rule and is used as mesh from the corresponding relationship between the website logo and building rule of storage
Mark the corresponding building rule of webpage.It is of course also possible to obtain the corresponding building rule of target webpage, the application otherwise
Embodiment is not construed as limiting this.
It should be noted that the website logo of website is used for the unique identification website, as the website logo of website can be
Title, domain name of the website etc., the embodiment of the present application is not construed as limiting this.
In addition, when successfully get the corresponding building of target webpage it is regular when, show that target webpage supports the page of video
The sharing of address can generate the page address of the video according to the building rule at this time.It is corresponding when target webpage has not been obtained
Building rule when, show that target webpage does not support the sharing of the page address of video, at this time can be with end operation.
Step 307: the virtual machine constructs iframe label, and sets the iframe label for the page address of the video
Src attribute value.
It should be noted that step 307 can be executed by the browser plug-in installed in the virtual machine.
In addition, iframe label is for creating the inline frame comprising another document.Iframe label has multiple
Attribute, wherein the src attribute value of iframe label is the address of document of document to be shown, as that can be document to be shown
URL。
Step 308: the iframe label is sent to terminal by the virtual machine.
It should be noted that step 308 can be executed by the browser plug-in installed in the virtual machine.
It is worth noting that, the virtual machine can not only construct iframe label and be sent to end in the embodiment of the present application
End, can also obtain the window parameter of the video, the window parameter of the video is sent to terminal.And the virtual machine may be used also
To receive the log-on message of web page server transmission, which is sent to terminal.
It should be noted that obtain the window parameter of the video and be sent to the operation of terminal can be by the void for the virtual machine
The browser plug-in installed in quasi- machine executes.The virtual machine receives the log-on message that web page server is sent and is sent to terminal
Operation can be executed by the browser installed in the virtual machine.
In addition, window parameter is the relevant parameter for playing the video window of the video, window parameter is used for the view
Frequency window is positioned, such as window parameter may include the window's position, window size and block information.It, should in practical application
Virtual machine timing or can obtain in real time the window parameter of the video, once find that the window parameter of the video changes, just
The window parameter after variation is sent to terminal.
Furthermore log-on message is used to obtain the access authority of the video, and log-on message is the virtual machine in access webpage clothes
Used for distinguishing the information of user identity when business device, usually the virtual machine when accessing web page server by net for the first time
Page server generates and sends to the virtual machine.The log-on message can be cookie (cookies) etc..Actually answer
In, in order to guarantee the safety of the log-on message, first the log-on message can be encrypted, then by the encrypted login
Information is sent to terminal.
It is worth noting that, the virtual machine is receiving the target webpage of web page server transmission in the embodiment of the present invention
Webpage information can not obtain the video in target webpage, according only to target webpage webpage information obtain target webpage in remove
Other web page contents and display except video.
Step 309: terminal receives the iframe label of virtual machine transmission.
It should be noted that step 309 can be by the client executing installed in terminal.
In addition, the src attribute value of the iframe label is the page address of video present in target webpage, the video
Page address is to generate to obtain according to the video identifier of the video, and the video identifier of the video is the webpage information from target webpage
In acquire.
Step 310: terminal obtains the video in target webpage and broadcasting according to the iframe label.
It should be noted that step 310 can be executed by the browser engine installed in terminal.
Specifically, the page access request for carrying the src attribute value of the iframe label, the page can be generated in terminal
Acquisition request is used for the page that the src attribute value of the request iframe label is directed toward, and playing in the page has target webpage
In video;The page access request is sent to web page server;When the page for the page for receiving web page server transmission
When the information of face, which is shown according to the page info of the page.
It is worth noting that after showing the page, with regard to playing the video having in target webpage in the page.Due to the page
In can also include for playing the player of the video in target webpage, and the video is that this for including is broadcast in the page
It puts and is played in the forms of device, so terminal can directly control the broadcasting of the video by the player in the page, this
In the case of kind, the video display effect after redirecting to the video is identical as the result of broadcast of original video.
Further, terminal may receive the iframe label of virtual machine transmission, it is also possible to receive the void
The video address for the video in target webpage that quasi- machine is sent, the video address of the video is from the webpage information of target webpage
It acquires.It, can be according to the view when the video address of the video in the target webpage that terminal receives virtual machine transmission
The video address of frequency obtains the video and plays.
It should be noted that the operation that terminal receives the video address of the video in the target webpage of virtual machine transmission can
With by the client executing installed in terminal, terminal obtains the video and play operation according to the video address of the video can be by
The browser engine of terminal installation executes.
In addition, terminal is receiving when the video address of the video is the src attribute value of the video label of target webpage
When the video address of the video in target webpage sent to the virtual machine, html web page can be first created, and by the HTML net
The src attribute value of the video label of page is set as the video address of the video, then can load in the webpage of the html web page
Hold, the web page contents for loading the html web page are to obtain the video according to the video address of the video and play.
Wherein, terminal can be generated when obtaining the video and playing according to the video address of the video and carry the video
Video address video acquisition request;Video acquisition request is sent to web page server;When receiving web page server
When the video data of the video sent, which is played according to the video data of the video.
It is worth noting that, terminal can also receive the window parameter of the video of virtual machine transmission, the window parameter
It may include the window's position, window size and block information etc..When terminal receives the window of the video of virtual machine transmission
When parameter, video window can be shown according to the window parameter.Later, terminal can be obtained first when obtaining the video and playing
The video is taken, then plays the video in the video window.
Wherein, when terminal shows video window according to the window parameter, which can be dimensioned to this
The video window is shown the window's position in the window parameter, and is joined according to the window by the window size in window parameter
Block information in number determines the part being blocked in the video window, sets the part being blocked in the video window to
Bright state.
Wherein, when terminal plays the video in the video window, if terminal is belonged to according to the src of the iframe label
Property the page info of the page that is directed toward of value show the page, then the page can be shown in the video window, if
The terminal is to play the video according to the video data of the video, then can play out the video in the video window.
It is worth noting that, terminal can also receive the log-on message of virtual machine transmission, the log-on message is for obtaining
The access authority of video.When terminal receives the log-on message of virtual machine transmission, the log-on message can be used from webpage
Video is obtained in server.Specifically, terminal is sending the page access request or video acquisition request to web page server
While, which can be also sent to web page server, to guarantee that terminal has enough permissions access webpage clothes
Device be engaged in obtain video.
In addition, the safety in order to guarantee the log-on message, which can use encrypted transmission, and make in terminal
With the log-on message after obtaining video in web page server, terminal can delete the log-on message.
It is worth noting that can be excavated as far as possible from the webpage information of target webpage in the embodiment of the present application effective
Information, accordingly come realize video redirect.After being redirected to video, it is possible to reduce the pressure of virtual desktop server,
Resource occupation is reduced, avoids influence of the video playing to the performance of virtual desktop server, and since terminal is directly from webpage
Video is obtained in server, it is possible to greatly reduce the transmission bandwidth from the virtual machine to terminal.Also, compared to related skill
Virtual machine will first be compressed the mode for being transferred to terminal again to video in art, and the embodiment of the present application can be to avoid compression to video
The influence of quality guarantees the result of broadcast of video.
Further, it is contemplated that the ability of terminal is limited, in order to avoid video playing causes excessive pressure to terminal, this
The number of videos of redirection can also be limited in application embodiment.Specifically, quantity can be less than in the number of videos of redirection
It when threshold value, is redirected to virtual machine notice terminal supports video, is greater than or equal to amount threshold in the number of videos of redirection
When, do not support video to redirect to virtual machine notice terminal.Wherein, amount threshold can be configured in advance.
Further, in order to enhance versatility, prevent terminal from video being caused to redirect failure because outer net cannot be connected, also
Proxy server can be increased, terminal can obtain video by proxy server from web page server.
In the embodiment of the present application, the virtual machine that terminal is installed into virtual desktop server sends the access of target webpage
Instruction sends target webpage to web page server when the virtual machine receives the access instruction of the target webpage of terminal transmission
Web-page requests.Later, which receives the webpage information for the target webpage that web page server is sent, when depositing in target webpage
In video, the video identifier of the video is obtained from the webpage information of target webpage, it is raw further according to the video identifier of the video
At the page address of the video, iframe label is then constructed, and set the iframe label for the page address of the video
Src attribute value.Later, which is sent to terminal for the iframe label.When terminal receives virtual machine transmission
When the iframe label, which is obtained according to the iframe label and is played.Since the embodiment of the present application is according to the video
Video identifier building iframe label, so terminal can successfully be got according to the src attribute value of the iframe label
The page for having the video is played, so as to successfully realize the redirection to the video.
Fig. 4 is a kind of structural schematic diagram of video play device provided by the embodiments of the present application, which is applied to virtual
The virtual machine installed in desktop server, the device can be set by being implemented in combination with for software, hardware or both as computer
Standby is some or all of, and when computer equipment shown in Fig. 2 is virtual desktop server, which can be figure
Computer equipment shown in 2.Referring to fig. 4, which includes: the first sending module 401, the acquisition of the first receiving module 402, first
Module 403, generation module 404, building module 405 and the second sending module 406.
First sending module 401, for executing the step 302 in Fig. 3 embodiment;
First receiving module 402, for executing the step 303 in Fig. 3 embodiment;
First obtains module 403, for executing the step 305 in Fig. 3 embodiment;
Generation module 404, for executing the step 306 in Fig. 3 embodiment;
Module 405 is constructed, for executing the step 307 in Fig. 3 embodiment;
Second sending module 406, for executing the step 308 in Fig. 3 embodiment.
Optionally, the first acquisition module 403 includes:
First acquisition unit, for when there are with when video, obtaining the video of video from webpage information in target webpage
Location;
Second acquisition unit, for obtaining the view of video from webpage information when video address is unsatisfactory for preset condition
Frequency marking is known.
Optionally, first module 403 is obtained further include:
First determination unit, for when there are when video video label, determine to have view in target webpage in webpage information
Frequently;
Correspondingly, first acquisition unit is used for:
When there are when video label, obtaining the src attribute value of video label in webpage information as the video of video
Location.
Optionally, first module 403 is obtained further include:
Second determination unit, for it is pre- to determine that video address is unsatisfactory for when in video address not including preset characters string
If condition.
Optionally, first module 403 is obtained further include:
Third sending module, for video address being sent to terminal, by terminal when video address meets preset condition
Video is obtained according to video address and is played.
Optionally, generation module 404 includes:
Third acquiring unit, for obtaining the corresponding building rule of target webpage;
4th acquiring unit, for obtaining the multiple building elements indicated in building rule, multiple one constructed in elements
A building element is the video identifier of video;
Assembled unit obtains the page address of video for being combined multiple building elements according to building rule.
Optionally, the device further include:
Second obtains module, and for obtaining the window parameter of video, window parameter includes the window's position, window size and screening
Keep off information;
4th sending module shows video window according to window parameter by terminal for window parameter to be sent to terminal,
Video window is for playing video.
Optionally, the device further include:
Second receiving module, for receiving the log-on message of web page server transmission;
5th sending module, for log-on message to be sent to terminal, log-on message is used to obtain the access authority of video.
In the embodiment of the present application, when the virtual machine installed in virtual desktop server receives the target network of terminal transmission
When the access instruction of page, the web-page requests of target webpage are sent to web page server.Later, which receives web page server
The webpage information of the target webpage of transmission, when, there are when video, obtaining from the webpage information of target webpage should in target webpage
The video identifier of video generates the page address of the video further according to the video identifier of the video, then constructs iframe mark
It signs, and sets the page address of the video to the src attribute value of the iframe label.Later, the virtual machine is by the iframe
Label is sent to terminal, is obtained the video according to the iframe label by terminal and is played.Since the embodiment of the present application is basis
The iframe label of the video identifier building of the video, so terminal can succeed according to the src attribute value of the iframe label
The page for playing and having the video is got, so as to successfully realize the redirection to the video.
Fig. 5 is a kind of structural schematic diagram of video play device provided by the embodiments of the present application, which is applied to terminal,
The device being implemented in combination with as some or all of of computer equipment by software, hardware or both, shown in Fig. 2
Computer equipment be terminal when, which can be computer equipment shown in Fig. 2.Referring to Fig. 5, the device packet
It includes: sending module 501, the first receiving module 502 and the first playing module 503.
Sending module 501, for executing the step 301 in Fig. 3 embodiment;
First receiving module 502, for executing the step 309 in Fig. 3 embodiment;
First playing module 503, for executing the step 310 in Fig. 3 embodiment.
Optionally, the device further include:
Second receiving module, the video address of the video for receiving virtual machine transmission, video address is from target webpage
Webpage information in acquire;
Second playing module, for obtaining video and playing according to video address.
Optionally, the device further include:
Third receiving module, for receive virtual machine transmission video window parameter, window parameter include the window's position,
Window size and block information;
Display module, for showing video window according to window parameter;
Correspondingly, the first playing module is used for:
Video is obtained, and plays video in video window.
Optionally, the device further include:
4th receiving module, for receiving the log-on message of virtual machine transmission, log-on message is used to obtain the access of video
Permission;
Correspondingly, the first playing module 503 includes:
Generation unit, for generating the page access request for carrying the src attribute value of iframe label, page acquisition is asked
The page of the src attribute value direction for request iframe label is sought, playing in the page has video;
Transmission unit, for sending page access request and log-on message to web page server;
Display unit, for when receive web page server transmission the page page info when, according to the page of the page
Information shows the page.
In the embodiment of the present application, the virtual machine that terminal is installed into virtual desktop server sends the access of target webpage
Instruction.Then terminal receives the iframe label of virtual machine transmission, and the src attribute value of the iframe label is in target webpage
The page address of existing video, the page address are to generate to obtain according to the video identifier of the video, the video mark of the video
Knowledge is acquired from the webpage information of target webpage.Later, terminal obtains the video according to the iframe label and plays.
Since the embodiment of the present application is the iframe label constructed according to the video identifier of the video, so terminal is marked according to the iframe
The src attribute value of label can successfully get the page for playing and having the video, reset so as to successfully realize to the video
To.
It should be understood that video play device provided by the above embodiment is in video playing, only with above-mentioned each function
The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds
Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above
Energy.In addition, video play device provided by the above embodiment and video broadcasting method embodiment belong to same design, it is specific real
Existing process is detailed in embodiment of the method, and which is not described herein again.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its any combination real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.It is all or part of when loading on computers and executing the computer instruction
Ground is generated according to process or function described in the embodiment of the present application.The computer can be general purpose computer, special purpose computer,
Computer network or other programmable devices.The computer instruction may be stored in a computer readable storage medium, or
It is transmitted from a computer readable storage medium to another computer readable storage medium, for example, the computer instruction can
With from a web-site, computer, server or data center by it is wired (such as: coaxial cable, optical fiber, data user
Line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave etc.) mode to another website
Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit
Any usable medium taken, or include the data storage such as one or more usable mediums integrated server, data center
Equipment.The usable medium can be magnetic medium (such as: floppy disk, hard disk, tape), optical medium (such as: digital versatile disc
(Digital Versatile Disc, DVD)) or semiconductor medium (such as: solid state hard disk (Solid State Disk,
SSD)) etc..
The above is embodiment provided by the present application, all in spirit herein and original not to limit the application
Within then, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.