CN116781977A - Video playing method, device, equipment, storage medium and product based on webpage - Google Patents

Video playing method, device, equipment, storage medium and product based on webpage Download PDF

Info

Publication number
CN116781977A
CN116781977A CN202310620883.5A CN202310620883A CN116781977A CN 116781977 A CN116781977 A CN 116781977A CN 202310620883 A CN202310620883 A CN 202310620883A CN 116781977 A CN116781977 A CN 116781977A
Authority
CN
China
Prior art keywords
video
playing
component
instruction
window
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.)
Pending
Application number
CN202310620883.5A
Other languages
Chinese (zh)
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.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication Technology 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 Inspur Communication Technology Co Ltd filed Critical Inspur Communication Technology Co Ltd
Priority to CN202310620883.5A priority Critical patent/CN116781977A/en
Publication of CN116781977A publication Critical patent/CN116781977A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • 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/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a video playing method, a device, equipment, a storage medium and a product based on a webpage, which relate to the technical field of computers, wherein a browser end comprises a control component and a video playing component, a video playing instruction is received through the control component, and the video playing instruction comprises a play window creation instruction and a video stream processing instruction; generating a play window by a video play component in response to the play window creation instruction; and responding to the video stream processing instruction, receiving the video data packet through the video playing component, decoding the video data packet to obtain a target video, and displaying the target video in a playing window. The invention responds to the video playing instruction and realizes video playing by adding the control component and the video playing component in the browser, does not need to use the existing components of the browser to encode and decode the video data packet, can effectively solve the problems of page clamping and delay, does not need to configure different decoders, and has low requirement on the performance of the computer.

Description

