Video playing method and device, storage medium and electronic equipment

文档序号:1802518 发布日期:2021-11-05 浏览:26次 中文

阅读说明:本技术 视频播放方法、装置、存储介质及电子设备 (Video playing method and device, storage medium and electronic equipment ) 是由 曹世梅 于 2021-07-20 设计创作,主要内容包括:本申请公开了一种视频播放方法、装置、存储介质及电子设备,涉及互联网技术领域,该方法包括:通过浏览器的外接接口打开浏览器页面;在所述浏览器页面中注入视频播放库的框架代码;通过所述框架代码对外接解密插件的解密功能函数进行复写处理,得到复写功能函数;基于所述复写功能函数,在所述浏览器上通过所述框架代码对加密视频进行解密及播放。本申请便捷地降低视频解密播放耗时,减少任务工作量,降低视频解密播放工作成本。(The application discloses a video playing method, a video playing device, a storage medium and electronic equipment, which relate to the technical field of Internet, and the method comprises the following steps: opening a browser page through an external interface of a browser; injecting a frame code of a video playing library into the browser page; duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function; and based on the copying function, decrypting and playing the encrypted video on the browser through the frame code. The method and the device have the advantages that the video decryption playing is convenient and fast, the time consumption is reduced, the task workload is reduced, and the video decryption playing working cost is reduced.)

1. A video playback method, comprising:

opening a browser page through an external interface of a browser;

injecting a frame code of a video playing library into the browser page;

duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function;

and based on the copying function, decrypting and playing the encrypted video on the browser through the frame code.

2. The method according to claim 1, wherein the decrypting and playing the encrypted video through the frame code on the browser based on the carbon copy function comprises:

when the decryption function decrypts the encrypted video to obtain a certificate request address, acquiring the certificate request address through the duplicating function;

acquiring a video tag created for the encrypted video in the browser page;

and inputting the certificate request address and the video tag into the frame code to trigger the frame code to decrypt and play the encrypted video on the browser.

3. The method of claim 2, wherein the obtaining of the video tag created for the encrypted video in the browser page comprises:

reflecting the service class of the created video tag in the browser page to obtain a reflection function;

and acquiring a video label created by the service class on the encrypted video based on the reflection function.

4. The method of claim 2, wherein entering the certificate request address and the video tag into the framework code comprises:

constructing port data based on the certificate request address;

constructing an entry function corresponding to the frame code;

entering the port data and the video tag into the frame code through the entry function.

5. The method of claim 4, wherein the frame code comprises a decryption service code and a playback service code; the triggering the frame code to decrypt and play the encrypted video on the browser includes:

triggering the decryption service code in the frame code to run on the browser so as to send a certificate request to a digital rights management system according to the port data, receiving a digital certificate returned by the digital rights management system in response to the certificate request, and decrypting the encrypted video based on the digital certificate;

and triggering the running of the playing service code on the browser so as to play the video obtained by decryption according to the video tag.

6. The method of any of claims 1 to 5, wherein the external decryption plug-in comprises a digital rights management plug-in;

the duplicating processing is performed on the decryption function of the external decryption plug-in unit through the frame code to obtain a duplicating function, and the method comprises the following steps:

monitoring whether the browser page calls a decryption function of the digital copyright management plug-in to decrypt the encrypted video;

and when the encrypted video is monitored to be decrypted, triggering the frame code to rewrite the decryption function to obtain a rewrite function.

7. The method of any of claims 1 to 5, wherein the external decryption plug-in comprises a digital rights management plug-in;

the duplicating processing is performed on the decryption function of the external decryption plug-in unit through the frame code to obtain a duplicating function, and the method comprises the following steps:

acquiring the digital copyright management plug-in;

creating an interface corresponding to a decryption function of the digital rights management plug-in;

creating a calling function calling the interface in the framework code so as to take the calling function as the duplicating function.

8. A video playback apparatus, comprising:

the opening module is used for opening a browser page through an external interface of the browser;

the injection module is used for injecting the frame code of the video playing library into the browser page;

