CN113905277A - Method and device for playing video by browser and electronic equipment - Google Patents

Method and device for playing video by browser and electronic equipment Download PDF

Info

Publication number
CN113905277A
CN113905277A CN202111494875.8A CN202111494875A CN113905277A CN 113905277 A CN113905277 A CN 113905277A CN 202111494875 A CN202111494875 A CN 202111494875A CN 113905277 A CN113905277 A CN 113905277A
Authority
CN
China
Prior art keywords
file
video
target
template
control method
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.)
Granted
Application number
CN202111494875.8A
Other languages
Chinese (zh)
Other versions
CN113905277B (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.)
Beijing Xinpianchang Media Co ltd
Original Assignee
Beijing Xinpianchang Media 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 Beijing Xinpianchang Media Co ltd filed Critical Beijing Xinpianchang Media Co ltd
Priority to CN202111494875.8A priority Critical patent/CN113905277B/en
Publication of CN113905277A publication Critical patent/CN113905277A/en
Application granted granted Critical
Publication of CN113905277B publication Critical patent/CN113905277B/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/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/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8173End-user applications, e.g. Web browser, game

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention provides a method and a device for playing videos by a browser end and electronic equipment, wherein the method comprises the following steps: generating a non-decimal configuration file in advance, wherein the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods; loading and executing the configuration file by the browser end; and when the target video needs to be operated, calling the video control method in the global object, and operating the target video based on the video control method. According to the method, the device and the electronic equipment for playing the video by the browser end, provided by the embodiment of the invention, the configuration file is a binary non-decimal file and the like, so that the video control method can be packaged in the black box of the configuration file, other users are difficult to crack the configuration file and cannot tamper the configuration file through tools, the user is effectively prevented from acquiring a source video file, and the video security can be improved.

Description