Video playing method, device, equipment, storage medium and product based on webpage
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a video playing method, apparatus, device, storage medium and product based on a web page.
Background
Most of the existing player components at the browser end encode and decode video streams through js and other front-end technologies so as to realize real-time playing of videos.
H.264 and h.265 are two video coding standards commonly used today, both of which implement compression and decompression of video data based on different compression algorithms. For video data packets based on different video coding standards, a player component at the browser end needs to decode the video data packets through different decoders, so that video playing is realized.
However, due to the implementation differences and limitations of different decoders, the browser component cannot generally support two video coding modes of h.264 and h.265 at the same time, and if multiple different decoders are to be configured at the browser end at the same time, the requirement on the performance of the computer is high. In addition, when the existing components of the browser are used for playing video, the problems of page jam and delay become more serious as the playing time is longer.
Disclosure of Invention
The invention provides a video playing method, device, equipment, storage medium and product based on a webpage, which are used for solving the defects that the longer the playing time is, the more the problem of page blocking and delay is serious and the requirement on the performance of a computer is high when the video playing is realized by using the existing components of a browser in the prior art.
The invention provides a video playing method based on a webpage, wherein a browser end comprises a control component and a video playing component, and the method comprises the following steps: receiving a video playing instruction through a control component, wherein the video playing instruction comprises a playing window creating instruction and a video stream processing instruction; responding to an instruction for creating a playing window, and generating the playing window in a webpage at a browser end through a video playing component; receiving a video data packet through a video playing component in response to a video stream processing instruction, and decoding the video data packet to obtain a target video; and displaying the target video in the playing window.
According to the webpage-based video playing method provided by the invention, after a playing window is generated in a webpage at a browser end through a video playing component, the method comprises the following steps: receiving a play window adjustment instruction through a control component; and responding to the play window adjustment instruction, and adjusting the size and/or the position of the play window through the video play component.
According to the webpage-based video playing method provided by the invention, in response to an instruction for creating a playing window, the playing window is generated in a webpage at a browser end through a video playing component, and the method comprises the following steps: responding to an instruction of creating a playing window, and generating a first playing window and a second playing window in a webpage of a browser end through a video playing component; receiving a video data packet in response to a video stream processing instruction, and decoding the video data packet through a video playing component to obtain a target video, wherein the video stream processing instruction comprises the following steps: receiving a first video data packet and a second video packet in response to processing the video stream instruction; decoding the first video data packet and the second video data packet through the video playing component to obtain a first target video and a second target video; displaying the target video in the play window, including: displaying a first target video in a first playing window; and displaying the second target video in the second playing window.
According to the video playing method based on the webpage, before receiving a video playing instruction through a control component, the method comprises the following steps: sending a control port registration instruction to the video playing component through the control component; and responding to the control port registration instruction, and sending a control port registration result to the control component through the video playing component.
According to the webpage-based video playing method provided by the invention, the control component receives the input instruction of the user; in response to the input instruction, the video playing component controls to pause/play/end/screenshot the target video in the playing window.
According to the video playing method based on the webpage, the control component and the video playing component carry out two-way communication by utilizing Socket.
The invention also provides a video playing device based on the webpage, which comprises a control component and a video playing component; the control component is used for receiving video playing instructions, wherein the video playing instructions comprise a play window creation instruction and a video stream processing instruction; the video playing component is used for responding to the instruction of creating the playing window and generating the playing window in the webpage of the browser end; receiving a video data packet through a video playing component in response to a video stream processing instruction, and decoding the video data packet to obtain a target video; and displaying the target video in the playing window.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the video playing method based on the webpage when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a web-based video playback method as described in any one of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a web-based video playback method as described in any one of the above.
The invention provides a webpage-based video playing method, a device, equipment, a storage medium and a product, wherein a browser end comprises a control component and a video playing component, and the control component is used for receiving video playing instructions, wherein the video playing instructions comprise a play window creation instruction and a video stream processing instruction; responding to an instruction for creating a playing window, and generating the playing window in a webpage at a browser end through a video playing component; and responding to the video stream processing instruction, receiving the video data packet through the video playing component, decoding the video data packet to obtain a target video, and displaying the target video in a playing window. The invention responds to the video playing instruction and realizes video playing by adding the control component and the video playing component in the browser, does not need to use the existing components of the browser to encode and decode the video data packet, can effectively solve the problems of page clamping and delay, does not need to configure different decoders, and has low requirement on the performance of the computer.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a video playing method based on web pages provided by the invention;
FIG. 2 is a schematic diagram of the communication control of the control assembly and video playback assembly of the present invention;
fig. 3 is a schematic structural diagram of a video playing device based on web pages according to the present invention;
fig. 4 is a schematic structural diagram of an embodiment of the electronic device of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
When the existing components of the browser are used for realizing video playing, the problems of page blocking and delay are serious as the playing time is longer, and the requirement on the performance of a computer is high.
Based on the above, the invention provides a video playing method, device, equipment, storage medium and product based on a webpage, which are used for solving the defects that when the video playing is realized by using the existing components of a browser in the prior art, the problems of page clamping and delay are serious along with longer playing time, and the requirement on the performance of a computer is high.
Referring to fig. 1, fig. 1 is a flowchart of a web-based video playing method provided by the present invention, in this embodiment, a browser side includes a control component and a video playing component, the web-based video playing method specifically includes steps 110 to 140, and each step specifically includes:
step 110: and receiving a video playing instruction through the control component.
Video play instructions refer to commands or instructions that control a video player component to perform a particular operation.
In this embodiment, the video play instruction includes a create play window instruction and a process video stream instruction.
It should be noted that, since the existing components of the browser are configured by the manufacturer, the decoders configured by different manufacturers for the browser may be different, so that decoding of video data packets based on different video coding standards cannot be necessarily achieved by using the existing components of the browser, which results in that video playing based on different video coding standards cannot be achieved.
In this embodiment, the control component and the video playing component included in the browser end are not browser components configured by the manufacturer, but are control components and video playing components capable of adapting to different browsers, and the control component and the video playing component can be integrated with the existing browser to achieve rapid page integration, so that the problem that the existing browser does not support different video coding modes is solved, the application scene is enlarged, and the user experience can be effectively improved.
In addition, since there is no need to configure a different video encoder in the browser, development costs can be reduced.
Alternatively, the control component and video playback component can be developed based on C language, java, python, C ++, jquery, javascript, vue, etc., which is not limited in this embodiment.
Preferably, the control component can be developed based on js (JavaScript) and saved as a file with js as an extension; the video playing component may be developed based on the C language and saved as an exe file (executable file).
Step 120: and responding to the instruction of creating the playing window, and generating the playing window in the webpage at the browser side through the video playing component.
The video playing component is a module or a plug-in component which can be used for playing video content in a browser webpage, and can provide related functions and interfaces so as to realize operations such as loading, playing, suspending, jumping and controlling of the video on the browser side.
Alternatively, the video playback component can be implemented based on a front-end language or framework (e.g., HTML, CSS, and JavaScript) and interact with existing functions and interfaces of the browser.
Alternatively, the video playback component can be employed to enable receiving or sending video files, streaming media, or network assets, etc., and decoding, rendering, and presenting the assets to a user.
Alternatively, the functions of the video playing component may implement playing control, time and progress display, volume control, playing mode, error handling, volume control, and the like, which is not limited in this embodiment.
Specifically, the instruction for creating the playing window may include information such as time, size, resolution, creation position and the like of the creating window, and the video playing component may create a corresponding playing window in the web page at the browser end based on the information included in the instruction for creating the playing window, so as to perform subsequent video playing operations.
Step 130: and responding to the video stream processing instruction, receiving the video data packet through the video playing component, and decoding the video data packet to obtain the target video.
Video data packets are data units in a video file or stream that contain specific content of a target video, and may be transmitted and stored in a specific format and protocol.
For example, in common video file formats, such as MP4, AVI, MKV, etc., video data packets are typically in the form of frames (frames), each of which contains one continuous image of the video, such as key frames (keyframes) and non-key frames (non-keyframes), which are important reference points in the video sequence that can be independently decoded and displayed, while non-key frames rely on key frames or other non-key frames for decoding and display.
For video streaming, the video data packets are transmitted in the form of a stream, for example, by the real time transport protocol (RTSP) or streaming media transport protocol (HTTP Live Streaming), etc. Video streams are typically composed of successive video data packets to enable real-time playback of video.
The content of the video data packets is compressed data processed by a video encoder, typically using a video compression standard such as h.264 (AVC) or H.265 (HEVC). These compression standards compress video images using coding algorithms to reduce file size and improve transmission efficiency.
Specifically, the video stream processing instruction may include a video encoding standard, a type of a video encoder, data of a video data packet, and the like, and the video playing component receives the corresponding video data packet according to information included in the video stream processing instruction, and decodes the video data packet to obtain the target video.
Optionally, in the video playing process, after the video playing component decodes and renders the received video data packet, the original image of the video can be restored and played.
Step 140: and displaying the target video in the playing window.
Optionally, the decoded target video data may contain frame images, audio data, and other additional metadata information to support the complete playback experience of the video.
According to the webpage-based video playing method provided by the embodiment, the browser side comprises a control component and a video playing component, a video playing instruction is received through the control component, and the video playing instruction comprises a playing window creating instruction and a video stream processing instruction; responding to an instruction for creating a playing window, and generating the playing window in a webpage at a browser end through a video playing component; and responding to the video stream processing instruction, receiving the video data packet through the video playing component, decoding the video data packet to obtain a target video, and displaying the target video in a playing window. The invention responds to the video playing instruction and realizes video playing by adding the control component and the video playing component in the browser, does not need to use the existing components of the browser to encode and decode the video data packet, can effectively solve the problems of page clamping and delay, does not need to configure different decoders, and has low requirement on the performance of the computer.
In some embodiments, after generating a play window in a web page at a browser end by a video play component, the method includes: receiving a play window adjustment instruction through a control component; and responding to the play window adjustment instruction, and adjusting the size and/or the position of the play window through the video play component.
In different application scenarios, adjustments may be required to the size and/or position of the playback window.
For example, when a video for community monitoring needs to be played on a browser webpage, a monitoring playing mode can be selected, and at this time, a plurality of playing windows with consistent sizes can be generated on the same webpage through a video playing component, and videos of different monitoring cameras are played through different playing windows; when a movie or a television play needs to be played on a browser webpage, an entertainment playing mode can be selected, and at the moment, a video playing window can be generated on the webpage through a video playing component and played in a full screen mode.
It can be appreciated that the function of adjusting the size and/or the position of the play window can meet the basic requirements of different fields such as kitchen range, community monitoring, intelligent security and protection and the like.
When the user has a need of adjusting the play window, the user can input a corresponding play window adjustment instruction. The play window adjustment instruction can comprise the type of the play window, size information to be adjusted, position information to be adjusted and the like, and can be received through the control component; in response to the play window adjustment instruction, the video play component may adjust the size and/or position of the play window in accordance with information contained in the play window adjustment instruction.
In some embodiments, generating, by the video playback component, a playback window in a web page at the browser side in response to the create playback window instruction includes: responding to an instruction of creating a playing window, and generating a first playing window and a second playing window in a webpage of a browser end through a video playing component; receiving a video data packet in response to a video stream processing instruction, and decoding the video data packet through a video playing component to obtain a target video, wherein the video stream processing instruction comprises the following steps: receiving a first video data packet and a second video packet in response to processing the video stream instruction; decoding the first video data packet and the second video data packet through the video playing component to obtain a first target video and a second target video; displaying the target video in the play window, including: displaying a first target video in a first playing window; and displaying the second target video in the second playing window.
Optionally, when multi-screen playing is required, a plurality of browser webpages can be opened, different browser webpages can have different playing windows, and each playing window of the different browser webpages can be adjusted by corresponding window adjusting instructions.
Alternatively, different playback windows may play the same or different videos.
Specifically, in response to different video stream processing instructions, different video data packets can be received, the different data packets can be generated based on different video coding standards, and the different video data packets are respectively decoded by the video playing component by adopting algorithms corresponding to the different video coding standards to obtain corresponding target videos.
In some embodiments, prior to receiving the video play instruction by the control component, comprising: sending a control port registration instruction to the video playing component through the control component; and responding to the control port registration instruction, and sending a control port registration result to the control component through the video playing component.
Port registration refers to establishing a communication port or channel for data transfer and communication between the control component and the video playback component.
Alternatively, the communication port or channel may be bi-directional such that the control component may send instructions to the video playback component and receive responses or status updates from the video playback component.
Specifically, the control component can send a control port registration instruction to the video playing component, the control port registration instruction can include a port number or other parameters required by communication, the video playing component can receive and process a registration request in the control port registration instruction in response to the control port registration instruction, if the current registration request is checked to be a valid request, an available communication port is allocated or other necessary communication mechanisms are established, and information that the control port registration is successful is sent to the control component through the video playing component; and if the current registration request is checked to be an invalid request, sending information of failed registration of the control port to the control component through the video playing component.
Optionally, for different browser webpages, control port registration can be performed through a control port registration instruction, and a control port registration result is returned through a registration notification interface.
In some embodiments, after displaying the target video in the play window, comprising: receiving an input instruction of a user through a control component; in response to the input instruction, the video playing component controls to pause/play/end/screenshot the target video in the playing window.
Optionally, the user may input an instruction by touching a screen, inputting a keyboard, clicking a mouse, etc., and the input instruction of the user may include control information on the video, such as pause, play, end, screenshot, rollback, store, forward, etc.
Specifically, the control component may monitor and receive an input instruction of a user, and respond to the input instruction, and control related control operations on the target video in the playing window through the video playing component according to preset processing logic.
Alternatively, the user's input instruction may contain control information for resource release.
After the video is played, the resource release can be realized according to the input instruction of the user, so that the problem that the played video still occupies the resources of the browser, and the problems of page blocking and delay caused by insufficient resources are solved. In addition, the released resources can be used for meeting other playing requirements, so that smooth playing of the video is realized, and the problem of video stream interruption is solved to a certain extent.
In some embodiments, the control component and the video playback component utilize Socket for bi-directional communication.
Socket, i.e., socket, is an abstraction of endpoints that perform bi-directional communication between application processes, providing a mechanism for application layer processes to exchange data using network protocols.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating communication control between a control unit and a video playing unit according to the present invention.
The control component and the video playing component can establish Socket connection so that the control component and the video playing component can use Socket to carry out two-way communication. In this way, the control component can send instructions to the video playback component, which can also send status information or other responses to the control component.
The control component may be integrated in a browser page, and communicate with the video playing component through Socket, for example, signaling interactions between registering the control API (Application Program Interface ), creating the play window API, destroying the play window API, etc. may be implemented through Socket.
As shown in fig. 2, the video playing component 220 may be further divided into a command interaction module 221, a player display module 222, and other functional modules 223 according to functions; the video playing component 220 and the control component 210 integrated at the web page end of the browser realize two-way communication through Socket.
Wherein, the command interaction module 221 is configured to process signaling interaction with the control component; the player display module 222 is used for realizing the playing and display control of the video; other functional modules 223 may be used to handle functions unrelated to command interactions and the play display of video.
The invention also provides a video playing device based on web pages, please refer to fig. 3, fig. 3 is a schematic structural diagram of the video playing device based on web pages provided by the invention, and the video playing device based on web pages comprises a control component 310 and a video playing component 320.
A control component 310 for receiving video play instructions.
The video playing instruction comprises a playing window creation instruction and a video stream processing instruction.
A video playing component 320, configured to generate a playing window in a web page at the browser end in response to the instruction for creating the playing window; receiving a video data packet through a video playing component in response to a video stream processing instruction, and decoding the video data packet to obtain a target video; and displaying the target video in the playing window.
In some embodiments, the control component is further configured to receive a play window adjustment instruction; and the video playing component is also used for responding to the playing window adjusting instruction and adjusting the size and/or the position of the playing window through the video playing component.
In some embodiments, the video playing component is further configured to generate, in response to the instruction to create the playing window, a first playing window and a second playing window in a web page at the browser end through the video playing component; receiving a first video data packet and a second video packet in response to processing the video stream instruction; decoding the first video data packet and the second video data packet through the video playing component to obtain a first target video and a second target video; displaying a first target video in a first playing window; and displaying the second target video in the second playing window.
In some embodiments, the control component is further configured to send a control port registration instruction to the video playback component; and the video playing component is also used for responding to the control port registration instruction and sending a control port registration result to the control component.
In some embodiments, the control component is further configured to receive an input instruction from a user; and the video playing component is also used for responding to the input instruction and controlling to pause/play/end/screenshot the target video in the playing window.
In some embodiments, the control component and the video playback component utilize Socket for bi-directional communication.
The invention also provides an electronic device, referring to fig. 4, fig. 4 is a schematic structural diagram of an embodiment of the electronic device of the invention. In this embodiment, the electronic device may include a memory (memory) 410, a processor (processor) 420, and a computer program stored on the memory 420 and executable on the processor 410. The processor 410 implements the web-based video playing method provided by the above methods when executing the program.
Optionally, the electronic device may further comprise a communication bus 430 and a communication interface (Communications Interface) 440, wherein the processor 410, the communication interface 440, and the memory 420 complete communication with each other via the communication bus 430. The processor 410 may invoke logic instructions in the memory 420 to perform a web-based video playback method comprising: receiving a video playing instruction through a control component, wherein the video playing instruction comprises a playing window creating instruction and a video stream processing instruction; responding to an instruction for creating a playing window, and generating the playing window in a webpage at a browser end through a video playing component; receiving a video data packet through a video playing component in response to a video stream processing instruction, and decoding the video data packet to obtain a target video; and displaying the target video in the playing window.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for playing video based on web pages provided by the above methods, and the steps and principles thereof are described in detail in the above methods and are not described herein.
The present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program may be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer is capable of executing the webpage-based video playing method provided by the above methods, and the steps and principles of the method are described in detail in the above methods and are not repeated herein.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The webpage-based video playing method is characterized in that a browser side comprises a control component and a video playing component, and comprises the following steps:
receiving a video playing instruction through the control component, wherein the video playing instruction comprises a playing window creating instruction and a video stream processing instruction;
responding to the instruction for creating the playing window, and generating the playing window in the webpage of the browser end through the video playing component;
responding to the video stream processing instruction, receiving a video data packet through the video playing component, and decoding the video data packet to obtain a target video;
and displaying the target video in the playing window.
2. The method for playing video based on web page according to claim 1, wherein after the generating, by the video playing component, a playing window in the web page at the browser side, the method comprises:
receiving a play window adjustment instruction through the control component;
and responding to the play window adjustment instruction, and adjusting the size and/or the position of the play window through the video play component.
3. The web-based video playing method according to claim 1, wherein the generating, by the video playing component, a playing window in a web page at a browser end in response to the command to create the playing window comprises:
responding to the instruction of creating the playing window, and generating a first playing window and a second playing window in a webpage of a browser side through the video playing component;
the responding to the video stream processing instruction, receiving a video data packet, and decoding the video data packet by the video playing component to obtain a target video, including:
receiving a first video data packet and a second video packet in response to the processing video stream instruction;
decoding the first video data packet and the second video data packet through the video playing component respectively to obtain a first target video and a second target video;
the displaying the target video in the playing window comprises the following steps:
displaying the first target video in the first playing window;
and displaying the second target video in the second playing window.
4. The web-based video playback method as recited in claim 1, wherein prior to receiving a video playback instruction by the control component, comprising:
sending a control port registration instruction to the video playing component through the control component;
and responding to the control port registration instruction, and sending a control port registration result to the control component through the video playing component.
5. The web-based video playback method as recited in claim 1, wherein after the target video is displayed in the playback window, comprising:
receiving an input instruction of a user through the control component;
and responding to the input instruction, and controlling to pause/play/end/screenshot the target video in the playing window through the video playing component.
6. The web-based video playback method as recited in claim 1, wherein the control component and the video playback component utilize Socket for bi-directional communication.
7. The webpage-based video playing device is characterized by comprising a control component and a video playing component;
the control component is used for receiving video playing instructions, wherein the video playing instructions comprise a play window creation instruction and a video stream processing instruction;
the video playing component is used for responding to the command of creating the playing window and generating the playing window in the webpage of the browser end; responding to the video stream processing instruction, receiving a video data packet through the video playing component, and decoding the video data packet to obtain a target video; and displaying the target video in the playing window.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the web-based video playback method of any one of claims 1 to 6 when the program is executed.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the web-based video playback method of any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the web-based video playback method of any one of claims 1 to 6.
CN202310620883.5A 2023-05-29 2023-05-29 Video playing method, device, equipment, storage medium and product based on webpage Pending CN116781977A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310620883.5A CN116781977A (en) 2023-05-29 2023-05-29 Video playing method, device, equipment, storage medium and product based on webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310620883.5A CN116781977A (en) 2023-05-29 2023-05-29 Video playing method, device, equipment, storage medium and product based on webpage