the duplication module is used for duplicating the decryption function of the external decryption plug-in unit through the frame code to obtain a duplication function;

and the playing module is used for decrypting and playing the encrypted video on the browser through the frame code based on the copying function.

9. A storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of any one of claims 1 to 7.

10. An electronic device, comprising: a memory storing a computer program; a processor reading a computer program stored in the memory to perform the method of any of claims 1 to 7.

Technical Field

The present application relates to the field of internet technologies, and in particular, to a video playing method and apparatus, a storage medium, and an electronic device.

Background

With the development of video playing technology, the requirement for playing video in a browser page generally appears in various industries, and the requirement for playing encrypted video generally exists in the video playing process, so that the realization of effective playing of the encrypted video in the page is very important.

At present, many browser pages adopt an external decryption plug-in to realize decryption playing of encrypted videos, but many browsers do not directly support the external decryption plug-in, need to rely on a plug-in frame in the browser to realize the external decryption plug-in again in the browser, and need to realize a content decryption frame, so that the problems of time consumption and large task workload of video decryption playing exist.

Disclosure of Invention

The embodiment of the application provides a scheme, which can reduce the time consumption of video decryption and playing conveniently, reduce the workload of tasks and reduce the working cost of video decryption and playing.

In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:

according to an embodiment of the present application, a video playing method includes: opening a browser page through an external interface of a browser; injecting a frame code of a video playing library into the browser page; duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function; and based on the copying function, decrypting and playing the encrypted video on the browser through the frame code.

In some embodiments of the present application, the decrypting and playing an encrypted video through the frame code on the browser based on the carbon copy function includes: when the decryption function decrypts the encrypted video to obtain a certificate request address, acquiring the certificate request address through the duplicating function; acquiring a video tag created for the encrypted video in the browser page; and inputting the certificate request address and the video tag into the frame code to trigger the frame code to decrypt and play the encrypted video on the browser.

In some embodiments of the present application, the obtaining a video tag created for the encrypted video in the browser page includes: reflecting the service class of the created video tag in the browser page to obtain a reflection function; and acquiring a video label created by the service class on the encrypted video based on the reflection function.

In some embodiments of the present application, said entering said certificate request address and said video tag into said framework code comprises: constructing port data based on the certificate request address; constructing an entry function corresponding to the frame code; entering the port data and the video tag into the frame code through the entry function.

In some embodiments of the present application, the frame code includes a decryption service code and a playing service code; the triggering the frame code to decrypt and play the encrypted video on the browser includes: triggering the decryption service code in the frame code to run on the browser so as to send a certificate request to a digital rights management system according to the port data, receiving a digital certificate returned by the digital rights management system in response to the certificate request, and decrypting the encrypted video based on the digital certificate; and triggering the running of the playing service code on the browser so as to play the video obtained by decryption according to the video tag.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; the duplicating processing is performed on the decryption function of the external decryption plug-in unit through the frame code to obtain a duplicating function, and the method comprises the following steps: monitoring whether the browser page calls a decryption function of the digital copyright management plug-in to decrypt the encrypted video; and when the encrypted video is monitored to be decrypted, triggering the frame code to rewrite the decryption function to obtain a rewrite function.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; the duplicating processing is performed on the decryption function of the external decryption plug-in unit through the frame code to obtain a duplicating function, and the method comprises the following steps: acquiring the digital copyright management plug-in; creating an interface corresponding to a decryption function of the digital rights management plug-in; creating a calling function calling the interface in the framework code so as to take the calling function as the duplicating function.

According to an embodiment of the present application, a video playback apparatus includes: the opening module is used for opening a browser page through an external interface of the browser; the injection module is used for injecting the frame code of the video playing library into the browser page; the duplication module is used for duplicating the decryption function of the external decryption plug-in unit through the frame code to obtain a duplication function; and the playing module is used for decrypting and playing the encrypted video on the browser through the frame code based on the copying function.

According to another embodiment of the present application, a storage medium has stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of an embodiment of the present application.

According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and the processor reads the computer program stored in the memory to execute the method in the embodiment of the application.