Method and device for playing video by browser and electronic equipment
Technical Field
The invention relates to the technical field of video playing, in particular to a method and a device for playing videos by a browser end, electronic equipment and a computer readable storage medium.
Background
Currently, after a student purchases a paid course, the student can access a course website through a browser (such as a Chrome browser) on a computer side to perform playing and learning of the relevant course. In the course playing process, at the browser end, html video tags are used for conventional video playing and drawing, or watermarks are further added at the webpage end to cover the upper part of the video elements (the level values are larger than the video elements).
For the current scheme, because the content of the url and the watermark elements of the video is directly exposed in the current document node, the user can easily download the source video file relatively easily by using some tools or corresponding technical means, or remove and change the watermark and record the screen, so that the original video of the course is leaked, and the user who records the screen is difficult to track.
Disclosure of Invention
In order to solve the existing technical problem, embodiments of the present invention provide a method and an apparatus for playing a video by a browser, an electronic device, and a computer-readable storage medium.
In a first aspect, an embodiment of the present invention provides a method for a browser to play a video, where the method includes:
generating a non-decimal configuration file in advance, wherein the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods;
loading and executing the configuration file by the browser end;
and when the target video needs to be operated, calling the video control method in the global object, and operating the target video based on the video control method.
In a second aspect, an embodiment of the present invention further provides an apparatus for playing a video by a browser, where the apparatus includes:
the device comprises a configuration module, a video control module and a display module, wherein the configuration module is used for generating a non-decimal configuration file in advance, the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods;
the loading module is used for loading and executing the configuration file by the browser end;
and the operation module is used for calling the video control method in the global object when the target video needs to be operated, and operating the target video based on the video control method.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored on the memory and executable on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, the method for playing a video at a browser end according to any one of the above-mentioned steps is implemented.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the method for playing a video by a browser-side described above.
According to the method, the device, the electronic equipment and the computer readable storage medium for playing the video by the browser end, the global object is set by using the preset configuration file, the global object comprises a plurality of video control methods, and the browser end can use the video control methods at any time by calling the global object, so that the operation on the target video is realized. The configuration file is a binary non-decimal file and the like, so that the video control method can be packaged in the black box of the configuration file, other users are difficult to crack the configuration file and cannot tamper the configuration file through tools, the user is effectively prevented from acquiring the source video file, and the video safety can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
Fig. 1 is a flowchart illustrating a method for playing a video by a browser according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram illustrating an apparatus for playing a video at a browser end according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for executing a method for playing a video by a browser according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described below with reference to the drawings.
Fig. 1 shows a flowchart of a method for playing a video by a browser end according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step 101: generating a non-decimal configuration file in advance, wherein the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods.
In the embodiment of the invention, the video control method is a method required by a browser end in the process of operating a video to be played, and the video control method can comprise an initialization method, a video player generation method and an operation object acquisition method. The initialization method is used for performing initialization processing, such as initializing a target video to be played, or initializing an object required in an operation process; the method for generating the video player is used for generating the video player in the video playing area so as to play the target video based on the video player; the method for obtaining the operation object is used for obtaining the object required in the video playing process so as to realize the operation on the target video based on the object. Wherein the object may be a canvas object or the like.
In order to avoid that a user can easily locate codes related to operating videos of a browser end, the embodiment of the invention sets a new object, namely a global object, for the browser end globally, and adds video control methods for operating a video player to the global object, so that the browser end can call the video control methods when playing videos. Moreover, the global object depends on a non-decimal configuration file, and a non-decimal code is used for describing a code (such as a video label) of the browser end, so that after the browser end loads the configuration file, an initial source code cannot be directly displayed, a user is prevented from quickly positioning a code related to an operation video, and the difficulty of downloading a source video file by the user is increased. The configuration file may be a binary file, such as a wasm file, and the user cannot crack the binary wasm file or tamper with the binary file through other tools.
Step 102: and loading and executing the configuration file by the browser.
Step 103: and when the target video needs to be operated, calling a video control method in the global object, and operating the target video based on the video control method.
In the embodiment of the invention, the browser end can acquire the configuration file; for example, the configuration file is pre-stored in a corresponding Network path, for example, under a Content Delivery Network (CDN) domain name of a video provider, and the browser may obtain the configuration file through a get request, and then may load and execute the configuration file. In the case where the configuration file is a binary file, the file response setting of the get request may be changed to a typed array arraybuffer.
When a user needs to watch a certain video, the user needs to play the video by using a browser, and the video is called a target video in the embodiment. A user can initiate a request to a server by using a browser end, so that a corresponding target video can be obtained; and in the process of operating the target video, the browser terminal can call the video control method in the configuration file by executing the configuration file, namely the video control method can be used at any time to realize the operation on the target video. For example, the user may play, pause, stop the target video.
Optionally, a function of adding a watermark may also be embedded in the configuration file to prevent a user from acquiring the video resource through screen recording. Likewise, since the configuration file is a non-decimal file, it is difficult for a user to directly delete the watermark, and in the presence of screen recording, the user who records the screen can be tracked based on the watermark.
According to the method for playing the video by the browser end, the global object is set by using the preset configuration file, the global object comprises a plurality of video control methods, and the browser end can use the video control methods at any time by calling the global object, so that the operation of the target video is realized. The configuration file is a binary non-decimal file and the like, so that the video control method can be packaged in the black box of the configuration file, other users are difficult to crack the configuration file and cannot tamper the configuration file through tools, the user is effectively prevented from acquiring the source video file, and the video safety can be improved.
On the basis of the above embodiment, the step 101 of "generating a non-decimal configuration file in advance" includes:
step A1: and generating a main file in a first language format based on a preset template file.
Step A2: and compiling the main file to generate a configuration file in a second language format, wherein the second language format is a binary format.
In this embodiment of the present invention, the configuration file may be a file in a binary format, for example, a wasm file, where the contents are all binary 0 or binary 1. The present embodiment generates the configuration file in a manner of converting the first language format into a file in a binary format. Specifically, the embodiment may first generate a main file in the first language format, and then compile the main file into a file in a binary format, that is, a configuration file in the second language format. For example, the first language format may be a Go language format, and a master file of the Go language may be compiled and packaged into a configuration file of a wasm format by using a construction tool such as rollup. In order to generate the main file quickly, the embodiment generates the main file in the first language format by using a preset template file. The template file is a template capable of containing the video control methods required by the configuration file.
Optionally, in order to adjust the video control method conveniently, the template file does not directly include the content corresponding to the video control method. Specifically, the step a1 "generating the master file in the first language format based on the preset template file" includes:
step A11: and presetting a source code directory and an object code directory.
In the embodiment of the invention, the generated configuration file is used as an independent project to carry out source code compiling and packaging, so that unified maintenance, version alternation and the like are facilitated. Wherein, a source code directory and an object code directory are provided. In this embodiment, the source code directory is a directory structure, which corresponds to a part of the storage space and is used to set an original file used in a process of generating a configuration file, such as a template file. The object code directory is also a directory structure, which also corresponds to a part of the storage space and is used for setting the generated configuration file; the object code directory is also used for storing an intermediate file generated in the process of generating the configuration file, and the intermediate file is also used for generating the configuration file, for example, the intermediate file can be a target resource file described below.
Step A12: and setting at least one source resource file positioned in the source code directory, wherein the source resource file comprises a video operation function corresponding to at least one video control method.
Step A13: and carrying out confusion processing on variables in the video operation function to generate a target resource file which corresponds to the source resource file and is positioned in the target code directory.
Step A14: and setting a template file positioned in the source code directory, wherein the template file comprises a plurality of template variables corresponding to the video control method.
Step A15: and replacing corresponding template variables in the template file based on the target resource file, and generating a main file in the first language format based on the replaced template file.
In an embodiment of the present invention, the template file and at least one source resource file are set in the source code directory, where the source resource file is used to provide the essential content of the video control method, and includes a video operation function corresponding to at least one video control method; for example, the video operation function is a method function capable of operating video, such as a play function, a pause function, and the like. The template file does not contain the essential content, but contains variables that can be replaced, namely template variables. In this embodiment, one template variable may correspond to one video control method, and then, by replacing the template variable, the substance content (e.g., the video operation function) of the video control method may be embedded into the template file.
In order to further improve the security and increase the difficulty of code cracking, the embodiment also performs obfuscation processing on the resources in the source resource file, and obfuscates variables in the source resource file into characters in other formats. Specifically, only the variable in the video operation function is subjected to obfuscation processing, and other contents (such as a function name and the like) in the video operation function are not processed; by obfuscating the variables, target resource files may be generated that correspond one-to-one with the source resource files and placed in the target code directory. For example, part of the content in the source resource file is: function () { var t =1; }, where the variables include "t" and "1", and when they are obfuscated, the obfuscated result may be: function () { var _0x1edef4= _0x43a 739;).
After the target resource file is generated, the template variables in the template file can be replaced by the target resource file, so that the obfuscated essential content is added to the template file, and then the main file in the first language format is generated based on the template file, so that the essential content such as the video control method in the main file is obfuscated, and finally the video control method in the configuration file is obfuscated, and even if the obfuscated content is obtained by other subsequent users, such as "_ 0x1edef 4", etc., the meaning of the content cannot be derived, so that the relevant information of the video resource, such as the download address of the video resource, etc., is difficult to obtain from. In the embodiment of the invention, the template file has the variable which can be used as the template and can represent the corresponding video control method after being replaced by the target resource file, and the confused target resource file replaces the template variable, so that not only are the projects of multiple versions conveniently developed and maintained, but also the safety of the video resource can be further improved.
Optionally, the server issues the encrypted target video to the browser end, and the browser end decrypts the encrypted target video first and then normally plays the target video. Specifically, as described above, the video control method includes an initialization method, a video player generation method, and an operation object acquisition method; and, the initialization method includes a decryption function. Wherein, the step 103 of operating the target video based on the video control method includes:
step B1: calling a decryption function in the initialization method to decrypt the encrypted target video; and operating the decrypted target video based on the video control method.
In the embodiment of the invention, when the browser end needs to play the target video, the browser end firstly calls the initialization method to realize initialization. And the initialization method comprises a decryption function, so that the encrypted target video can be decrypted in the initialization process to obtain the original target video, and further the browser end can play the target video. By encrypting the target video, the security of the video resource can also be improved.
Optionally, the server encrypts the target video to enable the encrypted target video to go below the browser end. Specifically, the method may further include:
step C1: setting an encryption and decryption file positioned in a source code directory, wherein the encryption and decryption file comprises an encryption function corresponding to a decryption function; the encryption function is used for encrypting the target video to be sent to the browser end and encrypting the target video.
In the embodiment of the invention, the server is also provided with an encryption and decryption file which can be specifically arranged in a source code directory; and encrypting the target video by using the encryption function in the encryption and decryption file so as to obtain the encrypted target video and further sending the encrypted target video to the browser end. The Encryption function and the decryption function are two corresponding functions, for example, both functions are functions in an aes (advanced Encryption standard) algorithm, or an asymmetric Encryption manner may also be adopted, which is not limited in this embodiment. For example, the encryption function can be realized by using core function packages such as crypto/aes, crypto/cipher, encoding/hex, pkcs7, and the like.
In the embodiment of the invention, although the configuration file contains the decryption function, as the configuration file is not decimal, other users cannot locate the configuration file and obtain the detailed parameters of the decryption function from the configuration file even if obtaining the configuration file, and higher security can be ensured even if adopting a symmetric encryption mode such as AES and the like.
The following describes a detailed flow of a method for playing a video by the browser end according to an embodiment.
In the embodiment of the invention, the files in the wasm format are used as the configuration files, and the characteristic that the files in the wasm format can be compiled by using the Go language is utilized to generate the main files in the Go language format (namely the first language format), so that the configuration files in the wasm format (namely the second language format) are obtained. The method for playing the video by the browser end comprises the following steps:
step D1: the source code directory src and the target code directory dist are preset.
Step D2: and setting a template file in a txt format and a plurality of source resource files in a js format for the source code directory src.
Wherein the template file is named m.txt, which contains a plurality of template variables, such as layer _ SCRIPT, apend _ layer _ SCRIPT, etc.; the source resource files comprise an apendplayer.js, an h5player-core.js and the like, wherein the apendplayer.js is mainly used for inserting operations related to the player, and the h5player-core.js mainly comprises core logics of the player, UI settings of the player, a data reporting function and the like.
Step D3: and carrying out confusion processing on variables in the source resource file to generate a target resource file which corresponds to the source resource file and is positioned in the target code directory.
For example, a variable in a source resource file with a confusion path of src/apppendplayer. js generates a corresponding target resource file, which may be the same name as the source resource file. Js is the path of the target resource file under the target code directory.
Step D4: and replacing corresponding template variables in the template file based on the target resource file, and generating a main file in the first language format based on the replaced template file.
For example, the template variable APPEND _ PLAYER _ SCRIPT may be replaced with the target resource file, dis/apppendPlayer. Wherein, the replacement of the template variable can be performed through the read file of nodejs. After the substitution, a main file in Go language format can be generated, and the main file is named as main.
Step D5: and compiling the main file to generate a configuration file in a second language format, and storing the configuration file into a corresponding domain name.
Go language main file can be compiled and packaged into a configuration file in a wasm format by using a construction tool such as rollup, and the configuration file in the wasm format is named as: wasm.
Step D6: and when the target video needs to be played, the browser side initiates a request to the server.
Step D7: and the server issues a target video to the browser end, wherein the target video can be an encrypted target video.
Step D8: and loading and executing the configuration file by the browser.
Wherein, the browser end can obtain the configuration file optimized. Because of being based on Go language, the browser end needs to introduce js support file: wasm _ exec.js; after the wan _ exec.js file exists, a Go object exists globally, then a Go method is directly called to execute a binary configuration file optimized.
Step D9: and calling a video control method in the global object, and operating the target video based on the video control method.
The method for playing the video by the browser end provided by the embodiment of the present invention is described above in detail, and the method may also be implemented by a corresponding apparatus.
Fig. 2 is a schematic structural diagram illustrating an apparatus for playing a video at a browser end according to an embodiment of the present invention. As shown in fig. 2, the apparatus for playing a video by a browser includes:
the configuration module 21 is configured to generate a non-decimal configuration file in advance, where the configuration file is provided with a global object at a browser end, and the global object includes multiple video control methods;
the loading module 22 is used for loading and executing the configuration file by the browser end;
the operation module 23 is configured to, when a target video needs to be operated, invoke the video control method in the global object, and operate the target video based on the video control method.
On the basis of the above embodiment, the configuration module 21 includes:
the main file generating unit is used for generating a main file in a first language format based on a preset template file;
and the compiling unit is used for compiling the main file to generate a configuration file in a second language format, and the second language format is a binary format.
On the basis of the above embodiment, the generating unit of the master file generates the master file in the first language format based on the preset template file, including:
presetting a source code directory and a target code directory;
setting at least one source resource file located in the source code directory, wherein the source resource file comprises a video operation function corresponding to at least one video control method;
obfuscating variables in the video operation function to generate a target resource file corresponding to the source resource file and located in the target code directory;
setting the template file located in a source code directory, wherein the template file comprises a plurality of template variables corresponding to the video control method;
and replacing the corresponding template variable in the template file based on the target resource file, and generating a main file in a first language format based on the replaced template file.
On the basis of the above embodiment, the video control method includes an initialization method, a method of generating a video player, and a method of acquiring an operation object; the initialization method comprises a decryption function;
the operation module 23 operates the target video based on the video control method, including:
calling the decryption function in the initialization method to decrypt the encrypted target video;
and operating the decrypted target video based on the video control method.
On the basis of the above embodiment, the apparatus further includes an encryption module configured to:
setting an encryption and decryption file located in the source code directory, wherein the encryption and decryption file comprises an encryption function corresponding to the decryption function; the encryption function is used for encrypting the target video to be sent to the browser end and encrypting the target video.
In addition, an embodiment of the present invention further provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the transceiver, the memory, and the processor are respectively connected via the bus, and when the computer program is executed by the processor, each process of the embodiment of the method for playing a video at a browser end is implemented, and the same technical effect can be achieved, and therefore, details are not described here to avoid repetition.
Specifically, referring to fig. 3, an embodiment of the present invention further provides an electronic device, which includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.
In an embodiment of the present invention, the electronic device further includes: a computer program stored on the memory 1150 and executable on the processor 1120, wherein the computer program when executed by the processor 1120 implements the processes of the above-mentioned method embodiment for playing video by a browser.
A transceiver 1130 for receiving and transmitting data under the control of the processor 1120.
In embodiments of the invention in which a bus architecture (represented by bus 1110) is used, bus 1110 may include any number of interconnected buses and bridges, with bus 1110 connecting various circuits including one or more processors, represented by processor 1120, and memory, represented by memory 1150.
Bus 1110 represents one or more of any of several types of bus structures, including a memory bus, and memory controller, a peripheral bus, an Accelerated Graphics Port (AGP), a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include: an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA), a Peripheral Component Interconnect (PCI) bus.
Processor 1120 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method embodiments may be performed by integrated logic circuits in hardware or instructions in software in a processor. The processor described above includes: general purpose processors, Central Processing Units (CPUs), Network Processors (NPs), Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), Complex Programmable Logic Devices (CPLDs), Programmable Logic Arrays (PLAs), Micro Control Units (MCUs) or other Programmable Logic devices, discrete gates, transistor Logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in embodiments of the present invention may be implemented or performed. For example, the processor may be a single core processor or a multi-core processor, which may be integrated on a single chip or located on multiple different chips.
Processor 1120 may be a microprocessor or any conventional processor. The steps of the method disclosed in connection with the embodiments of the present invention may be directly performed by a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), a register, and other readable storage media known in the art. The readable storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The bus 1110 may also connect various other circuits such as peripherals, voltage regulators, or power management circuits to provide an interface between the bus 1110 and the transceiver 1130, as is well known in the art. Therefore, the embodiments of the present invention will not be further described.
The transceiver 1130 may be one element or may be multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. For example: the transceiver 1130 receives external data from other devices, and the transceiver 1130 transmits data processed by the processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as: touch screen, physical keyboard, display, mouse, speaker, microphone, trackball, joystick, stylus.
It is to be appreciated that in embodiments of the invention, the memory 1150 may further include memory located remotely with respect to the processor 1120, which may be coupled to a server via a network. One or more portions of the above-described networks may be an ad hoc network (ad hoc network), an intranet (intranet), an extranet (extranet), a Virtual Private Network (VPN), a Local Area Network (LAN), a Wireless Local Area Network (WLAN), a Wide Area Network (WAN), a Wireless Wide Area Network (WWAN), a Metropolitan Area Network (MAN), the Internet (Internet), a Public Switched Telephone Network (PSTN), a plain old telephone service network (POTS), a cellular telephone network, a wireless fidelity (Wi-Fi) network, and combinations of two or more of the above. For example, the cellular telephone network and the wireless network may be a global system for Mobile Communications (GSM) system, a Code Division Multiple Access (CDMA) system, a Worldwide Interoperability for Microwave Access (WiMAX) system, a General Packet Radio Service (GPRS) system, a Wideband Code Division Multiple Access (WCDMA) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD) system, a long term evolution-advanced (LTE-a) system, a Universal Mobile Telecommunications (UMTS) system, an enhanced Mobile Broadband (eMBB) system, a mass Machine Type Communication (mtc) system, an Ultra Reliable Low Latency Communication (urrllc) system, or the like.
It is to be understood that the memory 1150 in embodiments of the present invention can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Wherein the nonvolatile memory includes: Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or Flash Memory.
The volatile memory includes: random Access Memory (RAM), which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as: static random access memory (Static RAM, SRAM), Dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct memory bus RAM (DRRAM). The memory 1150 of the electronic device described in the embodiments of the invention includes, but is not limited to, the above and any other suitable types of memory.
In an embodiment of the present invention, memory 1150 stores the following elements of operating system 1151 and application programs 1152: an executable module, a data structure, or a subset thereof, or an expanded set thereof.
Specifically, the operating system 1151 includes various system programs such as: a framework layer, a core library layer, a driver layer, etc. for implementing various basic services and processing hardware-based tasks. Applications 1152 include various applications such as: media Player (Media Player), Browser (Browser), for implementing various application services. A program implementing a method of an embodiment of the invention may be included in application program 1152. The application programs 1152 include: applets, objects, components, logic, data structures, and other computer system executable instructions that perform particular tasks or implement particular abstract data types.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program implements each process of the above method for playing a video at a browser end, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The computer-readable storage medium includes: permanent and non-permanent, removable and non-removable media may be tangible devices that retain and store instructions for use by an instruction execution apparatus. The computer-readable storage medium includes: electronic memory devices, magnetic memory devices, optical memory devices, electromagnetic memory devices, semiconductor memory devices, and any suitable combination of the foregoing. The computer-readable storage medium includes: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), non-volatile random access memory (NVRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape cartridge storage, magnetic tape disk storage or other magnetic storage devices, memory sticks, mechanically encoded devices (e.g., punched cards or raised structures in a groove having instructions recorded thereon), or any other non-transmission medium useful for storing information that may be accessed by a computing device. As defined in embodiments of the present invention, the computer-readable storage medium does not include transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses traveling through a fiber optic cable), or electrical signals transmitted through a wire.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electrical, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to solve the problem to be solved by the embodiment of the invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be substantially or partially contributed by the prior art, or all or part of the technical solutions may be embodied in a software product stored in a storage medium and including instructions for causing a computer device (including a personal computer, a server, a data center, or other network devices) to execute all or part of the steps of the methods of the embodiments of the present invention. And the storage medium includes various media that can store the program code as listed in the foregoing.
In the description of the embodiments of the present invention, it should be apparent to those skilled in the art that the embodiments of the present invention can be embodied as methods, apparatuses, electronic devices, and computer-readable storage media. Thus, embodiments of the invention may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), a combination of hardware and software. Furthermore, in some embodiments, embodiments of the invention may also be embodied in the form of a computer program product in one or more computer-readable storage media having computer program code embodied in the medium.
The computer-readable storage media described above may take any combination of one or more computer-readable storage media. The computer-readable storage medium includes: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium include: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only Memory (ROM), an erasable programmable read-only Memory (EPROM), a Flash Memory, an optical fiber, a compact disc read-only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any combination thereof. In embodiments of the invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, device, or apparatus.
The computer program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including: wireless, wire, fiber optic cable, Radio Frequency (RF), or any suitable combination thereof.
Computer program code for carrying out operations for embodiments of the present invention may be written in assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or in one or more programming languages, including an object oriented programming language, such as: java, Smalltalk, C + +, and also include conventional procedural programming languages, such as: c or a similar programming language. The computer program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be over any of a variety of networks, including: a Local Area Network (LAN) or a Wide Area Network (WAN), which may be connected to the user's computer, may be connected to an external computer.
The method, the device and the electronic equipment are described through the flow chart and/or the block diagram.
It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions. These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner. Thus, the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The above description is only a specific implementation of the embodiments of the present invention, but the scope of the embodiments of the present invention is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present invention, and all such changes or substitutions should be covered by the scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for playing videos by a browser side is characterized by comprising the following steps:
generating a non-decimal configuration file in advance, wherein the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods;
loading and executing the configuration file by the browser end;
and when the target video needs to be operated, calling the video control method in the global object, and operating the target video based on the video control method.
2. The method of claim 1, wherein pre-generating the non-decimal configuration file comprises:
generating a main file in a first language format based on a preset template file;
and compiling the main file to generate a configuration file in a second language format, wherein the second language format is a binary format.
3. The method according to claim 2, wherein the generating a master file in a first language format based on a preset template file comprises:
presetting a source code directory and a target code directory;
setting at least one source resource file located in the source code directory, wherein the source resource file comprises a video operation function corresponding to at least one video control method;
obfuscating variables in the video operation function to generate a target resource file corresponding to the source resource file and located in the target code directory;
setting the template file located in a source code directory, wherein the template file comprises a plurality of template variables corresponding to the video control method;
and replacing the corresponding template variable in the template file based on the target resource file, and generating a main file in a first language format based on the replaced template file.
4. The method of claim 3, wherein the video control method comprises an initialization method, a generate video player method, and a get operand method; the initialization method comprises a decryption function;
the operating the target video based on the video control method comprises the following steps:
calling the decryption function in the initialization method to decrypt the encrypted target video;
and operating the decrypted target video based on the video control method.
5. The method of claim 4, further comprising:
setting an encryption and decryption file located in the source code directory, wherein the encryption and decryption file comprises an encryption function corresponding to the decryption function; the encryption function is used for encrypting the target video to be sent to the browser end and encrypting the target video.
6. An apparatus for playing a video at a browser end, comprising:
the device comprises a configuration module, a video control module and a display module, wherein the configuration module is used for generating a non-decimal configuration file in advance, the configuration file is provided with a global object of a browser end, and the global object comprises a plurality of video control methods;
the loading module is used for loading and executing the configuration file by the browser end;
and the operation module is used for calling the video control method in the global object when the target video needs to be operated, and operating the target video based on the video control method.
7. The apparatus of claim 6, wherein the configuration module comprises:
the main file generating unit is used for generating a main file in a first language format based on a preset template file;
and the compiling unit is used for compiling the main file to generate a configuration file in a second language format, and the second language format is a binary format.
8. The apparatus according to claim 7, wherein the master file generating unit generates the master file in the first language format based on a preset template file, including:
presetting a source code directory and a target code directory;
setting at least one source resource file located in the source code directory, wherein the source resource file comprises a video operation function corresponding to at least one video control method;
obfuscating variables in the video operation function to generate a target resource file corresponding to the source resource file and located in the target code directory;
setting the template file located in a source code directory, wherein the template file comprises a plurality of template variables corresponding to the video control method;
and replacing the corresponding template variable in the template file based on the target resource file, and generating a main file in a first language format based on the replaced template file.
9. An electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory and the processor are connected via the bus, and wherein the computer program when executed by the processor implements the steps of the method for playing the video by the browser end according to any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps in the method for playing a video by a browser end according to any one of claims 1 to 5.
CN202111494875.8A 2021-12-09 2021-12-09 Method and device for playing video by browser and electronic equipment Active CN113905277B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111494875.8A CN113905277B (en) 2021-12-09 2021-12-09 Method and device for playing video by browser and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111494875.8A CN113905277B (en) 2021-12-09 2021-12-09 Method and device for playing video by browser and electronic equipment

