CN108377409A - A kind of seamless play method, terminal device and the storage medium of multimedia file - Google Patents

A kind of seamless play method, terminal device and the storage medium of multimedia file Download PDF

Info

Publication number
CN108377409A
CN108377409A CN201810179507.6A CN201810179507A CN108377409A CN 108377409 A CN108377409 A CN 108377409A CN 201810179507 A CN201810179507 A CN 201810179507A CN 108377409 A CN108377409 A CN 108377409A
Authority
CN
China
Prior art keywords
multimedia file
preset
time
playing
progress rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810179507.6A
Other languages
Chinese (zh)
Inventor
龙俊卫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810179507.6A priority Critical patent/CN108377409A/en
Publication of CN108377409A publication Critical patent/CN108377409A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/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
    • H04N21/47217End-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 for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Abstract

The application is suitable for multimedia technology field, provides a kind of seamless play method, terminal device and the computer readable storage medium of multimedia file, the method includes:When receiving preset instructions, multimedia file to be played is buffered in preset cushion space, after caching, it is played since preset cushion space obtains multimedia file, and monitor the playing progress rate of the multimedia file, when the playing progress rate is the end time of the multimedia file, set the playing progress rate to the time started, the multimedia file is controlled to restart to play, when can solve current multimedia file loop play by the application, switch incoherent problem between playing twice, realizes seamless play.

Description