In the embodiment of the application, a browser page is opened through an external interface of the browser; injecting a frame code of a video playing library into a browser page; duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function; and based on the duplicating function, decrypting and playing the encrypted video on the browser through the frame code.

In this way, when the browser page is opened through the external interface of the browser, the frame code of the video playing library (namely dash. js) is conveniently injected into the browser page, the operation of the frame code is supported through the browser, the decryption function of the external decryption plug-in is subjected to duplicating processing in the browser through the providing capability of the frame code to obtain the duplicating function to realize the decryption function, thereby realizing the video decryption capability without realizing an external plug-in again in the browser and realizing a content decryption framework, and finally, the video can be decrypted and played through the frame code under the support of the source code of the browser based on the duplicating function, the traditional decryption and playing process through the external plug-in is switched to the native decryption and playing process of the browser, and the video playing in the encrypted format is realized on the basis of the source code of the browser, without depending on other modules and without losing the performance.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

FIG. 1 shows a schematic diagram of a system to which embodiments of the present application may be applied.

Fig. 2 shows a flow diagram of a video playback method according to an embodiment of the present application.

Fig. 3 shows a block diagram of a video playback device according to an embodiment of the present application.

FIG. 4 shows a block diagram of an electronic device according to an embodiment of the application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, the principles of the present application are described in the foregoing text and are not meant to be limiting, as those of ordinary skill in the art will appreciate that various steps and operations described below may be implemented in hardware.

FIG. 1 shows a schematic diagram of a system 100 to which embodiments of the present application may be applied. As shown in fig. 1, the system 100 may include a server 101 and a terminal 102. The terminal 102 may be any computer device, such as a computer, a mobile phone, a smart watch, a home appliance, and the like. The server 101 may be a server cluster or a cloud server, etc. In one example, the terminal 102 is a smart television, and the server 101 is a cloud server. The server 101 and the terminal 102 may be directly or indirectly connected by a wired or wireless connection.

The terminal 102 may be installed with a browser, and a video may be played through the browser, and a video resource file of the played video may be sent to the terminal 102 by the server 101, or the terminal 102 requests a video resource file of a required video from the server 101.

In an implementation manner of this example, the terminal 102 may open a browser page through an external interface of the browser; injecting a frame code of a video playing library into a browser page; duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function; and based on the duplicating function, decrypting and playing the encrypted video on the browser through the frame code.

In this way, when the browser page is opened through the external interface of the browser, the frame code of the video playing library (namely dash. js) is conveniently injected into the browser page, the operation of the frame code is supported through the browser, the decryption function of the external decryption plug-in is subjected to duplicating processing in the browser through the providing capability of the frame code to obtain the duplicating function to realize the decryption function, thereby realizing the video decryption capability without realizing an external plug-in again in the browser and realizing a content decryption framework, and finally, the video can be decrypted and played through the frame code under the support of the source code of the browser based on the duplicating function, the traditional decryption and playing process through the external plug-in is switched to the native decryption and playing process of the browser, and the video playing in the encrypted format is realized on the basis of the source code of the browser, without depending on other modules and without losing the performance.

Fig. 2 schematically shows a flow chart of a video playback method according to an embodiment of the present application. The execution subject of the video playing method may be any device, such as the first terminal 102 shown in fig. 1.

As shown in fig. 2, the video playing method may include steps S210 to S240.

Step S210, opening a browser page through an external interface of the browser;

step S220, injecting a frame code of a video playing library into a browser page;

step S230, duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function;

step S240, based on the carbon copy function, the encrypted video is decrypted and played on the browser through the frame code.

The following describes a specific process of each step performed when playing a video.

In step S210, a browser page is opened through an external interface of the browser.

In the embodiment of the present example, an Application (APP) on the terminal may open a browser page through an external interface of the browser, where the browser page may be an html page, and the browser page is opened to play a video to be played.

The application on the terminal can respond to a target video playing command, a browser page is opened through an external interface of the browser, and the target video playing command can be generated when a user triggers playing of a target video through operations such as clicking in the application.