Publications (2)

Publication Number Publication Date
CN113905277A true CN113905277A (en) 2022-01-07
CN113905277B CN113905277B (en) 2022-03-22

Family

ID=79025823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111494875.8A Active CN113905277B (en) 2021-12-09 2021-12-09 Method and device for playing video by browser and electronic equipment

Country Status (1)

Country Link
CN (1) CN113905277B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143390A (en) * 2010-01-29 2011-08-03 康佳集团股份有限公司 System and method for playing video on line
CN103412748A (en) * 2013-07-25 2013-11-27 深圳Tcl新技术有限公司 Display control method, device and system for user interface of embedded platform
CN104598263A (en) * 2014-12-04 2015-05-06 广州酷狗计算机科技有限公司 Application program operation method and configuration file generating method and device
US20160224192A1 (en) * 2015-01-29 2016-08-04 Net2.Tv, Ltd Systems and methods for a multiplatform video player
CN108319708A (en) * 2018-02-06 2018-07-24 广东欧珀移动通信有限公司 Video broadcasting method, device, storage medium and electronic equipment
CN109032662A (en) * 2018-06-19 2018-12-18 上海陆家嘴国际金融资产交易市场股份有限公司 Code file generation method, device, computer equipment and storage medium
CN109151535A (en) * 2018-08-27 2019-01-04 四川长虹电器股份有限公司 The control method of code stream automatic adjusument in netcast
CN111580809A (en) * 2020-05-07 2020-08-25 讯飞幻境(北京)科技有限公司 Visual webgl framework construction method and device and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143390A (en) * 2010-01-29 2011-08-03 康佳集团股份有限公司 System and method for playing video on line
CN103412748A (en) * 2013-07-25 2013-11-27 深圳Tcl新技术有限公司 Display control method, device and system for user interface of embedded platform
CN104598263A (en) * 2014-12-04 2015-05-06 广州酷狗计算机科技有限公司 Application program operation method and configuration file generating method and device
US20160224192A1 (en) * 2015-01-29 2016-08-04 Net2.Tv, Ltd Systems and methods for a multiplatform video player
CN108319708A (en) * 2018-02-06 2018-07-24 广东欧珀移动通信有限公司 Video broadcasting method, device, storage medium and electronic equipment
CN109032662A (en) * 2018-06-19 2018-12-18 上海陆家嘴国际金融资产交易市场股份有限公司 Code file generation method, device, computer equipment and storage medium
CN109151535A (en) * 2018-08-27 2019-01-04 四川长虹电器股份有限公司 The control method of code stream automatic adjusument in netcast
CN111580809A (en) * 2020-05-07 2020-08-25 讯飞幻境(北京)科技有限公司 Visual webgl framework construction method and device and computer equipment

