Summary of the invention
In view of the above existing problems in the prior art, the present invention provides a kind of, and the browser multiwindow based on VLC plays
Method, comprising:
The library simultaneous libVLC;
The video playing library of the broadcasting correlation function of building encapsulation libVLC, being individually encapsulated every video playing all the way is
IPlayer object individually controls the audio and video playing on corresponding road by the interface function of IPlayer object;
Building for player library play call, browser API adaptation, browser window control, user interaction process with
And adapt to the encapsulation for the player interface that browser JavaScript is called;
User local player is packaged and is called by the interface to the library libVLC, realizes that multi-channel video plays simultaneously
And control;Browser plug-in is responsible for player code calling, different windows switching and user interaction process, browser API adaptation
It is realized with external interface, by the browser plug-in based on VLC, browser is realized plays different windows in the single page simultaneously
Video and divide be shown in display area.
As advanced optimizing for above scheme, the deployment constructs the library libVLC, i.e., by the header file of libVLC, library
File combines deployment with the feature card of video.
As advanced optimizing for above scheme, the function joint plug-in unit of the video further includes audio-video format text
Part, encoding and decoding plug-in unit and rendering output inserter.
As advanced optimizing for above scheme, the video playing library carries out the video playing of single channel individually respectively
Encapsulation, it is every to be all encapsulated as IPlayer object all the way, and corresponding road is individually controlled by the interface function of IPlayer object
Audio and video playing.
As advanced optimizing for above scheme, the video playing library also supports creation is single to play object, realizes
Multiple videos play simultaneously, play out control respectively.
As advanced optimizing for above scheme, the step of video playback capability is realized, is as follows:
It pre-sets played file or plays the URL of media;
LibVLC player object is created, window handle and call back function, calling interface function are set;
The URL of addressing pre-sets inside the library LibVLC played file or broadcasting media, starts to read file or starts network
Agreement obtains Media Stream to be played;
The Media Stream audio, video data that parsing separation obtains, the audio, video data after separation is solved by decoder module
Code;
According to the setting of player clock, to given window, audio data is defeated for the video frame rendering output that decoding is completed
Out to audio frequency apparatus;
Pre- played file or the url data for playing media, which obtain completion or user's forced termination, terminates the video playing of single
Function.
As advanced optimizing for above scheme, the video playing starts over the calling of functional interface realizing
Afterwards, the interface in the library libVLC is called to realize subsequent broadcasting control function.
As advanced optimizing for above scheme, the browser plug-in is based on FireBreath Development Framework, realizes
Browser window, the acquisition of event and the external conversion function of interface.
As advanced optimizing for above scheme, the browser plug-in obtains clear in the initialization procedure incipient stage
It lookes at the top-level window handle of device plug-in unit on a web browser, Windows API is used to create child window object, child window Object Creation
And a player object is bound, i.e., completes the single channel video playing of browser plug-in by player object.
As advanced optimizing for above scheme, the browser plug-in also supports multi-channel video to play, and includes the following:
Browser interaction logic determines the number video for needing to play, and obtains one group of broadcast address (file or URL);
JavaScript code calls card i/f, obtains the window of current idle, obtains a group window serial number;
JavaScript code successively calls player plays interface, transmits a window serial number and a URL every time, follows
Ring completes different windows and plays calling;
The player interface for successively calling child window to bind inside plug-in unit transmits child window handle, starts player plays
Video.
The device for the browser multiwindow broadcasting based on VLC that the present invention also provides a kind of, comprising:
The library libVLC calling module is used for the library simultaneous libVLC;
Video playing library module, the video playing library of the broadcasting correlation function for constructing encapsulation libVLC, is individually encapsulated
It is IPlayer object per video playing all the way, is broadcast by the audio-video that the interface function of IPlayer object individually controls corresponding road
It puts;
Browser plug-in module, controlled for constructing player library broadcasting calling, browser API adaptation, browser window,
User interaction process and the encapsulation for adapting to the player interface that browser JavaScript is called.
The present invention by adopting the above technical scheme, compared with prior art, a kind of more windows of browser based on VLC of the invention
The method and device thereof that mouth plays, have the advantages that
1. the method and device thereof that a kind of browser multiwindow based on VLC of the invention plays, overcome currently due to
Browser plug-in development interface is different and needs the problem of individually developing and disposing, and browser plug-in of the invention is selected
FireBreath Development Framework, the dynamic base generated using FireBreath frame, it is only necessary to which primary registration can be completed
ActiveX registration and NPAPI plug-in registration call the JS code of plug-in unit also only to need to write one since interface is unified in webpage
Part, it can be compatible with the browser for supporting ActiveX and NPAPI browser plug-in development interface, while effectively mitigating developer
Task amount, improve developer's working efficiency.
2. the method and device thereof that a kind of browser multiwindow based on VLC of the invention plays, overcome and broadcast at this stage
Putting device plug-in unit can only play with video all the way, need browser code to be embedded in multiple plug-in units if multichannel to be realized plays simultaneously
The problem of, the stability of browser is greatly strengthened, plug-in unit of the invention supports multichannel to play simultaneously, supports display abundant
Mode, while while also supporting full frame, watches multi-channel video, enhances the visual experience effect of user.
Specific embodiment
In order to make the objectives, technical solutions and advantages of the present invention clearer, right below by attached drawing and embodiment
The present invention is further elaborated.However, it should be understood that specific embodiment described herein is only used to explain this hair
Range that is bright, being not intended to restrict the invention.
Refering to fig. 1, the method for the browser multiwindow broadcasting based on VLC that the present invention provides a kind of, comprising:
The library simultaneous libVLC;
The video playing library of the broadcasting correlation function of building encapsulation libVLC, being individually encapsulated every video playing all the way is
IPlayer object individually controls the audio and video playing on corresponding road by the interface function of IPlayer object;
Building for player library play call, browser API adaptation, browser window control, user interaction process with
And adapt to the encapsulation for the player interface that browser JavaScript is called;
User local player is packaged and is called by the interface to the library libVLC, realizes that multi-channel video plays simultaneously
And control;Browser plug-in is responsible for player code calling, different windows switching and user interaction process, browser API adaptation
It is realized with external interface, by the browser plug-in based on VLC, browser is realized plays different windows in the single page simultaneously
Video and divide be shown in display area.
As advanced optimizing for above scheme, the deployment constructs the library libVLC, i.e., by the header file of libVLC, library
File combines deployment with the feature card of video.
As advanced optimizing for above scheme, the function joint plug-in unit of the video further includes audio-video format text
Part, encoding and decoding plug-in unit and rendering output inserter.
As advanced optimizing for above scheme, the video playing library carries out the video playing of single channel individually respectively
Encapsulation, it is every to be all encapsulated as IPlayer object all the way, and corresponding road is individually controlled by the interface function of IPlayer object
Audio and video playing;Preferably, the broadcasting object interface in video playing library provided by the invention includes:
Played file is set or plays the URL of media;
Broadcast window handle is set;
Beginning/end plays;
Broadcasting speed, volume, the ratio of width to height are set;
Suspending/resuming plays, and play position jumps;
Broadcast state, play time obtain;
Screenshot, the video recording of video playing;
Play parameter setting.
As advanced optimizing for above scheme, the video playing library also supports creation is single to play object, realizes
Multiple videos play simultaneously, play out control respectively.
As shown in Fig. 2, advanced optimizing as above scheme, the step of video playback capability is realized, is as follows:
S1 pre-sets played file or plays the URL of media;
S2 creates libVLC player object, calls libvlc_media_new_path or libvlc_media_new_
Window handle and call back function is arranged in location function, calls libvlc_media_player_play interface;
The URL of addressing pre-sets inside the library S3, LibVLC played file or broadcasting media, starts to read file or starts net
Network agreement obtains Media Stream to be played;
S4, parsing separation obtain Media Stream audio, video data, by the audio, video data after separation by decoder module into
Row decoding;
S5, according to the setting of player clock, the video frame rendering that decoding is completed is exported to given window, audio data
It exports to audio frequency apparatus;
S6, pre- played file or the url data for playing media, which obtain completion or user's forced termination, terminates the video of single
Playing function.
As advanced optimizing for above scheme, the video playing starts over the calling of functional interface realizing
Afterwards, the interface in the library libVLC is called to realize subsequent broadcasting control function.
As advanced optimizing for above scheme, the browser plug-in is based on FireBreath Development Framework, realizes
Browser window, the acquisition of event and the external conversion function of interface.
As advanced optimizing for above scheme, the browser plug-in obtains clear in the initialization procedure incipient stage
It lookes at the top-level window handle of device plug-in unit on a web browser, Windows API is used to create child window object, child window Object Creation
And a player object is bound, that is, completes the single channel video playing of browser plug-in;Preferably, the present invention uses
Windows API creates 16 sub- window objects, i.e. the corresponding player of 16 windows can play different videos simultaneously.
As shown in Fig. 2, advanced optimizing as above scheme, 16 windows can realize that window display pattern is cut
It changes, the browser plug-in supports 1,4,6,9, more than 16 seed windows to show arrangement mode, respectively corresponds in insert window
Show 1,4,6,9,16 child window, when display window, the preferential window for showing that serial number is forward, extra window is hidden place
Reason.
For example, first window occupies entire window area under 1 window scheme;4,9, under 16 4 kind of mode, child window is pressed
Product of showing up divides equally plug-in unit display area, i.e. 2x2,3x3 and 4x4 mode arranges;Under 6 window schemes, plug-in unit is averagely divided according to 3x3
Window area, first window occupy the upper left corner region 2x2, other 5 windows point account for other 5 unit areas;Switch mode
When, it is first determined display window number, according to window entirety size and display pattern, calculate each window to be shown coordinate and
Size, adjustment, movement simultaneously show that child window, the window not shown do hiding processing.
As advanced optimizing for above scheme, the single window video content differentiation of the window display pattern passes through
Child window draws white spaces and carries out signature, and the same time, only one window was in selected state, the window of selected state
Mouth draws red frame, can click to switch with API Calls by mouse and choose child window.
As advanced optimizing for above scheme, the browser plug-in also supports played in full screen;It is double under normal state
Hit any video child window enter it is full frame, display pattern does not change, and at most can show simultaneously 16 roads under full frame state
The video of broadcasting;It, can be in switching display single window or multiple windows under full frame state;Under full frame state, esc key is exited entirely
Screen;Full frame function, full frame state mono-/multi- windows exchange are intercepted and captured mouse event by plug-in unit and are realized, exit full frame by plug-in unit section
Obtain KeyEvent realization.
As advanced optimizing for above scheme, the browser plug-in also supports multi-channel video to play, and includes the following:
Browser interaction logic determines the number video for needing to play, and obtains one group of broadcast address (file or URL);
JavaScript code calls card i/f, obtains the window of current idle, obtains a group window serial number;
JavaScript code successively calls player plays interface, transmits a window serial number and a URL every time, follows
Ring completes different windows and plays calling;
The player interface for successively calling child window to bind inside plug-in unit transmits child window handle, starts player plays
Video.
The device for the browser multiwindow broadcasting based on VLC that the present invention also provides a kind of, comprising:
The library libVLC calling module is used for the library simultaneous libVLC;
Video playing library module, the video playing library of the broadcasting correlation function for constructing encapsulation libVLC, is individually encapsulated
It is IPlayer object per video playing all the way, is broadcast by the audio-video that the interface function of IPlayer object individually controls corresponding road
It puts;
Browser plug-in module, controlled for constructing player library broadcasting calling, browser API adaptation, browser window,
User interaction process and the encapsulation for adapting to the player interface that browser JavaScript is called.
The method that a kind of browser multiwindow based on VLC of the invention plays, including the library simultaneous libVLC, building play
Library and browser video plug-in unit are controlled, user local player is realized more by the packaging and calling of the interface to the library libVLC
Road video plays simultaneously and control;Browser plug-in is responsible for player code calling, multiwindow switching and user interaction process, clear
The device API that lookes at adaptation and external interface realize that, by inserting browser plug-in, browser may be implemented in the single page while play multichannel
Video and divide be shown in display area.Browser plug-in of the invention selects FireBreath Development Framework, uses
The dynamic base that FireBreath frame generates can be completed at the same time ActiveX registration and NPAPI plug-in registration, effectively mitigate and open
The task amount of hair personnel improves developer's working efficiency;Browser plug-in of the invention supports the multi-channel video of browser same
When play, watch multi-channel video when supporting video playing display mode abundant, while also supporting full frame, enhance the vision of user
Experience effect.
In addition, it should be understood that although this specification is described in terms of embodiments, but not each embodiment is only wrapped
Containing an independent technical solution, this description of the specification is merely for the sake of clarity, and those skilled in the art should
It considers the specification as a whole, the technical solutions in the various embodiments may also be suitably combined, forms those skilled in the art
The other embodiments being understood that.