Generally, many videos are encrypted videos which are encrypted and protected for digital contents (e-books, videos, audios, pictures and the like) through a certain security algorithm/protocol and a security management means based on a Digital Rights Management (DRM) technology, so that the encrypted videos cannot be used, copied, distributed and the like under unauthorized and allowed conditions, the propagation of the digital contents in a mobile network can be ensured, and the benefits of content providers can be ensured.

When the browser page plays the encrypted video, the video needs to be decrypted and played. While the native browser page usually needs to rely on an external decryption plug-in (e.g., a drm agent plug-in) to decrypt the encrypted video, the native browser does not directly support the external decryption plug-in (e.g., the drm agent plug-in), needs to rely on a browser plug-in framework to re-implement the plug-in, and needs to implement a content decryption framework, which is time-consuming and labor-consuming. The following embodiments based on the subsequent steps can at least solve these technical problems and achieve better video playing effect.

In step S220, the frame code of the video play library is injected in the browser page.

In the embodiment of the present example, the video play library is a dash.js library, the frame code of the video play library is js code, and the frame code of the video play library is acquired and injected into a running browser page, so that the browser can support the running of the frame code of the video play library. Js, the frame code of the video playing library can be conveniently injected into a browser page, and the operation of the frame code is supported in the browser, so that the capability of transferring the frame code in the browser is realized.

In step S230, the decryption function of the external decryption plug-in is subjected to the duplication processing through the frame code, so as to obtain a duplication function.

In the embodiment of this example, the external decryption plug-in may decrypt the encrypted video, and the external decryption plug-in calls a corresponding decryption function to decrypt the encrypted video when decrypting the encrypted video, and the decryption function may process the encrypted video to obtain a certificate request address of the encrypted video, where the certificate request address is an address requesting a certificate, that is, an address of a server that needs to send the request certificate.

The copying interface of the frame code is triggered to perform copying processing on the decryption function, a copying function is generated in the browser, the browser obtains the same capacity as the decryption function based on the copying function, and when the decryption function obtains the certificate request address, the browser can obtain the certificate request address based on the copying function.

In one embodiment, the external decryption plug-in comprises a digital rights management plug-in; step S230, performing a duplication process on the decryption function of the external decryption plug-in through the frame code to obtain a duplication function, including:

monitoring whether a browser page calls a decryption function of the digital copyright management plug-in to decrypt the encrypted video or not; and when the situation that the encrypted video is decrypted is monitored, triggering the frame code to rewrite the decryption function to obtain a rewrite function.

The external decryption plug-in comprises a digital rights management plug-in, namely a drm plug-in, usually, the browser page can automatically call the digital rights management plug-in to decrypt the video when the encrypted video is opened, and the digital rights management plug-in can call a decryption function (namely a senddrm function) of the digital rights management plug-in to decrypt the video.

At this time, when it is detected that the decryption function is called to decrypt the encrypted video, the frame code is triggered to rewrite the decryption function, dynamic rewriting can be performed as needed, the frame code injected into the browser page through the rewriting is performed to rewrite the decryption function (i.e., senddrmmossage function), so as to obtain the rewriting function, and then the browser page calls the content of the rewriting function, so as to obtain the decryption address information (i.e., message information) of the encrypted video, which is obtained by the decryption function (i.e., senddrmmossage function), where the decryption address information includes the certificate request address.

In one embodiment, the external decryption plug-in comprises a digital rights management plug-in; step S230, performing duplication processing on the decryption function of the external decryption plug-in through the frame code to obtain a duplication function, including:

acquiring a digital copyright management plug-in; creating an interface corresponding to a decryption function of the digital rights management plug-in; and creating a calling function of the calling interface in the framework code so as to take the calling function as a duplicate function.

Through a digital rights management plug-in (i.e., a drm plug-in), a call interface (which may be a Java interface) may be interfaced in its implementation of a decryption function (i.e., a senddrm function), and then, an interface to the framework code may be called through a system channel (e.g., an android channel), and then a call function calling the interface may be created in the framework code as an indirect carbon copy function.

