CN114422831B - Media playing method and device, electronic equipment and readable storage medium - Google Patents

Media playing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114422831B
CN114422831B CN202210066167.2A CN202210066167A CN114422831B CN 114422831 B CN114422831 B CN 114422831B CN 202210066167 A CN202210066167 A CN 202210066167A CN 114422831 B CN114422831 B CN 114422831B
Authority
CN
China
Prior art keywords
playing
information
server
media file
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210066167.2A
Other languages
Chinese (zh)
Other versions
CN114422831A (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202210066167.2A priority Critical patent/CN114422831B/en
Publication of CN114422831A publication Critical patent/CN114422831A/en
Application granted granted Critical
Publication of CN114422831B publication Critical patent/CN114422831B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/65Transmission of management data between client and server
    • H04N21/658Transmission by the client directed to the server
    • H04N21/6587Control parameters, e.g. trick play commands, viewpoint selection
    • 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/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

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

Abstract

The invention provides a media playing method and device, electronic equipment and a readable storage medium. The media playing method is applied to terminal equipment, and the terminal equipment is in communication connection with a server, and comprises the following steps: sending a media acceleration playing request for playing the target media file to the server; receiving header information returned by the server according to the media accelerated play request, wherein the header information carries first address information of a first segment of the target media file; and playing the first segment of the target media file. The embodiment of the invention improves the playing speed of the media file.

Description

Media playing method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of media playing, and in particular, to a media playing method and apparatus, an electronic device, and a readable storage medium.
Background
Content providing websites may provide for the playing of media files, including audio, video, etc., however, with the development of technology and in order to meet more needs of users, more and more functions are provided during the playing of media files, and in order to implement these functions, the amount of data to be transmitted is increased, which results in a longer time taken for the media files to start the playing function.
Disclosure of Invention
An embodiment of the invention aims to provide a media playing method and device, electronic equipment and a readable storage medium, so as to solve the problem that the time consumed by starting a playing function of a media file is long.
The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a media playing method applied to a terminal device, where the terminal device is communicatively connected to a server, and the method includes the following steps:
under the condition of quick playing, a media acceleration playing request for playing the target media file is sent to the server;
receiving header information returned by the server according to the media accelerated play request, wherein the header information carries first address information of a first segment of a target media file;
and playing the first segment of the target media file preferentially according to the first address information carried in the header information.
In some embodiments, before the playing the first segment of the target media file, the method further comprises:
transmitting a first data request to the server based on the first address information;
and receiving the head data returned by the server according to the first data request, wherein the head data comprises the media file corresponding to the first fragment.
In some embodiments, after receiving the header information returned by the server according to the media accelerated play request, the method further includes:
receiving main body information sent by the server;
and filling playing service logic of the target media file according to the main body information, wherein the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
In some embodiments, the playing service logic for populating the target media file according to the body information includes:
sending a second data request to the server according to second address information, wherein the second address information is carried in the main body information;
receiving main body data returned by the server according to the second data request;
and filling the playing service logic of the target media file by using the main body data.
In some embodiments, the header information carries file information of the target media file and necessary information for playing the target media file, and the body information carries unnecessary information for playing the target media file.
In some embodiments, the header information is comprised of a network layer packet, and the header information is less than or equal to 1400 bytes.
In a second aspect of the present invention, a media playing method is provided, and is applied to a server, where the server is communicatively connected to a terminal device, and the method includes:
receiving a media acceleration playing request sent by the terminal equipment;
preferentially sending header information to the terminal equipment according to the media accelerated play request, wherein the header information carries first address information of a first segment of a target media file;
and preferentially sending header data to the terminal equipment according to a first data request, wherein the first data request is generated by the terminal equipment according to the header information, and the header data comprises a media file corresponding to the first fragment.
In some embodiments, after the sending of the header data to the terminal device according to the first data request preferentially, the method further comprises:
and the main body information is sent to the server and carries the subsequent fragments after the first fragment of the target media file.
In a third aspect of the present invention, a media playing device is provided and applied to a terminal device, where the terminal device is communicatively connected to a server, and the method includes the following steps:
a play request sending module, configured to send a media acceleration play request for playing a target media file to the server;
the head information receiving module is used for receiving the head information returned by the server according to the media accelerated play request, wherein the head information carries first address information of a first fragment of a target media file;
and the playing module is used for playing the first fragment of the target media file.
In some aspects of the present invention, there is also provided an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the media playing methods when executing the programs stored in the memory.
In some aspects of the present invention, there is also provided a readable storage medium having stored thereon a computer program which when executed by a processor implements any of the above described media playing methods.
According to the embodiment of the invention, the first address information of the first segment of the target media file is carried in the header information, so that the content of the first segment can be obtained according to the first address information, the time required for playing the first segment is shortened, and the playing speed of the media file is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flow chart of a media playing method according to an embodiment of the invention;
FIG. 2 is a flow chart of a method for playing media according to an embodiment of the present invention;
FIG. 3 is a block diagram of a media player according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
The invention provides a media playing method.
In some embodiments, the media playing method is applied to a terminal device, and the terminal device is in communication connection with a server.
In this embodiment, the terminal device may refer to a terminal device such as a smart phone, a tablet computer, or a computer, and the media to be played may specifically refer to a video media file or an audio media file.
As shown in fig. 1, in some embodiments, the media playing method includes the steps of:
step 101: and sending a media acceleration playing request for playing the target media file to the server.
In this embodiment, the media accelerated play request may be triggered by different manners, for example, the user may request to play the media file by accessing a page corresponding to the media file or accessing a link corresponding to the media file, and when the user requests to play the media file, the terminal device sends the media accelerated play request to the server.
In the related art, when playing a media file online, a terminal device generally needs to send a play request to a server, and based on the play request, the server sends a corresponding media file to the terminal device.
It should be appreciated that if the playing of the media file can be completed in a manner known in the related art, the playing of the media file may be performed directly based on the manner.
In this embodiment, in the case that the media file cannot be played in the normal mode, the fast playing mode is entered by sending a media acceleration playing request.
In implementation, the fast-open mode can be determined by different modes, for example, the current network strength can be detected, if the network strength is low, the fast-open mode is entered, and obviously, the condition of entering the fast-open mode can also be set as that the current network connection delay is high, the normal open request is failed to be sent for multiple times, the normal open request is successfully sent, but no response is received, and the like.
In this embodiment, if the normal mode can be used for playing, a conventional media playing request is sent to the server, and under the above conditions, the playing of the media file cannot be performed in the normal mode, the fast playing mode is started, and a media accelerated playing request is sent to the server.
Step 102: and receiving the head information returned by the server according to the media playing request.
In file transfer, header information (header) and data information (body) are typically included, wherein the header information has a smaller volume than the data information, and it should be understood that the header information is typically smaller in volume and is typically used to implement identification functions, such as identification, object identification, and the like.
For example, the identification may refer to terminal identification, and the object identification may refer to identifying whether the media file is a media file corresponding to the media play request (or the media accelerated play request described above). Whereas the volume of data information is relatively large, the data information is used for transmitting the media file itself.
It will be appreciated that the header information and the data information are transmitted sequentially, i.e. the data information is arranged after the header information.
In this embodiment, the header information carries the first address information of the first segment of the target media file, which can be understood that in this embodiment, the first address information of the first segment of the target media file is added to the header information.
It should be appreciated that if the server receives a normal media play request, all segments of the target media file are carried in the data information.
If the server receives the media accelerated play request, the first address information of the first segment of the target media file is carried in the header information.
The target media file refers to a media file to be played, specifically, a media file requested to be played for the media acceleration playing request.
The first segment refers to the first segment of the target media file in time order. It should be understood that in the transmission process, the media file needs to be divided into a plurality of segments, and the segments are independently transmitted in a segment form, and the terminal device writes the received segments into the buffer area of the player instance, so as to realize playing of the media file.
In some embodiments, the method further comprises:
transmitting a first data request to the server based on the first address information;
and receiving the head data returned by the server according to the first data request, wherein the head data comprises the media file corresponding to the first fragment.
After the first address information of the first segment is obtained, a first data request is sent based on the first address information to obtain a media file issued by the server.
Step 103: and playing the first segment of the target media file preferentially according to the first address information carried in the header information.
Because the header information in this embodiment carries the first address information of the first segment, based on the obtained header information, the first address information can be obtained, and further, based on the first address information, the data corresponding to the first segment can be obtained.
It should be understood that the data information may also carry the first address information of the first segment.
In some embodiments, in the case of fast playing, all the information of the target media file may be carried in the data information, that is, the data information of the fast playing mode is the same as the data information of the normal playing mode, so that no adjustment needs to be made to the data information, which helps to simplify the processing procedure.
If the header information and the data information are received, in this embodiment, the first segment of the target media file is played preferentially according to the first address information carried in the header information, thereby helping to increase the playing speed.
It should be understood that the header information has a relatively small volume and a relatively high transmission speed, and generally only requires a Round-Trip Time (RTT) interval, while the data information has a relatively large volume and generally needs to be split into a plurality of network layer data packets for gradual transmission, and meanwhile, some data information in a specific format needs to be analyzed after all the corresponding network layer data packets are completely transmitted.
Therefore, after the transmission of the header information is completed, the technical scheme of the embodiment of the invention can realize the acquisition of the first segment of the target media file and execute the operation of starting playing based on the header information, thereby shortening the open time and reducing the waiting time.
In some embodiments, after step 102, the method further comprises:
receiving main body information sent by the server;
and filling playing service logic of the target media file according to the main body information, wherein the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
After the start of the program, the main body information sent by the server is further acquired, and it can be understood that, similar to the related art, the main difference of the technical solution of the present embodiment compared with the related art is that the main body information in the present embodiment does not include the first address information of the first segment, but includes only the second address information of the subsequent segment.
In some embodiments, the header information carries file information of the target media file and necessary information for playing the target media file, and the body information carries unnecessary information for playing the target media file. Therefore, the first segment is called based on the head information, the playing of the media file can be started rapidly, and then, based on the main body information, the required subtitle, duration information and resolution information can be further perfected, so that the continuous and continuous playing of the subsequent segments of the target media file can be realized.
In some embodiments, the header information is formed by a network layer data packet, and the header information is less than or equal to 1400 bytes, so that the transmission time of the header information can be further reduced, and the play-out speed can be improved.
In other embodiments, where the header information is made up of a plurality of network layer packets, and may be two network layer packets, the header data may be limited to less than 2800 bytes, the volume of the header information may be adjusted due to differences in network environment or devices relied upon, and may be different values, such as less than 1000 bytes.
In some embodiments, the playing service logic for populating the target media file according to the body information includes:
sending a second data request to the server according to second address information, wherein the second address information is carried in the main body information;
receiving main body data returned by the server according to the second data request;
and filling the playing service logic of the target media file by using the main body data.
The technical solution of this embodiment may be understood that the terminal device first obtains the main body information, and then obtains the complete main body data based on the main body information, where the main body data refers to a file required for playing the playing target media file, and the main body information may be understood as index information for obtaining the main body data.
For example, after the main body information is acquired, a callback operation may be triggered by a callback function based on the second address information to acquire complete main body data, or the main body data may be called by other operations, which is not limited herein.
The invention also provides a media playing method which is applied to the server, and the server is in communication connection with the terminal equipment.
As shown in fig. 2, in this embodiment, the server is configured to implement a management function and a content delivery function, where the two functions may be implemented by one server or may be implemented by two servers, and by way of example, a content server and a management server may be provided, where the management server is mainly configured to implement the management function, and by way of example, may include play management of media files, and the content server is mainly configured to deliver the media files to the terminal device based on management of the management server.
In this embodiment, the servers including the content server and the management server are exemplified.
As shown in fig. 2, in one embodiment, the method includes the steps of:
and the management server receives the media accelerated play request sent by the terminal equipment.
The user accesses a certain media file at the terminal device, thereby triggering playing of the media file, and further, generating a corresponding access request.
And the management server preferentially sends head information to the terminal equipment according to the media accelerated play request, wherein the head information carries first address information of a first fragment of the target media file.
In this embodiment, a small amount of critical necessary data required for the subsequent process in the returned data is filtered as the start-up information, for example, the download address of the first media file to be used for start-up, and added to the header information. In particular, these critical necessary data may be added to specific fields of the header information.
In this embodiment, in order to increase the broadcasting speed, the priority of sending the header information is further increased, and the priority of the header information is illustratively adjusted to be the highest, so that the header data carrying the first address information is first sent to the terminal device, so as to ensure quick broadcasting.
The content server receives a first data request sent by the terminal equipment, wherein the first data request is generated by the terminal equipment according to first address information carried in the header information.
In this embodiment, the first data request is a media file request for obtaining complete header data by the terminal device, specifically, the terminal device analyzes the header information to obtain first address information, and then downloads a corresponding media file based on the first address to obtain complete header data.
And the content server preferentially transmits header data to the terminal equipment according to the first data request, wherein the header data comprises a media file corresponding to the first fragment, and the management server transmits the multicast data to the terminal equipment.
Here, the header data and the open data include key data necessary for starting playing of the media file, so that the open file acquired by the terminal device includes the header data and the open data, and after the terminal device receives the open file, the play flow is triggered to start playing of the media file.
In this embodiment, the transmission priority of the header data is further improved, so that the header data can be issued to the terminal device at the first time, and quick broadcasting is ensured.
In some embodiments, after the sending of the header data to the terminal device according to the first data request preferentially, the method further comprises:
and the main body information is sent to the server and carries the subsequent fragments after the first fragment of the target media file.
In this embodiment, after the delivery of the header data is completed, the main body data may be transmitted to the terminal device through the content server.
Specifically, when the media file starts to be played, the terminal device continues to receive the main body information at the same time, and obtains complete main body data according to the main body information. Here, after receiving the body information, the terminal device further obtains body data of the playing target media file from the content server based on the body information, where the body data may be understood as other data required for playing the complete target media file.
Based on the received main body data, the terminal device further perfects all business logic of the target media file to realize continuous playing of the media file.
Illustratively, the method may include filling subtitles to a play screen, filling time length and resolution to a play option box, filling all media data segments to a play buffer, and the like, which are specifically referred to in the related art and are not further defined and described herein.
As shown in fig. 2, in the data transmission process, the data can be directly transmitted between the server and the terminal device, or the data can be transferred and transmitted through a network library.
The embodiment of the invention also provides a media playing device which is applied to the terminal equipment, and the terminal equipment is in communication connection with the server.
As shown in fig. 3, in one embodiment, the media playing device 300 includes:
a play request sending module 301, configured to send a media accelerated play request for playing a target media file to the server under a fast playing condition;
a header information receiving module 302, configured to receive header information returned by the server according to the media accelerated play request, where the header information carries first address information of a first segment of the target media file;
and a playing module 303, configured to play the first segment of the target media file preferentially according to the first address information carried in the header information.
In some embodiments, further comprising:
the first data request sending module is used for sending a first data request to the server based on the first address information;
and the head data receiving module is used for receiving the head data returned by the server according to the first data request, wherein the head data comprises a media file corresponding to the first fragment.
In some embodiments, further comprising:
the main body information receiving module is used for receiving the main body information sent by the server;
and the service logic filling module is used for filling the playing service logic of the target media file according to the main body information, wherein the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
In some embodiments, the business logic population module comprises:
the sending sub-module is used for sending a second data request to the server according to second address information, wherein the second address information is carried in the main body information;
the receiving sub-module is used for receiving main body data returned by the server according to the second data request;
and the filling sub-module is used for filling the playing service logic of the target media file by using the main body data.
In some embodiments, the header information carries file information of the target media file and necessary information for playing the target media file, and the body information carries unnecessary information for playing the target media file.
In some embodiments, the header information is comprised of a network layer packet, and the header information is less than or equal to 1400 bytes.
The embodiment of the invention also provides a media playing device which is applied to the server, and the server is in communication connection with the terminal equipment.
In some embodiments, the media playing device comprises:
the media accelerated play request receiving module is used for receiving the media accelerated play request sent by the terminal equipment;
the head information sending module is used for preferentially sending head information to the terminal equipment according to the media accelerated play request, wherein the head information carries first address information of a first fragment of the target media file;
and the head data sending module is used for preferentially sending head data to the terminal equipment according to a first data request, wherein the first data request is generated by the terminal equipment according to the head information, and the head data comprises a media file corresponding to the first fragment.
In some embodiments, the media playing device further comprises:
and the main body information sending module is used for sending main body information to the server, wherein the main body information carries a subsequent segment after the first segment of the target media file.
The media playing device of the present embodiment can implement each step of the foregoing media playing method embodiment, and can implement the same or similar technical effects, which are not described herein again.
The embodiment of the invention also provides an electronic device, as shown in fig. 4, which comprises a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42 and the memory 43 complete communication with each other through the communication bus 44,
a memory 43 for storing a computer program;
the processor 51 is configured to implement the steps of any of the above media playing methods when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a readable storage medium having stored thereon a computer program which when executed by a processor implements a media playing method as described in any of the above.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (NetworK Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a readable storage medium is provided, where instructions are stored, which when executed on a computer, cause the computer to perform the method for playing media according to any one of the above embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of media playing of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy DisK, hard DisK, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State DisK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A media playing method applied to a terminal device, wherein the terminal device is in communication connection with a server, and the method is characterized by comprising the following steps:
under the fast playing condition, a media accelerated playing request for playing a target media file is sent to the server, wherein the fast playing condition indicates that: the network strength of the communication network between the terminal equipment and the server is lower than a first threshold, the network connection delay of the communication network is higher than a second threshold, the number of times of failure in sending the request for opening initiated by the terminal equipment to the server exceeds a third threshold, or the server does not respond to the request for opening sent by the terminal equipment;
receiving header information returned by the server according to the media accelerated play request, wherein the header information carries first address information of a first segment of the target media file;
preferentially playing the first segment of the target media file according to the first address information carried in the header information;
after receiving the header information returned by the server according to the media accelerated play request, the method further comprises:
receiving main body information sent by the server, wherein the main body information comprises first address information of the first fragment;
and filling playing service logic of the target media file according to the main body information, wherein the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
2. The method of claim 1, wherein prior to playing the first segment of the target media file, the method further comprises:
transmitting a first data request to the server based on the first address information;
and receiving the head data returned by the server according to the first data request, wherein the head data comprises the media file corresponding to the first fragment.
3. The method of claim 1, wherein said populating the playback service logic of the target media file according to the body information comprises:
sending a second data request to the server according to second address information, wherein the second address information is carried in the main body information;
receiving main body data returned by the server according to the second data request;
and filling the playing service logic of the target media file by using the main body data.
4. A method according to claim 3, wherein the header information carries file information of the target media file and necessary information for playing the target media file, and the body information carries unnecessary information for playing the target media file.
5. The method of claim 4, wherein the header information is comprised of a network layer packet, and wherein the header information is less than or equal to 1400 bytes.
6. A media playing method applied to a server, wherein the server is in communication connection with a terminal device, and the method is characterized by comprising the following steps:
receiving a media acceleration playing request sent by the terminal equipment, wherein the media acceleration playing request corresponds to a fast playing condition, and the fast playing condition indicates: the network strength of the communication network between the terminal equipment and the server is lower than a first threshold, the network connection delay of the communication network is higher than a second threshold, the number of times of failure in sending the request for opening initiated by the terminal equipment to the server exceeds a third threshold, or the server does not respond to the request for opening sent by the terminal equipment;
preferentially sending header information to the terminal equipment according to the media accelerated play request, wherein the header information carries first address information of a first segment of a target media file;
preferentially sending header data to the terminal equipment according to a first data request, wherein the first data request is generated by the terminal equipment according to the header information, and the header data comprises a media file corresponding to the first fragment;
after the first data request preferentially sends the header data to the terminal device, the method further includes:
and sending main body information to the terminal equipment, wherein the main body information comprises first address information of the first segment, and the main body information is used for filling playing service logic of the target media file, and the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
7. The method of claim 6, wherein after said preferentially transmitting header data to said terminal device according to the first data request, the method further comprises:
and the main body information is sent to the server and carries the subsequent fragments after the first fragment of the target media file.
8. A media playing device applied to a terminal device, the terminal device being communicatively connected to a server, comprising the steps of:
the playing request sending module is used for sending a media acceleration playing request of a playing target media file to the server under the condition of fast playing, wherein the fast playing condition indicates that: the network strength of the communication network between the terminal equipment and the server is lower than a first threshold, the network connection delay of the communication network is higher than a second threshold, the number of times of failure in sending the request for opening initiated by the terminal equipment to the server exceeds a third threshold, or the server does not respond to the request for opening sent by the terminal equipment;
the head information receiving module is used for receiving the head information returned by the server according to the media accelerated play request, wherein the head information carries first address information of a first fragment of a target media file;
the playing module is used for preferentially playing the first segment of the target media file according to the first address information carried in the header information;
in some embodiments, the media playing device further comprises:
the main body information receiving module is used for receiving main body information sent by the server, wherein the main body information comprises first address information of the first fragment;
and the service logic filling module is used for filling the playing service logic of the target media file according to the main body information, wherein the playing service logic comprises one or more of subtitle information, duration information, resolution information and cache data of a subsequent segment, and the subsequent segment is a media segment after the first segment of the target media file.
9. An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the media playing method according to any one of claims 1 to 5 when executing a program stored on a memory, or
The steps of implementing the media playing method of claim 6 or 7.
10. A readable storage medium having stored thereon a computer program which when executed by a processor implements the media playing method of any one of claims 1 to 5, or
The steps of implementing the media playing method of claim 6 or 7.
CN202210066167.2A 2022-01-20 2022-01-20 Media playing method and device, electronic equipment and readable storage medium Active CN114422831B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210066167.2A CN114422831B (en) 2022-01-20 2022-01-20 Media playing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210066167.2A CN114422831B (en) 2022-01-20 2022-01-20 Media playing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114422831A CN114422831A (en) 2022-04-29
CN114422831B true CN114422831B (en) 2024-03-19

Family

ID=81276317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210066167.2A Active CN114422831B (en) 2022-01-20 2022-01-20 Media playing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114422831B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475932A (en) * 2013-09-05 2013-12-25 深圳Tcl新技术有限公司 Seamless on-line playing method and device of network video and network television system
CN104333801A (en) * 2014-11-28 2015-02-04 北京奇艺世纪科技有限公司 MP4 media file transferring method, MP4 media file playing method, MP4 media file transferring device, MP4 media file playing method and MP4 media file playing system
CN104506950A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Multithread download method and download device in network streaming media play, and download equipment
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN109474854A (en) * 2018-11-29 2019-03-15 广州市百果园信息技术有限公司 Video broadcasting method, the generation method of playlist and relevant device
CN109729386A (en) * 2019-01-03 2019-05-07 深圳市网心科技有限公司 A kind of video file opens broadcasting method, system and electronic equipment and storage medium
CN110139123A (en) * 2018-02-02 2019-08-16 腾讯科技(深圳)有限公司 The broadcasting of files in stream media, transmission, treating method and apparatus
CN110545489A (en) * 2018-05-28 2019-12-06 中国电信股份有限公司 self-adaptive streaming media playing method, system and client
CN110677737A (en) * 2019-10-08 2020-01-10 烽火通信科技股份有限公司 HLS live broadcast quick playing method and system
CN111031117A (en) * 2019-12-02 2020-04-17 深圳市迅雷网络技术有限公司 Multimedia file downloading method and related device
CN112714365A (en) * 2019-10-25 2021-04-27 上海哔哩哔哩科技有限公司 Video playing method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873926B (en) * 2012-12-13 2017-03-22 腾讯科技(深圳)有限公司 Method and system for downloading and playing media file
CN104125516B (en) * 2013-04-24 2018-09-28 华为技术有限公司 Media file reception, media file sending method and apparatus and system
CN105898535A (en) * 2015-12-30 2016-08-24 乐视致新电子科技(天津)有限公司 Play start speed improving method, video player and electronic device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475932A (en) * 2013-09-05 2013-12-25 深圳Tcl新技术有限公司 Seamless on-line playing method and device of network video and network television system
CN104333801A (en) * 2014-11-28 2015-02-04 北京奇艺世纪科技有限公司 MP4 media file transferring method, MP4 media file playing method, MP4 media file transferring device, MP4 media file playing method and MP4 media file playing system
CN104506950A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Multithread download method and download device in network streaming media play, and download equipment
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
WO2017166525A1 (en) * 2016-03-31 2017-10-05 乐视控股(北京)有限公司 Method for providing multimedia content, server and terminal device
CN110139123A (en) * 2018-02-02 2019-08-16 腾讯科技(深圳)有限公司 The broadcasting of files in stream media, transmission, treating method and apparatus
CN110545489A (en) * 2018-05-28 2019-12-06 中国电信股份有限公司 self-adaptive streaming media playing method, system and client
CN109474854A (en) * 2018-11-29 2019-03-15 广州市百果园信息技术有限公司 Video broadcasting method, the generation method of playlist and relevant device
CN109729386A (en) * 2019-01-03 2019-05-07 深圳市网心科技有限公司 A kind of video file opens broadcasting method, system and electronic equipment and storage medium
CN110677737A (en) * 2019-10-08 2020-01-10 烽火通信科技股份有限公司 HLS live broadcast quick playing method and system
CN112714365A (en) * 2019-10-25 2021-04-27 上海哔哩哔哩科技有限公司 Video playing method and system
CN111031117A (en) * 2019-12-02 2020-04-17 深圳市迅雷网络技术有限公司 Multimedia file downloading method and related device

Also Published As

Publication number Publication date
CN114422831A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
US20180217948A1 (en) USB Device Access Method, Apparatus and System, a Terminal, and a Server
CN107832100B (en) APK plug-in loading method and terminal thereof
WO2020211731A1 (en) Video playing method and related device
WO2022057318A1 (en) Stream pulling request processing method, apparatus and system, electronic device, and storage medium
CN110247985B (en) Resource downloading method and device, electronic equipment and medium
CN110460584B (en) Access request processing method and device, electronic equipment and computer readable medium
CN111046310A (en) Page processing method, device, server and computer readable storage medium
CN105451071A (en) Video stream processing method, device and system
CN112584200B (en) Screen projection method, system, electronic equipment and storage medium
CN110830460A (en) Connection establishing method and device, electronic equipment and storage medium
CN110944220A (en) Video screen projection playing method, device, equipment and system
CN112565877B (en) Screen projection method and system, electronic equipment and storage medium
CN116261021B (en) Video stream playing method and device, electronic equipment and storage medium
WO2015096745A1 (en) Data processing method and device in content delivery network
CN114422831B (en) Media playing method and device, electronic equipment and readable storage medium
CN112597406A (en) File transmission method and device, terminal equipment and storage medium
US20100088732A1 (en) Method and apparatus for using service based on objects for implementing different functions of service
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN111356006B (en) Video playing method, device, server and storage medium
US20200272568A1 (en) Adaptive retrieval of objects from remote storage
CN109729419B (en) Push video preloading method and device, electronic equipment and storage medium
CN115412777A (en) Streaming media data transmission method, device and system
CN115022694B (en) Screen time statistics method, device, system, background server and medium
CN109347933B (en) Method and device for establishing connection
US20180192145A1 (en) Method and Apparatus for Processing IPTV Program, and IPTV System

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