A kind of seamless play method, terminal device and the storage medium of multimedia file
Technical field
The application belongs to multimedia technology field more particularly to seamless play method, the terminal of a kind of multimedia file are set Standby and computer readable storage medium.
Background technology
With the development of Internet technology, in order to enable user obtains good online experience, it will usually need in webpage It is middle by a multimedia file loop play, for example, the multimedia advertising in the page, when user rests on current page, when The corresponding multimedia file of multimedia advertising in the preceding page can loop play.
Currently, the method for multimedia file loop play is typically to add loop in audio or video labels in webpage Attribute however, the method for this loop play to terminate when multimedia file broadcasting when playing next time will appear not Coherent problem.
Invention content
In view of this, the embodiment of the present application provides a kind of seamless play method, terminal device and the meter of multimedia file Calculation machine readable storage medium storing program for executing when solving current multimedia file loop play, switches incoherent problem between playing twice.
The first aspect of the embodiment of the present application provides a kind of seamless play method of multimedia file, including:
When receiving preset instructions, multimedia file to be played is buffered in preset cushion space;
After caching, played since preset cushion space obtains multimedia file, and monitor the multimedia The playing progress rate of file, the playing progress rate are time point currently playing in the multimedia file playing process;
When the playing progress rate is the end time of the multimedia file, when the playing progress rate is set as starting Between, it controls the multimedia file and restarts to play.
The second aspect of the embodiment of the present application provides a kind of terminal device, including:
Cache module, for when receiving preset instructions, multimedia file to be played to be buffered in preset buffering Space;
Playing module, for after caching, being played since preset cushion space obtains multimedia file, and supervise The playing progress rate of the multimedia file is listened, when the playing progress rate is currently playing in the multimedia file playing process Between point;
Circular treatment module, for when the playing progress rate is the end time of the multimedia file, being broadcast described Degree of putting into is set as the time started, controls the multimedia file and restarts to play.
The third aspect of the embodiment of the present application provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program The step of realizing the method that the embodiment of the present application first aspect provides.
The fourth aspect of the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, the computer program to realize the embodiment of the present application when being executed by one or more processors On the one hand the step of the method provided.
5th aspect of the embodiment of the present application provides a kind of computer program product, and the computer program product includes Computer program, the computer program realize that the embodiment of the present application first aspect provides when being executed by one or more processors The method the step of.
It is empty that the embodiment of the present application is buffered in preset buffering when receiving preset instructions, by multimedia file to be played Between, after caching, played since preset cushion space obtains multimedia file, and monitor the multimedia file The playing progress rate is set as starting by playing progress rate when the playing progress rate is the end time of the multimedia file Time controls the multimedia file and restarts to play.Since the application is to be buffered in the multimedia file of loop play Preset cushion space reads data from cushion space and plays out one by one, also, is also provided with multimedia file broadcasting At the end of, set current playing progress rate to play start time, control loop is played, is equivalent to, from one frame of cushion space The reading data of one frame play out, and are played to last frame, are further continued for reading first frame and play out, avoid loop play When, switch incoherent problem between playing twice, realizes seamless play.
Description of the drawings
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation process signal of the seamless play method for multimedia file that one embodiment of the application provides Figure;
Fig. 2 is a kind of implementation process signal of the seamless play method for multimedia file that the another embodiment of the application provides Figure;
Fig. 3 is the schematic block diagram for the terminal device that one embodiment of the application provides;
Fig. 4 is the schematic block diagram for the terminal device that the another embodiment of the application provides.
Specific implementation mode
In being described below, for illustration and not for limitation, it is proposed that such as tool of particular system structure, technology etc Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
It should be appreciated that ought use in this specification and in the appended claims, the instruction of term " comprising " is described special Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step, Operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this present specification is merely for the sake of the mesh for describing specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combinations and all possible combinations of one or more of associated item listed, and includes these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solution described herein, illustrated below by specific embodiment.
Fig. 1 is the implementation process schematic diagram of the seamless play method for the multimedia file that one embodiment of the application provides, such as This method may comprise steps of shown in figure:
Multimedia file to be played is buffered in preset cushion space by step S101 when receiving preset instructions.
In the embodiment of the present application, the preset instructions can be the instruction that user's point opens webpage, can also be to more matchmakers Body file carries out the instruction of loop play.As an example, when being loaded with multimedia file in some webpage, the net is pre-set Page point opens the multimedia file of rear loop play webpage load, once user's point opens the webpage, mean that have received it is default Instruction.In the embodiment of the present application, cushion space can be pre-set, multimedia file to be played can be buffered in preset Cushion space, multimedia file, can be according to the broadcastings per frame data in multimedia file when preset cushion space stores Order buffer is in buffer queue.Multimedia file can be audio file, can also be video file, can be by when storage According to:First frame data of multimedia file to be played, the second frame data ..., the forms of last frame data stored.
Step S102 is played, and monitor institute after caching since preset cushion space obtains multimedia file State the playing progress rate of multimedia file.
It in the embodiment of the present application, can be after multimedia file to be played caches, from preset cushion space Data are obtained one by one to play out, and the playing progress rate for monitoring multimedia file is needed during broadcasting, it is described to broadcast Degree of putting into is time point currently playing in the multimedia file playing process.
As an example, the data cached in the buffer queue of cushion space are:P1, P2, P3, P4 ..., Pn, caching A total of n frame data of multimedia file after being cached to last frame data in buffer queue, can send a caching and terminate Instruction, meanwhile, start decoding data plays out one by one from the beginning to the end from preset buffer queue:Obtain P1 simultaneously It plays, obtain P2 and simultaneously play, obtain P3 and play, frame data broadcasting at once is not got when acquisition, but according to each Reproduction time of the frame data in multimedia file plays out, it is assumed that the playing interval of every two frame data is T, in previous frame number When according to T time after broadcasting, current frame data is played, the time due to obtaining the frame data from buffer queue is less than the frame number According to reproduction time, obtained from buffer queue so each frame data can be realized as it is smooth, without Caton phenomenon.
Certainly, in practical applications, can also be arranged:After the frame data for having cached default frame number, from preset buffering Space obtains data and plays out one by one.This is because in the process that acquisition data play out from buffer queue In be to obtain and play since the first frame data, as long as before obtaining each frame data in sequence, which is buffered in In buffer queue, when the data of front play out, data rearward can be carried out at the same time caching, in this way, Shortening time that since webpage play being opened to multimedia file to a certain extent (or shortens and determines more matchmakers Body file loop play to really start play time).
As an example, the cache-time per frame data is t1, and the playing interval per frame data is T, it is assumed that current cache N Frame data can start to play, then, the data also uncached to n-th frame data are:N-N frames are cached to n-th frame data also The time needed is:(n-N) * t1 are (n-1) * T from current first frame to the time that n-th frame data need is played to, as long as slow Time (n-N) * t1 that n-th frame data also need to is stored to be less than or equal to from current first frame to being played to n-th frame data needs Time be (n-1) * T, certainly, the value of n is the frame number for including in total to the multimedia file from 1.
In practical applications, the time t1 of one frame data of caching is likely less than the playing interval T of every frame data, in this way, only Cache a frame data, so that it may play out to obtain a frame data from buffer queue.
Step S103 sets the playing progress rate when the playing progress rate is the end time of the multimedia file It is set to the time started, the multimedia file is controlled and restarts to play.
In the embodiment of the present application, can be arranged multimedia file from first frame to last frame loop play, i.e., from Head arrives tail loop play, when playing progress rate is the end time of multimedia file, sets playing progress rate to the time started, just Broadcasting can be from the beginning re-started, can be specifically, after playing last frame data, continues to read the from preset cushion space One frame data are decoded broadcasting.Since data to be played are maintained in cushion space, and it is every according to multimedia file What the playing sequence of one frame data was stored, so, during loop play, can last frame broadcasting after, after It is continuous to read the first frame data from cushion space and continue cycling through broadcasting, avoid interim card during loop play, incoherent existing As realizing seamless play.
As an example, it is 0 at the beginning of the broadcasting of the multimedia file of setting:00, the end time 0:30, delay simultaneously It is P1 to Pn to deposit the data cached in queue, can realize loop play according to the playing progress rate of present multimedia file, may be used also To realize loop play according to the sequence of the data in currently playing buffer queue, with the playing progress rate of present multimedia file For, if current playing progress rate is 0:30, then current playing progress rate is set as 0:00, control plays from the beginning, with For the sequence of data in currently playing buffer queue, if the current data for obtaining and playing are Pn (last frame number According to), then it from the beginning reacquires data P1 and plays, after P1 acquisitions data play out, continue according to the number in buffer queue According to sequence obtain and play successively.In this way, no matter according to the playing progress rate of present multimedia file, according further to currently playing Buffer queue in seamless play when may be implemented to switch during loop play of the sequences of data.
Fig. 2 is the flow diagram of the seamless play method for the multimedia file that the another embodiment of the application provides, and is such as schemed Shown this method may comprise steps of:
Step S201 creates audiocontext objects, and is loaded into the audiocontext objects to be played Multimedia file.
In the embodiment of the present application, this Advanced Application Interface of Web Audio API may be used, carry out creating one AudioContext objects, Web Audio API are that Javascript (is based on object and event driven client script language Speech.Its interpreter is referred to as JavaScript engine, is a part for browser, is used on html web page earliest, uses Come give html web page increase dynamic function) in be mainly used in web application handle audio request an advanced application connect Mouthful.
Audiocontext objects can be created during carrying out webpage establishment, and in the audiocontext Multimedia file to be played is loaded into object, once open the webpage, so that it may with loop play multimedia file to be played.
It should be noted that for the browser of WebKit cores, need to add a webkit prefix, that is, create WebkitAudioContext objects.
Step S202, after the instruction for receiving webpage unlatching, by decodeAudioData to the webpage Multimedia file in audiocontext objects carries out asynchronous decoding.
In the embodiment of the present application, once receiving the instruction (for example, user opens the instruction of the webpage) of webpage unlatching, Can by decodeAudioData to the multimedia file in the audiocontext objects of the webpage into line asynchronous solution Code.
Web Audio API (Web Audio API support the audio file of multiple format, for example, common WAV, The audios such as MP3, AAC, OGG) middle-size and small-size audio file is buffered using AudioBuffer methods, can specifically it pass through XMLHttpRequest (var request=new XMLHttpRequest ();XMLHttpRequest is expansible super text This transmission is asked) method to ask audio file to be realized carries out.But it is non-textual since audio file is binary file, It needs responseType=request.open (' GET', url, true);Request.responseType=' arraybuffer'.Response type are Web api interface Response, including a kind of respond style, be read-only category Property) be arranged to ' arraybuffer '.
Step S203 returns to the AudioBuffer examples for housing decoded multimedia file after decoding.
In the embodiment of the present application, after decodeAudioData () is decoded, this function can call a readjustment letter Number is returned stores the audio after decompression comprising unpressed PCM format AudioBuffer examples.The decoded more matchmakers returned Body document instance can be understood as the multimedia file of caching.
Step S202 to step S203 be actually how multimedia file to be played to be buffered in from bottom description it is pre- If cushion space.
Step S204 is arranged at the beginning of the multimedia file plays and is more than with end time, the time started Or it is equal to 0, the end time is less than or equal to the total time of the multimedia file.
In the embodiment of the present application, the time of audio broadcasting, function can be configured by function noteOn (time) Total duration of the time of noteOn (time) no more than audio.For example, the time of audio long attribute duration is 5 minutes, Could be provided as 3 minutes reproduction times, source.noteOn (180000), unit ms), the unisonances such as time are arranged in longest The frequency time is long.We are by taking an audio file as an example, it is assumed that total playing duration of audio file is 5 minutes, we are arranged 3 minutes Reproduction time, i.e., the time started be 0, the end time 3:00.In certain practical application, can also be arranged the time started is not 0, for example, it is also possible to be arranged from 1:00 starts to play, and is played to 4:00, the time started is greater than or is equal to 0, and the end time wants small In or equal to the multimedia file total playing duration.
Step S205 is played, and monitor institute after caching since preset cushion space obtains multimedia file State the playing progress rate of multimedia file.
In the embodiment of the present application, after AudioBuffer loadings finish, pass through function playSound (buffer) function (playSound () function can call under any circumstance) begins preparing for playing out multimedia file.
During broadcasting, reproduction time attribute currentTime can be obtained to monitor the broadcasting of multimedia file Progress, currentTime are used for obtaining or controlling the currently playing time.
Step S206, during monitoring the playing progress rate of the multimedia file, if current playing progress rate is institute At the beginning of stating multimedia file, then the broadcasting within the first preset time is carried out fading in processing.
Step S207, during monitoring the playing progress rate of the multimedia file, if current playing progress rate is institute The second preset time before the end time for stating multimedia file, then carry out place of fading out to the broadcasting within the second preset time Reason.
In the embodiment of the present application, first preset time can be 2 seconds, and the second preset time can also be 2 seconds Clock carries out fading in processing, place of fading out is carried out within two seconds played before terminating within first two seconds that play beginning Reason.Certainly, in practical application, the first preset time and the second preset time can also be other time, the first preset time and Second preset time may be arranged as unequal.
GainNode interfaces indicate volume change.It is an AudioNode audio processing modules, before output use give Determine gain and be applied to input, is located in AudioParam (W3C) interface.
Within the preceding two second time that audio file plays, the yield value of AudioGainNode is adjusted (such as:var GainNode=playNow.gainNode, gainNode.gain.linearRampToValueAtTime (0, currTime); (1,currTime+ctx.FADE_TIME);) audio is faded in.
The song time soon at the end of, that is, it is (current for obtaining or controlling to obtain reproduction time attribute currentTime The time of broadcasting, unit s) in the last two second time that audio file plays, then adjust AudioGainNode yield values (gainNode.gain.linearRampToValueAtTime(1,currTime+duration-ctx.FADE_TIME);(0, currTime+duration);) fade out to audio.
For audio file, fade in processing it can be appreciated that being volume from the small process become larger, processing of fading out It can be appreciated that being volume from big gradually smaller process.
The broadcasting within the first preset time carries out fading in processing:
Adjust currently playing multimedia file the corresponding broadcasting of the first preset time volume by the first preset value to Second preset value, second preset value are more than the first preset value;
The broadcasting within the second preset time processing that fade out includes:
Adjust currently playing multimedia file the corresponding broadcasting of the second preset time volume by third preset value to 4th preset value, the third preset value are more than the 4th preset value.
As an example, it could be provided as, within first two seconds that multimedia file plays, volume gradually increased from 0 To 80% volume, 80% volume is kept to be played to first two seconds that multimedia file terminates, at first two seconds of end, Volume is gradually lowered to 0 from 80%.Volume 0, two second, the volume 80% of the example above are used to illustrate, not to the application Carry out any restrictions.The process that volume is gradually increased and continuously decreased can be increased or decreased according to preset step-length.
Step S208 sets the playing progress rate when the playing progress rate is the end time of the multimedia file It is set to the time started, the multimedia file is controlled and restarts to play.
In the embodiment of the present application, when playing progress rate is the end time of multimedia file, end of fading out is indicated, it is necessary to Loop play is carried out to audio file.It (can be touched when currently playing duration changes by monitoring timeupdate events Hair), then compare reproduction time attribute currentTime (for obtaining or controlling currently playing time, unit s) and sound The duration attribute duration (total duration of media file being obtained, as unit of s) of frequency, certainly, in practical application, can also be The end time for comparing current reproduction time and setting (uses currentTime at the end of audio file plays soon The currently playing time is obtained or controls, unit s) attributes are re-set as 0 (if (this.currentTime> This.duration-buffer) { this.currentTime=0;) or time started, make audio file again from the beginning into Row is played, or is played out at the beginning of the setting.Meanwhile realize sound fade in be played to audio file it is subsequent It fades out, repetitive cycling carries out always in cycles, completes the method provided using the Web Audio API of audio labels and category Property carry out seamless circulating (gapless looping) play purpose.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Fig. 3 is that the schematic block diagram for the terminal device that one embodiment of the application provides only is shown and this Shen for convenience of description It please the relevant part of embodiment.
The terminal device 3 can be the software unit being built in the existing terminal device such as mobile phone, notebook, hard Part unit or the unit of soft or hard combination can also be used as independent pendant and be integrated into the existing such as mobile phone, notebook In equal terminal devices, it is also used as independent terminal device and exists.
The terminal device 3 includes:
Cache module 31, for when receiving preset instructions, multimedia file to be played being buffered in preset slow Rush space;
Playing module 32, for after caching, being played since preset cushion space obtains multimedia file, and The playing progress rate of the multimedia file is monitored, the playing progress rate is currently playing in the multimedia file playing process Time point;
Circular treatment module 33 is used for when the playing progress rate is the end time of the multimedia file, will be described Playing progress rate is set as the time started, controls the multimedia file and restarts to play.
Optionally, the terminal device 3 further includes:
34 are insmoded, for when receiving preset instructions, multimedia file to be played being buffered in preset slow It rushes before space, creates audiocontext objects, and multimedia to be played is loaded into the audiocontext objects File;
The cache module 31 includes:
Decoding unit 311, for receive webpage unlatching instruction after, by decodeAudioData to the net Multimedia file in the audiocontext objects of page carries out asynchronous decoding;
Buffer unit 312, for after decoding, return to house decoded multimedia file AudioBuffer examples.
Optionally, the terminal device 3 further includes:
Institute is arranged before the broadcasting since preset cushion space obtains multimedia file data in setup module 35 It states at the beginning of multimedia file plays and end time, the time started is greater than or equal to 0, the end time is less than Or the total time equal to the multimedia file.
Optionally, the playing module 32 further includes:
Fade in processing unit 321, if at the beginning of being the multimedia file for current playing progress rate, to the Broadcasting within one preset time carries out fading in processing;
Fade out processing unit 322, if before the end time for being the multimedia file for current playing progress rate Second preset time then carries out processing of fading out to the broadcasting within the second preset time.
Optionally, the processing unit 321 that fades in is additionally operable to:
Adjust currently playing multimedia file the corresponding broadcasting of the first preset time volume by the first preset value to Second preset value, second preset value are more than the first preset value;
The processing unit 322 that fades out is additionally operable to:
Adjust currently playing multimedia file the corresponding broadcasting of the second preset time volume by third preset value to 4th preset value, the third preset value are more than the 4th preset value.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of the terminal device are divided into different functional units or module, to complete All or part of function described above.Each functional unit, module in embodiment can be integrated in a processing unit, Can also be that each unit physically exists alone, can also be during two or more units be integrated in one unit, above-mentioned collection At unit both may be used hardware form realize, can also be realized in the form of SFU software functional unit.In addition, each function Unit, module specific name also only to facilitate mutually distinguish, the protection domain being not intended to limit this application.Above-mentioned dress Set middle unit, module specific work process, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
Fig. 4 is the schematic block diagram for the terminal device that the another embodiment of the application provides.As shown in figure 4, the end of the embodiment End equipment 4 includes:It one or more processors 40, memory 41 and is stored in the memory 41 and can be in the processing The computer program 42 run on device 40.The processor 40 realizes above-mentioned each multimedia when executing the computer program 42 Step in the seamless play embodiment of the method for file, such as step S101 to S103 shown in FIG. 1.Alternatively, the processor The function of each module/unit in above-mentioned terminal device embodiment is realized when the 40 execution computer program 42, such as shown in Fig. 3 The function of module 31 to 33.
Illustratively, the computer program 42 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 41, and are executed by the processor 40, to complete the application.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 42 in the terminal device 4 is described.For example, the computer program 42 can be divided It is cut into cache module, playing module, circular treatment module.
The cache module, for when receiving preset instructions, multimedia file to be played being buffered in preset Cushion space;
The playing module, for after caching, being played since preset cushion space obtains multimedia file, And the playing progress rate of the multimedia file is monitored, the playing progress rate is currently playing in the multimedia file playing process Time point;
The circular treatment module is used for when the playing progress rate is the end time of the multimedia file, by institute It states playing progress rate and is set as the time started, control the multimedia file and restart to play.
Other modules or unit can refer to the description in embodiment shown in Fig. 3, and details are not described herein.
The terminal device includes but are not limited to processor 40, memory 41.It will be understood by those skilled in the art that figure 4 be only an example of terminal device 4, does not constitute the restriction to terminal device 4, may include more more or less than illustrating Component, either combine certain components or different components, for example, the terminal device can also include input equipment, it is defeated Go out equipment, network access equipment, bus etc..
The processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
The memory 41 can be the internal storage unit of the terminal device 4, such as the hard disk of terminal device 4 or interior It deposits.The memory 41 can also be to be equipped on the External memory equipment of the terminal device 4, such as the terminal device 4 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 41 can also both include the storage inside list of the terminal device 4 Member also includes External memory equipment.The memory 41 is for storing needed for the computer program and the terminal device Other programs and data.The memory 41 can be also used for temporarily storing the data that has exported or will export.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed Scope of the present application.
In embodiment provided herein, it should be understood that disclosed terminal device and method can pass through it Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the module or list Member division, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown The mutual coupling or direct-coupling or communication connection shown or discussed can be by some interfaces, between device or unit Coupling or communication connection are connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can be stored in a computer read/write memory medium.Based on this understanding, the application realizes above-mentioned implementation All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium May include:Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic of the computer program code can be carried Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to legislation in jurisdiction and the requirement of patent practice Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and Telecommunication signal.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although with reference to aforementioned reality Example is applied the application is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed Or replace, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Within the protection domain of the application.

Claims (10)

1. a kind of seamless play method of multimedia file, which is characterized in that including:
When receiving preset instructions, multimedia file to be played is buffered in preset cushion space;
After caching, played since preset cushion space obtains the multimedia file, and monitor the multimedia The playing progress rate of file, the playing progress rate are time point currently playing in the multimedia file playing process;
When the playing progress rate is the end time of the multimedia file, it sets the playing progress rate to the time started, The multimedia file is controlled to restart to play.
2. the seamless play method of multimedia file as described in claim 1, which is characterized in that described to receive default finger When enabling, before multimedia file to be played is buffered in preset cushion space, including:
Audiocontext objects are created, and multimedia file to be played is loaded into the audiocontext objects;
It is described when receiving preset instructions, multimedia file data to be played, which is buffered in preset cushion space, includes:
After the instruction for receiving webpage unlatching, by decodeAudioData to the audiocontext objects of the webpage In multimedia file carry out asynchronous decoding;
After decoding, the AudioBuffer examples for housing decoded multimedia file are returned.
3. the seamless play method of multimedia file as described in claim 1, which is characterized in that described from preset buffering sky Between obtain before multimedia file data starts broadcasting, further include:
It is arranged at the beginning of the multimedia file plays and end time, the time started is greater than or equal to 0, the knot The beam time is less than or equal to the total time of the multimedia file.
4. the seamless play method of multimedia file as described in claim 1, which is characterized in that monitoring the multimedia text During the playing progress rate of part, including:
If at the beginning of current playing progress rate is the multimedia file, being carried out to the broadcasting within the first preset time Fade in processing;
It is default to second if current playing progress rate is the second preset time before the end time of the multimedia file Broadcasting within time carries out processing of fading out.
5. the seamless play method of multimedia file as claimed in claim 4, which is characterized in that described to the first preset time Within broadcasting carry out fading in processing include:
Currently playing multimedia file is adjusted in the volume of the corresponding broadcasting of the first preset time by the first preset value to second Preset value, second preset value are more than the first preset value;
The broadcasting within the second preset time processing that fade out includes:
Currently playing multimedia file is adjusted in the volume of the corresponding broadcasting of the second preset time by third preset value to the 4th Preset value, the third preset value are more than the 4th preset value.
6. a kind of terminal device, which is characterized in that including:
Cache module, for when receiving preset instructions, multimedia file to be played to be buffered in preset cushion space;
Playing module, for after caching, being played since preset cushion space obtains multimedia file, and monitor institute The playing progress rate of multimedia file is stated, the playing progress rate is the time currently playing in the multimedia file playing process Point;
Circular treatment module, for the playing progress rate be the multimedia file end time when, by it is described play into Degree is set as the time started, controls the multimedia file and restarts to play.
7. terminal device as claimed in claim 6, which is characterized in that further include:
It insmods, for when receiving preset instructions, multimedia file to be played to be buffered in preset cushion space Before, audiocontext objects are created, and multimedia file to be played is loaded into the audiocontext objects;
The cache module includes:
Decoding unit, for receive webpage unlatching instruction after, by decodeAudioData to the webpage Multimedia file in audiocontext objects carries out asynchronous decoding;
Buffer unit, for after decoding, returning to the AudioBuffer examples for housing decoded multimedia file.
8. terminal device as claimed in claim 6, which is characterized in that further include:
More matchmakers are arranged before the broadcasting since preset cushion space obtains multimedia file data in setup module At the beginning of body file plays and end time, the time started are greater than or equal to 0, and the end time is less than or equal to The total time of the multimedia file.
9. a kind of terminal device, including memory, processor and it is stored in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 5 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence realizes the step such as any one of claim 1 to 5 the method when the computer program is executed by one or more processors Suddenly.
CN201810179507.6A 2018-03-05 2018-03-05 A kind of seamless play method, terminal device and the storage medium of multimedia file Pending CN108377409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810179507.6A CN108377409A (en) 2018-03-05 2018-03-05 A kind of seamless play method, terminal device and the storage medium of multimedia file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810179507.6A CN108377409A (en) 2018-03-05 2018-03-05 A kind of seamless play method, terminal device and the storage medium of multimedia file

Publications (1)

Publication Number Publication Date
CN108377409A true CN108377409A (en) 2018-08-07

Family

ID=63018165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810179507.6A Pending CN108377409A (en) 2018-03-05 2018-03-05 A kind of seamless play method, terminal device and the storage medium of multimedia file

Country Status (1)

Country Link
CN (1) CN108377409A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111918129A (en) * 2020-08-10 2020-11-10 四川长虹电器股份有限公司 Method, system and terminal for playing videos in seamless connection mode
CN112383618A (en) * 2020-11-12 2021-02-19 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112887774A (en) * 2021-02-05 2021-06-01 冠捷显示科技(厦门)有限公司 Method and device for playing content seamlessly
CN115243089A (en) * 2022-07-30 2022-10-25 天翼云科技有限公司 Audio and video synchronous rendering method and device and electronic equipment
WO2023284437A1 (en) * 2021-07-13 2023-01-19 北京字跳网络技术有限公司 Media file processing method and apparatus, device, readable storage medium, and product

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685549A (en) * 2011-03-11 2012-09-19 国家广播电影电视总局广播科学研究院 Real-time and non-real time program content switching method and device in voice broadcasting of train
CN102903377A (en) * 2012-11-01 2013-01-30 北京奇艺世纪科技有限公司 Method and device for playing video with multiple video segments
CN104581398A (en) * 2013-10-15 2015-04-29 富泰华工业(深圳)有限公司 Cache data management system and method
CN105657546A (en) * 2015-12-29 2016-06-08 小米科技有限责任公司 Multimedia file playing method and device and terminal
CN106331870A (en) * 2015-07-02 2017-01-11 天脉聚源(北京)科技有限公司 Method and system for previewing webpage video file
CN106358062A (en) * 2016-08-24 2017-01-25 乐视控股(北京)有限公司 Browser video file playing processing method and equipment
US20170098464A1 (en) * 2015-10-02 2017-04-06 Twitter, Inc. Gapless video looping
CN107123424A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 Audio file processing method and processing device
CN107465598A (en) * 2017-08-11 2017-12-12 北京安云世纪科技有限公司 Audio and video playing method, apparatus and terminal
CN107547940A (en) * 2017-09-13 2018-01-05 广州酷狗计算机科技有限公司 Video playback processing method, equipment and computer-readable recording medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685549A (en) * 2011-03-11 2012-09-19 国家广播电影电视总局广播科学研究院 Real-time and non-real time program content switching method and device in voice broadcasting of train
CN102903377A (en) * 2012-11-01 2013-01-30 北京奇艺世纪科技有限公司 Method and device for playing video with multiple video segments
CN104581398A (en) * 2013-10-15 2015-04-29 富泰华工业(深圳)有限公司 Cache data management system and method
CN106331870A (en) * 2015-07-02 2017-01-11 天脉聚源(北京)科技有限公司 Method and system for previewing webpage video file
US20170098464A1 (en) * 2015-10-02 2017-04-06 Twitter, Inc. Gapless video looping
CN105657546A (en) * 2015-12-29 2016-06-08 小米科技有限责任公司 Multimedia file playing method and device and terminal
CN106358062A (en) * 2016-08-24 2017-01-25 乐视控股(北京)有限公司 Browser video file playing processing method and equipment
CN107123424A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 Audio file processing method and processing device
CN107465598A (en) * 2017-08-11 2017-12-12 北京安云世纪科技有限公司 Audio and video playing method, apparatus and terminal
CN107547940A (en) * 2017-09-13 2018-01-05 广州酷狗计算机科技有限公司 Video playback processing method, equipment and computer-readable recording medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BORIS SMUS: "Getting Started with Web Audio API", 《HTML5 ROCKS》 *
PETELE: "gapless looping audio html5", 《STACK OVERFLOW》 *
USER1693593: "Create Seamless Loop of Audio-Web", 《STACK OVERFLOW》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111918129A (en) * 2020-08-10 2020-11-10 四川长虹电器股份有限公司 Method, system and terminal for playing videos in seamless connection mode
CN111918129B (en) * 2020-08-10 2022-04-01 四川长虹电器股份有限公司 Method, system and terminal for playing videos in seamless connection mode
CN112383618A (en) * 2020-11-12 2021-02-19 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112383618B (en) * 2020-11-12 2022-09-13 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112887774A (en) * 2021-02-05 2021-06-01 冠捷显示科技(厦门)有限公司 Method and device for playing content seamlessly
WO2023284437A1 (en) * 2021-07-13 2023-01-19 北京字跳网络技术有限公司 Media file processing method and apparatus, device, readable storage medium, and product
CN115243089A (en) * 2022-07-30 2022-10-25 天翼云科技有限公司 Audio and video synchronous rendering method and device and electronic equipment
CN115243089B (en) * 2022-07-30 2024-01-02 天翼云科技有限公司 Audio and video synchronous rendering method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN108377409A (en) A kind of seamless play method, terminal device and the storage medium of multimedia file
CN107948735A (en) Video playing method and device and electronic equipment
CN106126164B (en) A kind of sound effect treatment method and terminal device
CN102468989B (en) The method and system of network data
CN103618942A (en) Smart television, as well as method and device for playing browser webpage video of smart television
CN110110262A (en) Browser EMS memory management process, device and equipment
CN102665137B (en) Control method and the terminal of media player
CN102722350B (en) Appear the Audio Processing ability of Offhost
CN103475932A (en) Seamless on-line playing method and device of network video and network television system
CN104427404A (en) Video segment extraction and play methods and devices
CN108922528B (en) Method and apparatus for processing speech
CN104782136A (en) Processing video data in a cloud
US20200265843A1 (en) Speech broadcast method, device and terminal
US10007613B2 (en) Reconfigurable fetch pipeline
CN107846621A (en) Delay process method, system and electronic equipment
WO2017099888A1 (en) Reduced power consumption for browsing websites
CN107547748A (en) A kind of picture management method, terminal and computer-readable recording medium
CN107622101A (en) Play method and device, the electronic equipment of song
CN109686372B (en) Resource playing control method and device
CN104503839A (en) Voice frequency-based method and device for optimizing computing equipment
CN106658232B (en) The method and electric terminal of label editing
CN110825994A (en) Page buffer processing method and device, computer equipment and storage medium
CN110381379A (en) Idle method, test method and the Related product of network machine top box
CN110162350A (en) Display methods, device, server and the storage medium of notification bar information
CN109144354B (en) Method and equipment for rotating player view layer

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180807

RJ01 Rejection of invention patent application after publication