The browser page has the possibility of a complex structure, the possibility of incapability of directly and dynamically triggering the carbon copy processing exists, and the certificate request address cannot be acquired. By the embodiment, the duplicate writing can be indirectly carried out, the duplicate writing function of the middleware can be obtained, and the certificate request address can be ensured to be obtained.

In step S240, the encrypted video is decrypted and played through the frame code on the browser based on the carbon copy function.

In the embodiment of the present example, the same capability as that of the decryption function is obtained based on the duplication function, and when the decryption function obtains the certificate request address, the browser may obtain the certificate request address based on the duplication function.

Furthermore, the browser can obtain a certificate request address based on the duplication function, obtain a certificate for decrypting the encrypted video according to the certificate request address, and then run the frame code under the support of the browser source code to decrypt and play the video. And finally, the video can be decrypted and played through the frame code under the support of the source code of the browser based on the duplicating function, the traditional decryption and playing process through the external plug-in is switched to the original decryption and playing process of the browser, and the video playing in the encrypted format is realized on the basis of the source code of the browser and without depending on other modules and without losing the performance.

In one embodiment, step S240, decrypting and playing the encrypted video through the frame code on the browser based on the carbon copy function includes:

when the decryption function decrypts the encrypted video to obtain the certificate request address, the certificate request address is obtained through the duplicating function; acquiring a video tag created for the encrypted video in a browser page; and inputting the certificate request address and the video label into the frame code to trigger the frame code to decrypt and play the encrypted video on the browser.

The duplication function obtains the same capability as the decryption function, and when the decryption function obtains the information of the certificate request address, the browser can simultaneously obtain the certificate request address based on the duplication function. The browser page creates a corresponding video tag for the encrypted video, and the video tag is used for defining a player to play the video.

After the certificate request address and the video tag are obtained in the browser, the certificate request address and the video tag are input into the frame code, so that the frame code can obtain information required by decryption and playing, and the encrypted video is decrypted and played on the browser in the frame code.

In one embodiment, acquiring a video tag created for an encrypted video in a browser page includes:

reflecting the service class of the created video tag in the browser page to obtain a reflection function; and acquiring a video label created by the service class on the encrypted video based on the reflection function.

The browser page includes a service class for creating a video tag, and the service class is subjected to reflection call setting through a reflection mechanism, a reflection function is set, so that the opportunity for creating the video tag (i.e., a video tag) can be acquired in a hook manner, and the reflection function can reflect and call a video _ node, i.e., a video tag object from a hook.

In one embodiment, entering the certificate request address and the video tag into the framework code comprises:

constructing port data based on the certificate request address; constructing an entry function corresponding to the frame code; the port data and the video tag are entered into the framework code by the entry function.

The certificate request address, such as the licenseUrl, may construct port data that meets the request standard according to the actual request standard, and the combination of the certificate request address, such as the licenseUrl, and the standard request header information may construct the port data.

By calling the entry class mediaplayerfactor in the frame code, an entry function can be created based on the entry class, and the port data and the video tag are input into the frame code through the entry function.

In one embodiment, the frame code includes a decryption service code and a playing service code; triggering the frame code to decrypt and play the encrypted video on the browser, comprising:

triggering a decryption service code in the frame code to run on the browser so as to send a certificate request to the digital rights management system according to the port data, receiving a digital certificate returned by the digital rights management system in response to the certificate request, and decrypting the encrypted video based on the digital certificate; and triggering the running of the playing service code on the browser so as to play the video obtained by decryption according to the video tag.

Decryption service codes, namely, corresponding codes of Encrypted Media Extensions (EME) modules providing video decryption services in frame codes of a video playing library (namely, dash.js), and playing service codes, namely, corresponding codes of Media Source Extensions (MSE) modules providing video playing services in frame codes of the video playing library (namely, dash.js).