Also Published As

Publication number Publication date
CN113905277B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
US20170295013A1 (en) Method for fulfilling a cryptographic request requiring a value of a private key
JP6078555B2 (en) Virtual machine device and method using key-driven obfuscation
CN108985081A (en) A kind of watermark encrypting method, apparatus, medium and electronic equipment
CN106415491B (en) Application protection method, server and terminal
CN104239757A (en) Application program reversing-preventing method and device and operation method and terminal
CN111656345B (en) Software module enabling encryption in container files
CN110008662B (en) Application program running method and device, electronic equipment and readable storage medium
US20150121073A1 (en) Software fingerprinting
US20140059341A1 (en) Creating and accessing encrypted web based content in hybrid applications
CN109840400B (en) Apparatus and method for providing security and apparatus and method for performing security for universal intermediate language
CN113568680B (en) Dynamic link library protection method, device, equipment and medium for application program
CN103414733A (en) HLS (HTTP Live Streaming) streaming media playing method and HLS streaming media playing system
CN114547558B (en) Authorization method, authorization control device, equipment and medium
CN106375080B (en) Flash file encryption and decryption method and device
CN113098938B (en) Video sharing method and device and electronic equipment
CN113905277B (en) Method and device for playing video by browser and electronic equipment
KR101667774B1 (en) Apparatus and Method of Providing Security for Script Program
CN103605927A (en) Encryption and decryption method based on embedded Linux system
CN110971581A (en) Encrypted data processing method and device
CN110516468B (en) Method and device for encrypting memory snapshot of virtual machine
CN112311529A (en) Data encryption method, data decryption method and data processing method of database
CN110912697B (en) Scheme request verification method, device and equipment
KR102177920B1 (en) Apparatus and method for packing original source code
CN113946801B (en) Python source code protection method and device based on SGX
CN115952518B (en) Data request method, device, electronic equipment and storage 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
GR01 Patent grant
GR01 Patent grant