CN109068153B - Video playing method and device and computer readable storage medium - Google Patents

Video playing method and device and computer readable storage medium Download PDF

Info

Publication number
CN109068153B
CN109068153B CN201811143452.XA CN201811143452A CN109068153B CN 109068153 B CN109068153 B CN 109068153B CN 201811143452 A CN201811143452 A CN 201811143452A CN 109068153 B CN109068153 B CN 109068153B
Authority
CN
China
Prior art keywords
video
address
webpage
page
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811143452.XA
Other languages
Chinese (zh)
Other versions
CN109068153A (en
Inventor
杨光旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huawei Cloud Computing Technology Co ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201811143452.XA priority Critical patent/CN109068153B/en
Publication of CN109068153A publication Critical patent/CN109068153A/en
Application granted granted Critical
Publication of CN109068153B publication Critical patent/CN109068153B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a video playing method and device and a computer readable storage medium, and belongs to the technical field of computers. The method comprises the following steps: when an access instruction of a target webpage sent by a terminal is received, a webpage request of the target webpage is sent to a webpage server; receiving webpage information of a target webpage sent by a webpage server; when a video exists in a target webpage, acquiring a video identifier of the video from the webpage information; generating a page address of the video according to the video identifier of the video; constructing an iframe tag, and setting the page address as the src attribute value of the iframe tag; and sending the iframe label to a terminal, and acquiring and playing the video by the terminal according to the iframe label. According to the method and the device, the terminal can successfully acquire the page played with the video according to the src attribute value of the iframe tag, and therefore redirection of the video can be successfully achieved.

Description

Video playing method and device and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a video playing method and apparatus, and a computer-readable storage medium.
Background
The virtual desktop can provide remote computer desktop service deployed at the cloud for a user, the server can be virtualized into a plurality of virtual machines by using a virtualization technology, an operating system and application software required by the user are operated in each virtual machine, and the user can log in the virtual machine at a terminal and access virtual machine resources. Under the virtual desktop, the virtual machine occupies a large amount of virtual machine resources when playing videos, and at the moment, the occupancy rate of the virtual machine to the resources of the server is also large, so that the performance of both the virtual machine and the server is reduced, and therefore, the redirection of the videos is of great significance for improving the experience of the virtual desktop.
Currently, when redirecting a video, a virtual machine may obtain an src attribute value of a video (video) tag of a HyperText Markup Language (HTML) webpage to be loaded as a video address of a video existing in the HTML webpage, and then send the video address to a terminal. After receiving the video address, the terminal can acquire and play the video according to the video address, thereby completing video redirection.
However, the src attribute value of the video tag of the HTML web page is generally a temporary large object (blob) address converted after being encrypted, that is, the src attribute value of the video tag of the HTML web page is usually not a real address of the video, so that the terminal often cannot acquire the video according to the src attribute value of the video tag, and cannot successfully redirect the video.
Disclosure of Invention
The application provides a video playing method, a video playing device and a computer readable storage medium, which can solve the problem that the video cannot be successfully redirected in the related technology. The technical scheme is as follows:
in a first aspect, a video playing method is provided, which is applied to a virtual machine installed in a virtual desktop server, and the method includes:
when an access instruction of a target webpage sent by a terminal is received, sending a webpage request of the target webpage to a webpage server; receiving webpage information of the target webpage sent by the webpage server; when the target webpage has a video, acquiring a video identifier of the video from the webpage information; generating a page address of the video according to the video identifier of the video; constructing a floating frame (iframe) tag, and setting the page address as the src attribute value of the iframe tag; and sending the iframe label to the terminal, and acquiring and playing the video by the terminal according to the iframe label.
It should be noted that the page address of the video may indicate the position of the page where the video is located, that is, the page where the video is located may be obtained according to the page address of the video, and the video is played in the page. In addition, the page may further include a player in the target web page for playing the video, where the video is played in a frame of the player included in the page.
In addition, the iframe tag is used to create an inline frame that contains another document. The iframe tag has a plurality of attributes, wherein the src attribute value of the iframe tag is the document address of the document to be displayed.
In the embodiment of the application, because the virtual machine is an iframe tag constructed according to the video identifier of the video and is sent to the terminal, the terminal can successfully acquire the page where the video is played according to the received src attribute value of the iframe tag, so that redirection of the video can be successfully achieved.
When a video exists in the target webpage, acquiring a video identifier of the video from the webpage information includes: when the video exists in the target webpage, acquiring a video address of the video from the webpage information; and when the video address does not meet the preset condition, acquiring the video identifier of the video from the webpage information.
Further, when the video address meets the preset condition, the video address is sent to the terminal, and the terminal acquires and plays the video according to the video address.
It should be noted that the video address of the video may indicate the location of the video, i.e., the video may be obtained according to the video address of the video.
In addition, the preset condition may be preset, and the preset condition is a condition for determining whether the video address acquired from the web page information is a real address, that is, a condition for determining whether the video address acquired from the web page information can successfully acquire the video.
In this embodiment of the application, when the video address does not satisfy the preset condition, it indicates that the video address is not a real address, and at this time, the virtual machine may obtain a video identifier of the video, so as to generate a page address of the video accordingly. And when the video address meets the preset condition, the video address is indicated to be a real address, and at the moment, the virtual machine can send the video address to the terminal so that the terminal can directly acquire and play the video according to the video address.
Further, when there is a video in the target webpage, before acquiring the video address of the video from the webpage information, the method further includes: and when the video tag exists in the webpage information, determining that the video exists in the target webpage. Correspondingly, when a video exists in the target webpage, acquiring a video address of the video from the webpage information includes: and when the video tag exists in the webpage information, acquiring the src attribute value of the video tag as the video address of the video.
It should be noted that the video tag is used to define a video, such as a movie clip or other video stream. The video tag has a plurality of attributes, wherein the src attribute value of the video tag is the video address of the video to be played.
In the embodiment of the application, the virtual machine can quickly judge whether the video exists in the target webpage or not according to the existence of the video tag, and when the video exists in the target webpage, the video in the target webpage can be quickly acquired according to the video tag, so that the video redirection speed can be improved.
Further, when the video address does not satisfy the preset condition, before acquiring the video identifier of the video from the web page information, the method further includes: and when the video address does not comprise a preset character string, determining that the video address does not meet the preset condition. And when the video address comprises a preset character string, determining that the video address meets a preset condition.
When judging whether the video address comprises the preset character string, judging whether a suffix of the video address is the preset character string, when the suffix of the video address is not the preset character string, determining that the video address does not meet the preset condition, and when the suffix of the video address is the preset character string, determining that the video address meets the preset condition.
Wherein, the generating the page address of the video according to the video identifier of the video comprises: acquiring a construction rule corresponding to the target webpage; acquiring a plurality of construction elements indicated in the construction rule, wherein one of the construction elements is a video identifier of the video; and combining the plurality of construction elements according to the construction rules to obtain the page address of the video.
It should be noted that the construction rule corresponding to the target web page is a rule for constructing a page address of the video in the target web page.
In addition, the plurality of building elements indicated in the building rule are a plurality of pieces of information required for building the page address of the video in the target web page.
It is worth noting that when the virtual machine successfully acquires the construction rule corresponding to the target webpage, it indicates that the target webpage supports sharing of the page address of the video, and at this time, the page address of the video may be generated according to the construction rule. When the virtual machine does not obtain the construction rule corresponding to the target webpage, it is indicated that the target webpage does not support sharing of the page address of the video, and the operation can be ended at this time.
Further, the method further comprises: acquiring window parameters of the video, wherein the window parameters comprise window positions, window sizes and shielding information; and sending the window parameters to the terminal, and displaying a video window by the terminal according to the window parameters, wherein the video window is used for playing the video.
In the embodiment of the application, the virtual machine can acquire the window parameter of the video in a timing or real-time manner, and once the window parameter of the video is found to be changed, the changed window parameter is sent to the terminal, so that the terminal can rapidly adjust the video window for playing the video according to the changed window parameter.
Further, the method further comprises: receiving login information sent by the webpage server; and sending the login information to the terminal, wherein the login information is used for obtaining the access authority of the video.
The login information is used to acquire the access right of the video, and the login information is used to identify the user identity when the virtual machine accesses the web server, and is generally generated by the web server and transmitted to the virtual machine when the virtual machine first accesses the web server. In practical applications, in order to ensure the security of the login information, the login information may be encrypted first, and then the encrypted login information may be sent to the terminal.
In the embodiment of the application, the virtual machine can send the login information to the terminal, and the terminal can use the login information to acquire the video from the webpage server at the moment, so that the terminal can be ensured to have enough authority to access the webpage server to acquire the video, and the success rate of video redirection can be improved.
In a second aspect, a video playing method is provided, which is applied to a terminal, and the method includes:
sending an access instruction of a target webpage to a virtual machine installed in a virtual desktop server; receiving an iframe tag sent by the virtual machine, wherein the src attribute value of the iframe tag is a page address of a video existing in the target webpage, the page address is generated according to a video identifier of the video, and the video identifier of the video is obtained from webpage information of the target webpage; and acquiring and playing the video according to the iframe label.
In the embodiment of the application, the terminal sends the access instruction of the target webpage to the virtual machine installed in the virtual desktop server. And then the terminal receives the iframe label sent by the virtual machine, the src attribute value of the iframe label is the page address of the video existing in the target webpage, the page address is generated according to the video identifier of the video, and the video identifier of the video is obtained from the webpage information of the target webpage. And then, the terminal acquires the video according to the iframe label and plays the video. According to the embodiment of the application, the iframe tag is constructed according to the video identifier of the video, so that the terminal can successfully acquire the page where the video is played according to the src attribute value of the iframe tag, and the video can be successfully redirected.
Further, after sending the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, the method further includes: receiving a video address of the video sent by the virtual machine, wherein the video address is obtained from webpage information of the target webpage; and acquiring and playing the video according to the video address.
In the embodiment of the application, the terminal can acquire and play the video according to the received iframe label and also can acquire and play the video according to the received video address, so that the flexibility of video acquisition is improved, and the success rate of video redirection is improved.
Further, after sending the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, the method further includes: receiving window parameters of the video sent by the virtual machine, wherein the window parameters comprise window positions, window sizes and shielding information; and displaying the video window according to the window parameter. Correspondingly, the acquiring and playing the video comprises: and acquiring the video and playing the video in the video window.
When the terminal displays the video window according to the window parameter, the size of the video window can be set to the window size in the window parameter, the video window is displayed at the window position in the window parameter, the shielded part in the video window is determined according to shielding information in the window parameter, and the shielded part in the video window is set to be in a transparent state.
Further, after sending the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, the method further includes: receiving login information sent by the virtual machine, wherein the login information is used for acquiring the access authority of the video; correspondingly, the acquiring and playing the video according to the iframe tag includes: generating a page acquisition request carrying the src attribute value of the iframe tag, where the page acquisition request is used to request to acquire a page pointed by the src attribute value of the iframe tag, and the page is played with the video; sending the page acquisition request and the login information to a webpage server; and when receiving the page information of the page sent by the web server, displaying the page according to the page information of the page.
In the embodiment of the application, when the terminal receives the login information sent by the virtual machine, the login information can be used for acquiring the video from the webpage server, so that the terminal can be ensured to have enough authority to access the webpage server to acquire the video, and the success rate of video redirection can be improved. Moreover, in order to ensure the security of the login information, the login information may be transmitted in an encrypted manner, and the terminal may delete the login information after the terminal acquires the video from the web server using the login information.
In a third aspect, a video playing apparatus is provided, where the video playing apparatus has a function of implementing the behavior of the video playing method in the first aspect. The video playing device comprises at least one module, and the at least one module is used for implementing the video playing method provided by the first aspect.
In a fourth aspect, a video playing apparatus is provided, where the video playing apparatus has a function of implementing the behavior of the video playing method in the second aspect. The video playing device comprises at least one module, and the at least one module is used for realizing the video playing method provided by the second aspect.
In a fifth aspect, a video playing apparatus is provided, where the structure of the video playing apparatus includes a processor and a memory, where the memory is used to store a program that supports the video playing apparatus to execute the video playing method provided in the first aspect, and store data used to implement the video playing method in the first aspect. The processor is configured to execute programs stored in the memory. The video playback device may further include a communication bus for establishing a connection between the processor and the memory.
In a sixth aspect, a video playing apparatus is provided, where the structure of the video playing apparatus includes a processor and a memory, where the memory is used to store a program that supports the video playing apparatus to execute the video playing method provided in the second aspect, and store data used to implement the video playing method in the second aspect. The processor is configured to execute programs stored in the memory. The video playback device may further include a communication bus for establishing a connection between the processor and the memory.
In a seventh aspect, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to execute the video playing method of the first aspect.
In an eighth aspect, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to execute the video playing method of the second aspect.
In a ninth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the video playback method of the first aspect described above.
A tenth aspect provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the video playback method of the second aspect.
The technical effects obtained by the third, fifth, seventh and ninth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.
The technical effects obtained by the fourth, sixth, eighth and tenth aspects are similar to the technical effects obtained by the corresponding technical means in the second aspect, and are not repeated here.
The technical scheme provided by the application can at least bring the following beneficial effects: and when the virtual machine installed in the virtual desktop server receives an access instruction of the target webpage sent by the terminal, sending a webpage request of the target webpage to the webpage server. And then, the virtual machine receives webpage information of a target webpage sent by a webpage server, when the target webpage has a video, a video identifier of the video is obtained from the webpage information of the target webpage, a page address of the video is generated according to the video identifier of the video, an iframe tag is constructed, and the page address of the video is set as an src attribute value of the iframe tag. And then, the virtual machine sends the iframe label to the terminal, and the terminal acquires the video according to the iframe label and plays the video. According to the embodiment of the application, the iframe tag is constructed according to the video identifier of the video, so that the terminal can successfully acquire the page where the video is played according to the src attribute value of the iframe tag, and the video can be successfully redirected.
Drawings
FIG. 1 is a schematic structural diagram of a virtual desktop system provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a video playing method provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another video playing apparatus according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, application scenarios and system architectures related to the embodiments of the present application will be described.
First, an application scenario of the embodiment of the present application will be described.
The virtual desktop is a typical cloud computing application, can provide a remote computer desktop service deployed at a cloud end for a user, and specifically, a virtualization technology is used for virtualizing a server into a plurality of virtual machines, an operating system and application software required by the user are run in each virtual machine, and the user can log in the virtual machine at a terminal and access virtual machine resources. Since all services in the virtual desktop are processed in the virtual machine, the virtual desktop consumes resources of the server all the time, and especially, the resource consumption of the server by video playing in the virtual desktop is quite large, which may possibly affect the performance of the server, so redirecting the video has an important meaning for improving the experience of the virtual desktop. The embodiment of the application is applied to a video redirection scene under a virtual desktop.
Next, a system architecture according to an embodiment of the present application will be described.
Fig. 1 is a schematic structural diagram of a virtual desktop system according to an embodiment of the present application. Referring to fig. 1, the virtual desktop system includes: virtual desktop server 110 and terminal 120. The virtual Desktop server 110 and the terminal 120 may communicate via a Desktop Protocol, where the Desktop Protocol may be a Remote Desktop Protocol (RDP), and the like, which is not limited in this embodiment of the present application.
The virtual desktop server 110 may provide a software execution environment and a virtual machine control platform of a virtual machine for providing a virtual desktop environment, and a virtual desktop service may be installed in the virtual machine to process message interaction between a client and an operating system of the virtual machine and receive messages of the operating system to render a desktop. The virtual desktop server 110 may be a server, or may be a server cluster formed by a plurality of servers, which is not limited in this embodiment of the present application.
Terminal 120 may access the virtual desktop environment provided by the virtual machine in virtual desktop server 110, and a client may be installed in terminal 120 to receive and process desktop protocol messages. The terminal 120 may be a Personal Computer (PC), a Thin Client (TC), an Android system device, an ios system device, and the like, which is not limited in this embodiment of the present application.
The virtual desktop server 110 has a virtual machine 111 installed therein, and the virtual machine 111 may have a browser and a browser plug-in installed therein. Specifically, the browser plug-in may first determine whether a video exists in the web page, obtain a video identifier of the video from the web page information of the web page if the video exists in the web page, generate a page address of the video according to the video identifier of the video, and send the page address to the terminal 120.
Among them, the terminal 120 has a client 121 and a browser engine 122 installed therein. When receiving the page address sent by the virtual machine 111 installed in the virtual desktop server 110, the client 121 may invoke the browser engine 122 to obtain the video, specifically, the browser engine 122 may obtain and display a page according to the page address, where the video is played after the page is displayed. In addition, the terminal 120 may include an output device (e.g., a display) for displaying desktop content and an input device (e.g., a mouse, a keyboard, etc.) for user input.
Fig. 2 is a schematic structural diagram of a computer device provided in an embodiment of the present application, where the computer device may be the virtual desktop server 110 or the terminal 120 shown in fig. 1. Referring to fig. 2, the computer device comprises at least one processor 201, a communication bus 202, a memory 203 and at least one communication interface 204.
The processor 201 may be a Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of programs according to the present disclosure.
The communication bus 202 may include a path for communicating information between the aforementioned components.
The Memory 203 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a compact disc Read-Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory 203 may be self-contained and coupled to the processor 201 via the communication bus 202. The memory 203 may also be integrated with the processor 201.
The communication interface 204 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.
In particular implementations, processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in fig. 2, as one embodiment.
In particular implementations, a computer device may include multiple processors, such as processor 201 and processor 205 shown in fig. 2, as an embodiment. Each of these processors may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, the computer device may also include an output device 206 and an input device 207, as one embodiment. The output device 206 is in communication with the processor 201 and may display information in a variety of ways. For example, the output device 206 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 207 is in communication with the processor 201 and may receive user input in a variety of ways. For example, the input device 207 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
The computer device may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device may be a desktop computer, a laptop computer, a web server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, and the embodiment of the present application does not limit the type of the computer device.
The memory 203 is used for storing a program code 210 for executing the scheme of the application, and the processor 201 is used for executing the program code 210 stored in the memory 203. The computer device may implement the video playing method provided in the embodiment of fig. 3 below by the processor 201 and the program code 210 in the memory 203.
It should be noted that before executing the video playing method provided by the embodiment of the present application, the terminal may first connect to a virtual machine in the virtual desktop server using a desktop protocol, at this time, the virtual machine may provide a virtual desktop environment for the terminal, and then, a browser and a browser plug-in may be installed in the virtual machine to implement a video redirection technology. Also, the terminal may notify the virtual machine of device information of the terminal, which may include a terminal type (which may be divided by an operating system), whether video redirection is supported, and the like. When the terminal supports video redirection, the video redirection under the virtual desktop can be realized through the video playing method provided by the embodiment of the application.
Fig. 3 is a flowchart of a video playing method according to an embodiment of the present application, where the method is applied to the virtual desktop system shown in fig. 1. Referring to fig. 3, the method includes:
step 301: and the terminal sends an access instruction of the target webpage to a virtual machine installed in the virtual desktop server.
It should be noted that step 301 may be performed by a client installed in the terminal.
In addition, the target web page may be an HTML web page, such as an HTML5 web page, which is not limited in this embodiment of the present application.
Furthermore, the access instruction of the target webpage is used for indicating to access the target webpage, the access instruction of the target webpage can be triggered by a user, and the user can be triggered by mouse operation, keyboard operation and other operations.
Step 302: and when the virtual machine receives an access instruction of the target webpage sent by the terminal, sending a webpage request of the target webpage to the webpage server.
It should be noted that step 302 may be performed by a browser installed in the virtual machine.
In addition, the web page request of the target web page is used to request to acquire the target web page, and the web page request of the target web page may carry a web page address of the target web page, such as a Uniform Resource Locator (URL) of the target web page.
Moreover, after receiving the web page request of the target web page, the web page server can acquire the web page information of the target web page and return the web page information of the target web page to the virtual machine.
Step 303: the virtual machine receives webpage information of a target webpage sent by a webpage server.
It should be noted that step 303 may be performed by a browser installed in the virtual machine.
In addition, the webpage information of the target webpage includes related information of all contents in the target webpage, such as related information of contents, such as characters, pictures, music, and the like, in the target webpage.
It is to be noted that after the browser installed in the virtual machine acquires the web page information of the target web page, the browser may call the browser plug-in installed in the virtual machine to perform video redirection, which may be specifically implemented as the following steps 304 to 308.
Step 304: the virtual machine judges whether a video exists in the target webpage.
It should be noted that step 304 may be performed by a browser plug-in installed in the virtual machine.
Specifically, the virtual machine may determine whether a video tag exists in the web page information of the target web page; when the video tag exists in the webpage information of the target webpage, determining that the video exists in the target webpage; and when the video tag does not exist in the webpage information of the target webpage, determining that the video does not exist in the target webpage. Of course, whether the video exists in the target webpage may also be determined in other manners, which is not limited in the embodiment of the present application.
It should be noted that the video tag is used to define a video, such as a movie clip or other video stream. The video tag has a plurality of attributes, wherein the src attribute value of the video tag is a video address of the video to be played, such as a URL of the video to be played.
Step 305: when the video exists in the target webpage, the virtual machine acquires the video identification of the video from the webpage information of the target webpage.
It should be noted that step 305 may be performed by a browser plug-in installed in the virtual machine.
In addition, the video identifier of the video is used for uniquely identifying the video, and the video identifier of the video may be obtained from a web page address of a target web page or a web page code of the target web page, which is not limited in this application.
Specifically, when a video exists in a target webpage, the virtual machine can directly acquire a video identifier of the video from webpage information of the target webpage; or, when the video exists in the target webpage, the virtual machine may first obtain the video address of the video from the webpage information of the target webpage, then judge whether the video address meets the preset condition, and when the video address does not meet the preset condition, obtain the video identifier of the video from the webpage information of the target webpage.
Further, when the video address meets a preset condition, the virtual machine may send the video address to the terminal.
It should be noted that the video address of the video may indicate the location of the video, i.e., the video may be obtained according to the video address of the video.
In addition, the preset condition may be preset, and the preset condition is a condition for determining whether the video address acquired from the web page information is a real address, that is, a condition for determining whether the video address acquired from the web page information can successfully acquire the video.
And when the video address does not meet the preset condition, the video address is not a real address, and the video identifier of the video can be acquired at the moment so as to generate the page address of the video. And when the video address meets the preset condition, the video address is indicated to be a real address, and at the moment, the video address can be sent to the terminal so that the terminal can directly acquire and play the video according to the video address.
When a video exists in the target webpage, the operation of the virtual machine acquiring the video address of the video from the webpage information of the target webpage may be: when a video tag exists in the webpage information of the target webpage, the src attribute value of the video tag is acquired as the video address of the video.
The operation of the virtual machine for determining whether the video address meets the preset condition may be: the virtual machine judges whether the video address comprises a preset character string or not; when the video address does not comprise a preset character string, determining that the video address does not meet a preset condition; and when the video address comprises a preset character string, determining that the video address meets a preset condition.
It should be noted that the preset character string may be preset, for example, the preset character string may be a video type, and the video type may include an audio video interleaved (avi) type, a Motion Picture Experts Group (MPEG) 4 type, and the like.
In addition, when determining whether the video address includes the preset character string, it may be specifically determined whether a suffix of the video address is the preset character string, when the suffix of the video address is not the preset character string, it is determined that the video address does not satisfy the preset condition, and when the suffix of the video address is the preset character string, it is determined that the video address satisfies the preset condition.
Step 306: and the virtual machine generates a page address of the video according to the video identifier of the video.
It should be noted that step 306 may be performed by a browser plug-in installed in the virtual machine.
In addition, the page address of the video may indicate the position of the page where the video is located, that is, the page where the video is located may be obtained according to the page address of the video, and the video is played in the page. In addition, the page may further include a player in the target web page for playing the video, where the video is played in a frame of the player included in the page.
Specifically, the virtual machine may obtain a construction rule corresponding to the target webpage; acquiring a plurality of construction elements indicated in the construction rule, wherein one of the construction elements is a video identifier of the video; and combining the plurality of construction elements according to the construction rule to obtain the page address of the video. Of course, the page address of the video may also be generated in other ways according to the video identifier of the video, which is not limited in this embodiment of the application.
It should be noted that the construction rule corresponding to the target web page is a rule for constructing a page address of the video in the target web page. For example, the construction rule corresponding to the target web page may be "domain name/embedded/video identifier of the located website", and the like.
In addition, the plurality of building elements indicated in the building rule are a plurality of pieces of information required for building the page address of the video in the target web page. For example, when the construction rule is "domain name/embed/video identifier of the located website", the plurality of construction elements indicated by the construction rule are the domain name, embed and video identifier of the website where the target webpage is located.
When the virtual machine acquires the construction rule corresponding to the target webpage, the corresponding construction rule can be acquired from the corresponding relation between the stored website identification and the construction rule according to the website identification of the website where the target webpage is located, and the corresponding construction rule is used as the construction rule corresponding to the target webpage. Of course, the construction rule corresponding to the target webpage may also be obtained in other manners, which is not limited in the embodiment of the present application.
It should be noted that the website identifier of the website is used to uniquely identify the website, for example, the website identifier of the website may be a name, a domain name, and the like of the website, which is not limited in this embodiment of the application.
In addition, when the construction rule corresponding to the target webpage is successfully acquired, it is indicated that the target webpage supports sharing of the page address of the video, and the page address of the video can be generated according to the construction rule. When the construction rule corresponding to the target webpage is not acquired, it is indicated that the target webpage does not support sharing of the page address of the video, and the operation may be ended at this time.
Step 307: the virtual mechanism establishes an iframe tag, and sets the page address of the video as the src attribute value of the iframe tag.
It should be noted that step 307 may be performed by a browser plug-in installed in the virtual machine.
In addition, the iframe tag is used to create an inline frame that contains another document. The iframe tag has a plurality of attributes, wherein the src attribute value of the iframe tag is the document address of the document to be displayed, such as the URL of the document to be displayed.
Step 308: and the virtual machine sends the iframe label to the terminal.
It should be noted that step 308 can be performed by a browser plug-in installed in the virtual machine.
It is worth noting that, in the embodiment of the application, the virtual machine not only can construct an iframe tag and send the iframe tag to the terminal, but also can obtain window parameters of the video and send the window parameters of the video to the terminal. And the virtual machine can also receive login information sent by the webpage server and send the login information to the terminal.
It should be noted that the operation of the virtual machine acquiring the window parameter of the video and sending the window parameter to the terminal may be performed by a browser plug-in installed in the virtual machine. The operation of the virtual machine receiving the login information transmitted from the web server and transmitting to the terminal may be performed by a browser installed in the virtual machine.
In addition, the window parameter is a related parameter of a video window for playing the video, and the window parameter is used for positioning the video window, for example, the window parameter may include a window position, a window size, occlusion information, and the like. In practical application, the virtual machine may obtain the window parameter of the video in a timed or real-time manner, and once the window parameter of the video is found to be changed, the changed window parameter is sent to the terminal.
The login information is used to acquire the access right of the video, and the login information is used by the virtual machine to identify the user identity when accessing the web server, and is generally generated by the web server and transmitted to the virtual machine when the virtual machine first accesses the web server. The login information may be small text files (cookies) or the like. In practical applications, in order to ensure the security of the login information, the login information may be encrypted first, and then the encrypted login information may be sent to the terminal.
It should be noted that, in the embodiment of the present invention, when receiving the web page information of the target web page sent by the web page server, the virtual machine may not acquire the video in the target web page, and only acquire and display the web page contents of the target web page other than the video according to the web page information of the target web page.
Step 309: and the terminal receives the iframe label sent by the virtual machine.
It should be noted that step 309 may be performed by a client installed in the terminal.
In addition, the src attribute value of the iframe tag is the page address of the video existing in the target webpage, the page address of the video is generated according to the video identifier of the video, and the video identifier of the video is obtained from the webpage information of the target webpage.
Step 310: and the terminal acquires and plays the video in the target webpage according to the iframe label.
It should be noted that step 310 may be performed by a browser engine installed in the terminal.
Specifically, the terminal may generate a page acquisition request carrying the src attribute value of the iframe tag, where the page acquisition request is used to request to acquire a page to which the src attribute value of the iframe tag points, and a video in a target webpage is played in the page; sending the page acquisition request to a web server; and when receiving the page information of the page sent by the web server, displaying the page according to the page information of the page.
It should be noted that after the page is displayed, the video in the target web page is played in the page. Since the page may further include a player in the target webpage for playing the video, and the video is played in a frame of the player included in the page, the terminal may directly control the playing of the video through the player in the page, in this case, the playing effect of the video after the video is redirected is the same as the playing effect of the original video.
Further, the terminal may receive the iframe tag sent by the virtual machine, and may also receive a video address of a video in the target webpage sent by the virtual machine, where the video address of the video is obtained from the webpage information of the target webpage. When the terminal receives the video address of the video in the target webpage sent by the virtual machine, the video can be obtained and played according to the video address of the video.
It should be noted that the operation of the terminal receiving the video address of the video in the target webpage sent by the virtual machine may be executed by a client installed in the terminal, and the operation of the terminal acquiring the video according to the video address of the video and playing the video may be executed by a browser engine installed in the terminal.
In addition, when the video address of the video is the src attribute value of the video tag of the target web page, when the terminal receives the video address of the video in the target web page sent by the virtual machine, an HTML web page may be created first, the src attribute value of the video tag of the HTML web page is set as the video address of the video, and then the web page content of the HTML web page may be loaded, where the loading of the web page content of the HTML web page is to obtain the video according to the video address of the video and play the video.
When the terminal acquires the video and plays the video according to the video address of the video, a video acquisition request carrying the video address of the video can be generated; sending the video acquisition request to a webpage server; and when the video data of the video sent by the webpage server is received, playing the video according to the video data of the video.
It should be noted that the terminal may also receive window parameters of the video sent by the virtual machine, where the window parameters may include window position, window size, occlusion information, and the like. When the terminal receives the window parameter of the video sent by the virtual machine, the video window can be displayed according to the window parameter. Then, when the terminal acquires and plays the video, the terminal may acquire the video first and then play the video in the video window.
When the terminal displays the video window according to the window parameter, the size of the video window can be set to the window size in the window parameter, the video window is displayed at the window position in the window parameter, the shielded part in the video window is determined according to shielding information in the window parameter, and the shielded part in the video window is set to be in a transparent state.
When the terminal plays the video in the video window, if the terminal displays the page according to the page information of the page pointed by the src attribute value of the iframe tag, the page can be displayed in the video window, and if the terminal plays the video according to the video data of the video, the video can be played in the video window.
It should be noted that the terminal may also receive login information sent by the virtual machine, where the login information is used to obtain access rights of the video. When the terminal receives the login information sent by the virtual machine, the login information can be used for acquiring the video from the webpage server. Specifically, the terminal may send the login information to the web server while sending the page acquisition request or the video acquisition request to the web server, so as to ensure that the terminal has sufficient authority to access the web server to acquire the video.
In addition, in order to ensure the security of the login information, the login information may be transmitted in an encrypted manner, and the terminal may delete the login information after the terminal acquires the video from the web server using the login information.
It is worth noting that in the embodiment of the application, effective information can be mined from the webpage information of the target webpage as much as possible, so that video redirection is realized. After the video is redirected, the pressure of the virtual desktop server can be reduced, the resource occupation is reduced, the influence of video playing on the performance of the virtual desktop server is avoided, and the transmission bandwidth from the virtual machine to the terminal can be greatly reduced because the terminal directly obtains the video from the webpage server. In addition, compared with a mode that the virtual machine compresses the video first and then transmits the video to the terminal in the related art, the embodiment of the application can avoid the influence of the compression on the video quality and ensure the playing effect of the video.
Further, considering that the capability of the terminal is limited, in order to avoid excessive stress on the terminal caused by video playing, the number of redirected videos may be limited in the embodiment of the present application. Specifically, the virtual machine may be notified that the terminal supports video redirection when the number of redirected videos is less than a number threshold, and may be notified that the terminal does not support video redirection when the number of redirected videos is greater than or equal to the number threshold. Wherein the number threshold may be set in advance.
Furthermore, in order to enhance the universality and prevent the video redirection failure caused by the fact that the terminal cannot be connected with an external network, a proxy server can be added, and the terminal can acquire the video from the webpage server through the proxy server.
In the embodiment of the application, the terminal sends the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, and when the virtual machine receives the access instruction of the target webpage sent by the terminal, the virtual machine sends the webpage request of the target webpage to the webpage server. And then, the virtual machine receives webpage information of a target webpage sent by a webpage server, when the target webpage has a video, a video identifier of the video is obtained from the webpage information of the target webpage, a page address of the video is generated according to the video identifier of the video, an iframe tag is constructed, and the page address of the video is set as an src attribute value of the iframe tag. And then, the virtual machine sends the iframe label to the terminal. And when the terminal receives the iframe label sent by the virtual machine, acquiring the video according to the iframe label and playing the video. According to the embodiment of the application, the iframe tag is constructed according to the video identifier of the video, so that the terminal can successfully acquire the page where the video is played according to the src attribute value of the iframe tag, and the video can be successfully redirected.
Fig. 4 is a schematic structural diagram of a video playing apparatus provided in an embodiment of the present application, where the apparatus is applied to a virtual machine installed in a virtual desktop server, and the apparatus may be implemented by software, hardware, or a combination of the two to become part or all of a computer device, and when the computer device shown in fig. 2 is a virtual desktop server, the computer device may be the computer device shown in fig. 2. Referring to fig. 4, the apparatus includes: a first sending module 401, a first receiving module 402, a first obtaining module 403, a generating module 404, a constructing module 405, and a second sending module 406.
A first sending module 401, configured to perform step 302 in the embodiment of fig. 3;
a first receiving module 402, configured to perform step 303 in the embodiment of fig. 3;
a first obtaining module 403, configured to perform step 305 in the embodiment of fig. 3;
a generating module 404, configured to perform step 306 in the embodiment of fig. 3;
a building module 405 for performing step 307 in the embodiment of fig. 3;
a second sending module 406, configured to execute step 308 in the embodiment of fig. 3.
Optionally, the first obtaining module 403 includes:
the first acquisition unit is used for acquiring a video address of a video from the webpage information when the video exists in the target webpage;
and the second acquisition unit is used for acquiring the video identification of the video from the webpage information when the video address does not meet the preset condition.
Optionally, the first obtaining module 403 further includes:
the first determining unit is used for determining that the video exists in the target webpage when the video tag exists in the webpage information;
accordingly, the first obtaining unit is configured to:
and when the video tag exists in the webpage information, acquiring the src attribute value of the video tag as the video address of the video.
Optionally, the first obtaining module 403 further includes:
and the second determining unit is used for determining that the video address does not meet the preset condition when the preset character string is not included in the video address.
Optionally, the first obtaining module 403 further includes:
and the third sending module is used for sending the video address to the terminal when the video address meets the preset condition, and the terminal acquires and plays the video according to the video address.
Optionally, the generating module 404 includes:
the third acquisition unit is used for acquiring a construction rule corresponding to the target webpage;
a fourth obtaining unit, configured to obtain multiple construction elements indicated in the construction rule, where one of the multiple construction elements is a video identifier of the video;
and the combination unit is used for combining the plurality of construction elements according to the construction rules to obtain the page address of the video.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring window parameters of the video, wherein the window parameters comprise window positions, window sizes and shielding information;
and the fourth sending module is used for sending the window parameters to the terminal, the terminal displays the video window according to the window parameters, and the video window is used for playing the video.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving login information sent by the webpage server;
and the fifth sending module is used for sending the login information to the terminal, wherein the login information is used for obtaining the access authority of the video.
In the embodiment of the application, when the virtual machine installed in the virtual desktop server receives the access instruction of the target webpage sent by the terminal, the webpage request of the target webpage is sent to the webpage server. And then, the virtual machine receives webpage information of a target webpage sent by a webpage server, when the target webpage has a video, a video identifier of the video is obtained from the webpage information of the target webpage, a page address of the video is generated according to the video identifier of the video, an iframe tag is constructed, and the page address of the video is set as an src attribute value of the iframe tag. And then, the virtual machine sends the iframe label to the terminal, and the terminal acquires the video according to the iframe label and plays the video. According to the embodiment of the application, the iframe tag is constructed according to the video identifier of the video, so that the terminal can successfully acquire the page where the video is played according to the src attribute value of the iframe tag, and the video can be successfully redirected.
Fig. 5 is a schematic structural diagram of a video playing apparatus provided in an embodiment of the present application, where the apparatus is applied to a terminal, and the apparatus may be implemented by software, hardware, or a combination of the two as part or all of a computer device, and when the computer device shown in fig. 2 is a terminal, the computer device may be the computer device shown in fig. 2. Referring to fig. 5, the apparatus includes: a sending module 501, a first receiving module 502 and a first playing module 503.
A sending module 501, configured to execute step 301 in the embodiment of fig. 3;
a first receiving module 502, configured to perform step 309 in the embodiment of fig. 3;
a first playing module 503, configured to execute step 310 in the embodiment of fig. 3.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a video address of the video sent by the virtual machine, wherein the video address is obtained from webpage information of a target webpage;
and the second playing module is used for acquiring and playing the video according to the video address.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving window parameters of the video sent by the virtual machine, wherein the window parameters comprise window positions, window sizes and shielding information;
the display module is used for displaying the video window according to the window parameter;
accordingly, the first playing module is configured to:
and acquiring a video and playing the video in a video window.
Optionally, the apparatus further comprises:
the fourth receiving module is used for receiving login information sent by the virtual machine, wherein the login information is used for obtaining the access authority of the video;
accordingly, the first playing module 503 includes:
the generating unit is used for generating a page acquisition request carrying the src attribute value of the iframe tag, wherein the page acquisition request is used for requesting to acquire a page pointed by the src attribute value of the iframe tag, and a video is played in the page;
the sending unit is used for sending a page acquisition request and login information to the webpage server;
and the display unit is used for displaying the page according to the page information of the page when receiving the page information of the page sent by the web server.
In the embodiment of the application, the terminal sends the access instruction of the target webpage to the virtual machine installed in the virtual desktop server. And then the terminal receives the iframe label sent by the virtual machine, the src attribute value of the iframe label is the page address of the video existing in the target webpage, the page address is generated according to the video identifier of the video, and the video identifier of the video is obtained from the webpage information of the target webpage. And then, the terminal acquires the video according to the iframe label and plays the video. According to the embodiment of the application, the iframe tag is constructed according to the video identifier of the video, so that the terminal can successfully acquire the page where the video is played according to the src attribute value of the iframe tag, and the video can be successfully redirected.
It should be noted that: in the video playing apparatus provided in the foregoing embodiment, only the division of the functional modules is exemplified when playing a video, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above. In addition, the video playing apparatus and the video playing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
In the above embodiments, the implementation may be wholly or partly realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (18)

1. A video playing method is applied to a virtual machine installed in a virtual desktop server, and comprises the following steps:
when an access instruction of a target webpage sent by a terminal is received, sending a webpage request of the target webpage to a webpage server;
receiving webpage information of the target webpage sent by the webpage server;
when a video exists in the target webpage, acquiring a video address of the video from the webpage information, wherein the video address is used for indicating the position of the video;
when the video address does not meet a preset condition, acquiring a video identifier of the video from the webpage information; acquiring a construction rule corresponding to the target webpage, wherein the construction rule is a rule for constructing a page address of a video in the target webpage; acquiring a plurality of construction elements indicated in the construction rule, wherein one of the construction elements is a video identifier of the video; combining the plurality of construction elements according to the construction rules to obtain the page address of the video; constructing a floating frame iframe tag, and setting the page address as the src attribute value of the iframe tag; sending the iframe label to the terminal, and acquiring and playing the video by the terminal according to the iframe label;
when the video address meets the preset condition, the video address is sent to the terminal, and the terminal acquires and plays the video according to the video address;
the method further comprises the following steps:
and receiving login information sent by the webpage server in an encryption transmission mode, and sending the encrypted login information to the terminal, wherein the login information is used for acquiring the access right of the video.
2. The method of claim 1, wherein before obtaining the video address of the video from the web page information when the video exists in the target web page, further comprising:
when the video tag exists in the webpage information, determining that a video exists in the target webpage;
correspondingly, when a video exists in the target webpage, acquiring a video address of the video from the webpage information includes:
and when the video tag exists in the webpage information, acquiring the src attribute value of the video tag as the video address of the video.
3. The method of claim 2, wherein before obtaining the video identifier of the video from the web page information when the video address does not satisfy the preset condition, the method further comprises:
and when the video address does not comprise a preset character string, determining that the video address does not meet the preset condition.
4. The method of any of claims 1-3, wherein the method further comprises:
acquiring window parameters of the video, wherein the window parameters comprise window positions, window sizes and shielding information;
and sending the window parameters to the terminal, and displaying a video window by the terminal according to the window parameters, wherein the video window is used for playing the video.
5. A video playing method is applied to a terminal, and the method comprises the following steps:
sending an access instruction of a target webpage to a virtual machine installed in a virtual desktop server;
receiving encrypted login information sent by the virtual machine, wherein the login information is used for obtaining the access authority of the video;
receiving a floating frame iframe tag sent by the virtual machine, wherein the src attribute value of the iframe tag is a page address of a video existing in the target webpage, the page address is obtained by combining a plurality of construction elements indicated in the construction rules according to the acquired construction rules corresponding to the target webpage, the construction rules are rules for constructing the page address of the video in the target webpage, one of the plurality of construction elements is a video identifier of the video, and the video identifier of the video is acquired from webpage information of the target webpage; acquiring and playing the video according to the iframe label; or,
and receiving a video address of the video sent by the virtual machine, acquiring the video according to the video address of the video, and playing the video, wherein the video address is acquired from the webpage information of the target webpage, and the video address is used for indicating the position of the video.
6. The method of claim 5, wherein after sending the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, further comprising:
receiving a video address of the video sent by the virtual machine, wherein the video address is obtained from webpage information of the target webpage;
and acquiring and playing the video according to the video address.
7. The method of claim 5 or 6, wherein after sending the access instruction of the target webpage to the virtual machine installed in the virtual desktop server, the method further comprises:
receiving window parameters of the video sent by the virtual machine, wherein the window parameters comprise window positions, window sizes and shielding information;
displaying a video window according to the window parameter;
correspondingly, the acquiring and playing the video comprises:
and acquiring the video and playing the video in the video window.
8. The method according to any one of claims 5-7, wherein the obtaining and playing the video according to the iframe tag comprises:
generating a page acquisition request carrying the src attribute value of the iframe tag, where the page acquisition request is used to request to acquire a page pointed by the src attribute value of the iframe tag, and the page is played with the video;
sending the page acquisition request and the login information to a webpage server;
and when receiving the page information of the page sent by the web server, displaying the page according to the page information of the page.
9. A video playing apparatus, applied to a virtual machine installed in a virtual desktop server, the apparatus comprising:
the first sending module is used for sending a webpage request of a target webpage to a webpage server when receiving an access instruction of the target webpage sent by a terminal;
the first receiving module is used for receiving the webpage information of the target webpage sent by the webpage server;
the first acquisition module is used for acquiring a video identifier of a video from the webpage information when the video exists in the target webpage;
the generating module is used for generating a page address of the video according to the video identifier of the video;
the building module is used for building a floating frame iframe label and setting the page address as the src attribute value of the iframe label;
the second sending module is used for sending the iframe label to the terminal, and the terminal acquires and plays the video according to the iframe label;
the device further comprises a module for acquiring a video address of the video from the webpage information when the video exists in the target webpage, wherein the video address is used for indicating the position of the video;
the device also comprises a module for acquiring the video identifier of the video from the webpage information when the video address does not meet the preset condition;
the device also comprises a module for sending the video address to the terminal when the video address meets the preset condition, and acquiring and playing the video by the terminal according to the video address;
the generation module comprises:
a third obtaining unit, configured to obtain a construction rule corresponding to the target webpage, where the construction rule is a rule for constructing a page address of a video in the target webpage;
a fourth obtaining unit, configured to obtain multiple construction elements indicated in the construction rule, where one of the multiple construction elements is a video identifier of the video;
the combination unit is used for combining the plurality of construction elements according to the construction rules to obtain the page address of the video;
the device further comprises:
the second receiving module is used for receiving the login information sent by the webpage server in an encryption transmission mode;
and the fifth sending module is used for sending the encrypted login information to the terminal, wherein the login information is used for obtaining the access authority of the video.
10. The apparatus of claim 9, wherein the first obtaining module further comprises:
the first determining unit is used for determining that the video exists in the target webpage when the video tag exists in the webpage information;
accordingly, the first obtaining unit is configured to:
and when the video tag exists in the webpage information, acquiring the src attribute value of the video tag as the video address of the video.
11. The apparatus of claim 10, wherein the first obtaining module further comprises:
a second determining unit, configured to determine that the video address does not satisfy the preset condition when a preset character string is not included in the video address.
12. The apparatus of any of claims 9-11, wherein the apparatus further comprises:
the second acquisition module is used for acquiring window parameters of the video, wherein the window parameters comprise window positions, window sizes and shielding information;
and the fourth sending module is used for sending the window parameters to the terminal, the terminal displays a video window according to the window parameters, and the video window is used for playing the video.
13. A video playing apparatus, applied to a terminal, the apparatus comprising:
the sending module is used for sending an access instruction of a target webpage to a virtual machine installed in the virtual desktop server;
a first receiving module, configured to receive a floating frame iframe tag sent by the virtual machine, where a src attribute value of the iframe tag is a page address of a video existing in the target webpage, the page address is obtained by combining, by the virtual machine, multiple construction elements indicated in the construction rules according to an acquired construction rule corresponding to the target webpage, the construction rule is a rule for constructing a page address of a video in the target webpage, one construction element of the multiple construction elements is a video identifier of the video, and the video identifier of the video is acquired from webpage information of the target webpage;
the first playing module is used for acquiring and playing the video according to the iframe label;
the apparatus also includes means for performing the steps of:
receiving a video address of the video sent by the virtual machine, and acquiring and playing the video according to the video address of the video, wherein the video address is acquired from webpage information of the target webpage, and the video address is used for indicating the position of the video;
the device further comprises:
and the fourth receiving module is used for receiving the encrypted login information sent by the virtual machine, wherein the login information is used for obtaining the access authority of the video.
14. The apparatus of claim 13, wherein the apparatus further comprises:
the second receiving module is used for receiving the video address of the video sent by the virtual machine, wherein the video address is obtained from the webpage information of the target webpage;
and the second playing module is used for acquiring and playing the video according to the video address.
15. The apparatus of claim 13 or 14, wherein the apparatus further comprises:
a third receiving module, configured to receive window parameters of the video sent by the virtual machine, where the window parameters include a window position, a window size, and occlusion information;
the display module is used for displaying the video window according to the window parameter;
accordingly, the first playing module is configured to:
and acquiring the video and playing the video in the video window.
16. The apparatus of any of claims 13-15, wherein the first playback module comprises:
a generating unit, configured to generate a page acquisition request carrying the src attribute value of the iframe tag, where the page acquisition request is used to request to acquire a page to which the src attribute value of the iframe tag points, and the page plays the video;
a sending unit, configured to send the page acquisition request and the login information to a web server;
and the display unit is used for displaying the page according to the page information of the page when receiving the page information of the page sent by the webpage server.
17. A computer-readable storage medium having stored therein instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1-4.
18. A computer-readable storage medium having stored therein instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 5-8.
CN201811143452.XA 2018-09-28 2018-09-28 Video playing method and device and computer readable storage medium Active CN109068153B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811143452.XA CN109068153B (en) 2018-09-28 2018-09-28 Video playing method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811143452.XA CN109068153B (en) 2018-09-28 2018-09-28 Video playing method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109068153A CN109068153A (en) 2018-12-21
CN109068153B true CN109068153B (en) 2020-10-16

Family

ID=64766570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811143452.XA Active CN109068153B (en) 2018-09-28 2018-09-28 Video playing method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109068153B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110381363A (en) * 2019-07-17 2019-10-25 深信服科技股份有限公司 Video encoding/decoding method, device, server and storage medium
CN112714365B (en) * 2019-10-25 2024-02-09 上海哔哩哔哩科技有限公司 Video playing method and system
CN111031293B (en) * 2019-11-29 2021-08-24 三一重工股份有限公司 Panoramic monitoring display method, device and system and computer readable storage medium
CN111131907B (en) * 2019-12-31 2022-03-22 广州市百果园信息技术有限公司 Live content introduction method and device, storage medium and equipment
CN111464874A (en) * 2020-04-15 2020-07-28 湖南麒麟信安科技有限公司 Method, system and medium for playing webpage video in cloud desktop
CN111526428B (en) * 2020-04-26 2022-04-26 湖南麒麟信安科技股份有限公司 Method, system and medium for realizing HTML5 video playing in cloud desktop
CN112437329B (en) * 2020-11-05 2024-01-26 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN114692027A (en) * 2020-12-29 2022-07-01 福建天泉教育科技有限公司 Method and terminal for reducing short link into long link
CN114885008A (en) * 2022-04-22 2022-08-09 广东悦伍纪网络技术有限公司 Device, system and method for calling local player to play by cloud application
CN115225951B (en) * 2022-07-21 2023-06-20 中国平安人寿保险股份有限公司 Video processing method, apparatus, computer device, and computer-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761603A (en) * 2012-06-07 2012-10-31 福建升腾资讯有限公司 Webpage flash video redirection method in VDI environment
CN103685269A (en) * 2013-12-12 2014-03-26 Tcl集团股份有限公司 Method and system for both-way communication between web browser and server
CN103905927A (en) * 2012-12-26 2014-07-02 华为技术有限公司 Video redirection method under virtual desktop scene, desktop server and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7941755B2 (en) * 2007-04-19 2011-05-10 Art Technology Group, Inc. Method and apparatus for web page co-browsing
CN101446954B (en) * 2008-11-25 2010-09-08 北京邮电大学 Wide area network crawler system for a video website
CN103281591B (en) * 2013-06-03 2016-04-20 贝壳网际(北京)安全技术有限公司 Method and device for playing flash video through browser and mobile terminal
US20150178819A1 (en) * 2013-12-23 2015-06-25 @Pay Ip Holdings Llc Alternative email-based website checkouts
CN104333813A (en) * 2014-08-28 2015-02-04 无锡天脉聚源传媒科技有限公司 Video playing method, device and system
CN107295415B (en) * 2016-04-12 2020-09-25 百度在线网络技术(北京)有限公司 Video playing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761603A (en) * 2012-06-07 2012-10-31 福建升腾资讯有限公司 Webpage flash video redirection method in VDI environment
CN103905927A (en) * 2012-12-26 2014-07-02 华为技术有限公司 Video redirection method under virtual desktop scene, desktop server and system
CN103685269A (en) * 2013-12-12 2014-03-26 Tcl集团股份有限公司 Method and system for both-way communication between web browser and server

Also Published As

Publication number Publication date
CN109068153A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109068153B (en) Video playing method and device and computer readable storage medium
US8868637B2 (en) Page rendering for dynamic web pages
US10642904B2 (en) Infrastructure enabling intelligent execution and crawling of a web application
US10102306B2 (en) Patching base document object model (DOM) with DOM-differentials to generate high fidelity replay of webpage user interactions
CN111277869B (en) Video playing method, device, equipment and storage medium
WO2021082299A1 (en) Video playback method and device
US9075877B2 (en) System and method for transparent in-network adaptation of rich internet applications
US8689099B1 (en) Cross-domain communication
KR102232900B1 (en) System for cloud streaming service, method of cloud streaming service using optumal gpu and apparatus for the same
JP2011018314A (en) Method, system and computer program for sharing web page
US11909812B2 (en) Application control method and apparatus, electronic device, and storage medium
CN104539977A (en) Live broadcast previewing method and device
CN108416021B (en) Browser webpage content processing method and device, electronic equipment and readable medium
US9906626B2 (en) Resource demand-based network page generation
US10419798B2 (en) Method and apparatus for just-in-time transcoding
CN111756847B (en) Method and device for supporting https protocol by website
EP4109861A1 (en) Data processing method, apparatus, computer device, and storage medium
CN112269959B (en) Control method and device for display content, readable medium and electronic equipment
CN104349177A (en) Method for turning to play multimedia file under desktop cloud, virtual machine and system
CN114302176B (en) Video playing method and device
CN110457632B (en) Webpage loading processing method and device
US11849157B2 (en) Systems and methods for live streaming
CN112015383A (en) Login method and device
US11784887B1 (en) Bandwidth throttling
US11758016B2 (en) Hosted application as web widget toolkit

Legal Events

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

Effective date of registration: 20220211

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221212

Address after: 518129 Huawei Headquarters Office Building 101, Wankecheng Community, Bantian Street, Longgang District, Shenzhen, Guangdong

Patentee after: Shenzhen Huawei Cloud Computing Technology Co.,Ltd.

Address before: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee before: Huawei Cloud Computing Technologies Co.,Ltd.

TR01 Transfer of patent right