Under the support of a browser source code, the frame code can be operated, the decryption service code is operated on the browser to send a certificate request to the digital rights management system according to port data, receive a digital certificate returned by the digital rights management system in response to the certificate request, and decrypt the encrypted video based on the digital certificate to obtain the decrypted video. And then, triggering the running of the playing service code so as to play the video obtained by decryption according to the video label. Further, in the related art, the video decryption playing process is converted into a standard EME decryption process and an MSE playing process.

In this way, based on steps S210 to S240, when the browser page is opened through the external interface of the browser, the frame code of the video playing library (i.e. dash.js) is conveniently injected into the browser page, the browser supports the operation of the frame code, the decryption function of the external decryption plug-in is duplicated in the browser through the providing capability of the frame code, so as to obtain the duplication function to implement the decryption function, and further, the external plug-in is not needed to be implemented again in the browser, the video decryption capability can be implemented without implementing the content decryption frame, finally, the video can be decrypted and played through the frame code under the support of the browser source code based on the duplication function, the traditional decryption and playing flow through the external plug-in is switched to the native decryption and playing flow of the browser, based on the browser source code, without depending on other modules, the video playing of the encrypted format is realized on the basis of not losing the performance.

In the related art, many pages, such as many Freeview applications, adopt a DrmAgent plug-in form to implement a decryption process of an encrypted video, and many native browsers do not directly support the DrmAgent plug-in, but need to rely on a browser plug-in framework to implement the plug-in again, and need to implement a CDM framework, which is time-consuming and labor-consuming.

In order to better implement the video playing method provided by the embodiment of the present application, the embodiment of the present application further provides a video playing device based on the video playing method. The meaning of the noun is the same as that in the video playing method, and specific implementation details can refer to the description in the method embodiment. Fig. 3 shows a block diagram of a video playback device according to an embodiment of the present application.

As shown in fig. 3, the video playback device 300 may include an opening module 310, an injection module 320, a copying module 330, and a playback module 340.

The opening module 310 may be configured to open a browser page through an external interface of a browser; the injection module 320 may be configured to inject a frame code of a video play library in the browser page; the duplicating module 330 may be configured to duplicate the decryption function of the external decryption plug-in through the frame code to obtain a duplicating function; the playing module 340 may be configured to decrypt and play the encrypted video through the frame code on the browser based on the copy function.

In some embodiments of the present application, the playing module 340 includes: the calling monitoring unit is used for acquiring a certificate request address through the duplicating function when the decryption function decrypts the encrypted video to obtain the certificate request address; a video tag obtaining unit, configured to obtain a video tag created for the encrypted video in the browser page; and the playing triggering unit is used for inputting the certificate request address and the video label into the frame code so as to trigger the frame code to decrypt and play the encrypted video on the browser.

In some embodiments of the present application, the video tag obtaining unit includes: the reflection processing subunit is used for performing reflection processing on the service class for creating the video tag in the browser page to obtain a reflection function; and the reflection acquisition subunit is used for acquiring the video label created by the service class on the encrypted video based on the reflection function.

In some embodiments of the present application, the play trigger unit includes: a port data construction subunit configured to construct port data based on the certificate request address; an entry function constructing subunit, configured to construct an entry function corresponding to the frame code; an entry input subunit, configured to input the port data and the video tag into the frame code through the entry function.

In some embodiments of the present application, the frame code includes a decryption service code and a playing service code; the play trigger unit includes: the certificate decryption subunit is used for triggering the decryption service code in the frame code to run on the browser, so as to send a certificate request to a digital rights management system according to the port data, receive a digital certificate returned by the digital rights management system in response to the certificate request, and decrypt the encrypted video based on the digital certificate; and the decrypted video playing subunit is used for triggering the running of the playing service code on the browser so as to play the video obtained by decryption according to the video tag.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; the copying module 330 includes: the decryption monitoring unit is used for monitoring whether the browser page calls a decryption function of the digital copyright management plug-in to decrypt the encrypted video; and the duplication processing unit is used for triggering the frame code to duplicate the decryption function when the situation that the encrypted video is decrypted is monitored, so that the duplication function is obtained.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; the copying module 330 includes: a plug-in obtaining unit, configured to obtain the digital rights management plug-in; the interface creating unit is used for creating an interface corresponding to the decryption function of the digital copyright management plug-in; and the calling function creating unit is used for creating a calling function for calling the interface in the frame code so as to take the calling function as the duplicating function.