Publications (1)

Publication Number Publication Date
CN116781977A true CN116781977A (en) 2023-09-19

Family

ID=87990568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310620883.5A Pending CN116781977A (en) 2023-05-29 2023-05-29 Video playing method, device, equipment, storage medium and product based on webpage

Country Status (1)

Country Link
CN (1) CN116781977A (en)

Similar Documents

Publication Publication Date Title
US10567809B2 (en) Selective media playing method and apparatus according to live streaming and recorded streaming
US20220263885A1 (en) Adaptive media streaming method and apparatus according to decoding performance
US10979785B2 (en) Media playback apparatus and method for synchronously reproducing video and audio on a web browser
US11089349B2 (en) Apparatus and method for playing back and seeking media in web browser
CN111221491A (en) Interaction control method and device, electronic equipment and storage medium
US11909799B2 (en) Media playback apparatus and method including delay prevention system
JP6511038B2 (en) Cloud streaming service providing method and apparatus therefor
KR101942270B1 (en) Media playback apparatus and method including delay prevention system
CN116781977A (en) Video playing method, device, equipment, storage medium and product based on webpage
CN115022725A (en) Video playing method and device
CN117319592B (en) Cloud desktop camera redirection method, system and medium
US11973820B2 (en) Method and apparatus for mpeg dash to support preroll and midroll content during media playback
US20230224557A1 (en) Auxiliary mpds for mpeg dash to support prerolls, midrolls and endrolls with stacking properties
WO2023040825A1 (en) Media information transmission method, computing device and storage medium
CN116567321A (en) Data processing method, device, equipment and medium

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