In this way, based on the video playing apparatus 300, when the browser page is opened through the external interface of the browser, the frame code of the video playing library (i.e. dash.js) is conveniently injected into the browser page, the operation of the frame code is supported by the browser, the decryption function of the external decryption plug-in is duplicated in the browser through the providing capability of the frame code, so as to obtain the duplication function to realize the decryption function, further, the external plug-in is not needed to be realized again in the browser, the video decryption capability can be realized without realizing the content decryption frame, finally, the video can be decrypted and played through the frame code under the support of the browser source code based on the duplication function, the traditional decryption and playing flow through the external plug-in is switched to the native decryption and playing flow of the browser, based on the browser source code, without depending on other modules, the video playing of the encrypted format is realized on the basis of not losing the performance.

It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.

In addition, an embodiment of the present application further provides an electronic device, where the electronic device may be a terminal or a server, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the present application, and specifically:

the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:

the processor 401 is a control center of the electronic device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user pages, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.

The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.

The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.

The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions, for example, the processor 401 may execute the following steps:

opening a browser page through an external interface of a browser; injecting a frame code of a video playing library into the browser page; duplicating the decryption function of the external decryption plug-in through the frame code to obtain a duplication function; and based on the copying function, decrypting and playing the encrypted video on the browser through the frame code.

In some embodiments of the present application, when decrypting and playing the encrypted video through the framework code on the browser based on the carbon copy function, the processor 401 may perform: when the decryption function decrypts the encrypted video to obtain a certificate request address, acquiring the certificate request address through the duplicating function; acquiring a video tag created for the encrypted video in the browser page; and inputting the certificate request address and the video tag into the frame code to trigger the frame code to decrypt and play the encrypted video on the browser.

In some embodiments of the present application, when obtaining a video tag created for the encrypted video in the browser page, the processor 401 may perform: reflecting the service class of the created video tag in the browser page to obtain a reflection function; and acquiring a video label created by the service class on the encrypted video based on the reflection function.

In some embodiments of the present application, when the certificate request address and the video tag are input into the framework code, the processor 401 may perform: constructing port data based on the certificate request address; constructing an entry function corresponding to the frame code; entering the port data and the video tag into the frame code through the entry function.

In some embodiments of the present application, the frame code includes a decryption service code and a playing service code; when the frame code is triggered to decrypt and play the encrypted video on the browser, the processor 401 may execute: triggering the decryption service code in the frame code to run on the browser so as to send a certificate request to a digital rights management system according to the port data, receiving a digital certificate returned by the digital rights management system in response to the certificate request, and decrypting the encrypted video based on the digital certificate; and triggering the running of the playing service code on the browser so as to play the video obtained by decryption according to the video tag.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; when the frame code is used to perform the duplication processing on the decryption function of the external decryption plug-in, and the duplication function is obtained, the processor 401 may execute: monitoring whether the browser page calls a decryption function of the digital copyright management plug-in to decrypt the encrypted video; and when the encrypted video is monitored to be decrypted, triggering the frame code to rewrite the decryption function to obtain a rewrite function.

In some embodiments of the present application, the external decryption plug-in comprises a digital rights management plug-in; when the frame code is used to perform the duplication processing on the decryption function of the external decryption plug-in, and the duplication function is obtained, the processor 401 may execute: acquiring the digital copyright management plug-in; creating an interface corresponding to a decryption function of the digital rights management plug-in; creating a calling function calling the interface in the framework code so as to take the calling function as the duplicating function.

It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the computer program.

To this end, the present application further provides a storage medium, in which a computer program is stored, where the computer program can be loaded by a processor to execute the steps in any one of the methods provided in the present application.

Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.

Since the computer program stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the methods provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.

Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.

It will be understood that the present application is not limited to the embodiments that have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:蓝牙外设升级方法、装置、终端设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类