Download Jar. Uses 0K of libraries. Click here for Pure Java version (1775L/12K).
1 | !7 |
2 | |
3 | lib 1400035 // vlcj player |
4 | |
5 | import static uk.co.caprica.vlcjplayer.Application.application; |
6 | |
7 | import uk.co.caprica.vlcj.player.embedded.*; |
8 | import uk.co.caprica.vlcjplayer.event.*; |
9 | import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent; |
10 | import uk.co.caprica.vlcj.discovery.NativeDiscovery; |
11 | import uk.co.caprica.vlcj.log.NativeLog; |
12 | import uk.co.caprica.vlcj.runtime.RuntimeUtil; |
13 | import uk.co.caprica.vlcj.runtime.streams.NativeStreams; |
14 | import uk.co.caprica.vlcjplayer.view.debug.DebugFrame; |
15 | import uk.co.caprica.vlcjplayer.view.effects.EffectsFrame; |
16 | import uk.co.caprica.vlcjplayer.view.main.MainFrame; |
17 | import uk.co.caprica.vlcjplayer.view.messages.NativeLogFrame; |
18 | |
19 | static NativeStreams nativeStreams; |
20 | static JFrame mainFrame, messagesFrame, effectsFrame, debugFrame; |
21 | static NativeLog nativeLog; |
22 | |
23 | p/*-subst*/ { // fullscreen still has a frame with Substance |
24 | // This will locate LibVLC for the vast majority of cases |
25 | new NativeDiscovery().discover(); |
26 | startPlayer(); |
27 | |
28 | if (nempty(args)) { |
29 | S fileToPlay = first(args); |
30 | if (fileExists(fileToPlay)) { |
31 | application().addRecentMedia(fileToPlay); |
32 | application().mediaPlayerComponent().getMediaPlayer().playMedia(fileToPlay); |
33 | } |
34 | } |
35 | |
36 | hideConsole(); |
37 | } |
38 | |
39 | svoid startPlayer { |
40 | swing { |
41 | final EmbeddedMediaPlayerComponent mediaPlayerComponent = application().mediaPlayerComponent(); |
42 | |
43 | mainFrame = new MainFrame(); |
44 | onWindowClosingDoOnly(mainFrame, r { |
45 | mediaPlayerComponent.getMediaPlayer().stop(); |
46 | mediaPlayerComponent.release(); |
47 | if (nativeStreams != null) nativeStreams.release(); |
48 | application().post(ShutdownEvent.INSTANCE); |
49 | cleanKillInNewThread(); |
50 | }); |
51 | |
52 | EmbeddedMediaPlayer embeddedMediaPlayer = mediaPlayerComponent.getMediaPlayer(); |
53 | embeddedMediaPlayer.setFullScreenStrategy(new VlcjPlayerFullScreenStrategy(mainFrame)); |
54 | |
55 | nativeLog = mediaPlayerComponent.getMediaPlayerFactory().newLog(); |
56 | |
57 | messagesFrame = new NativeLogFrame(nativeLog); |
58 | effectsFrame = new EffectsFrame(); |
59 | debugFrame = new DebugFrame(); |
60 | |
61 | mainFrame.setVisible(true); |
62 | } |
63 | } |
64 | |
65 | sclass VlcjPlayerFullScreenStrategy extends DefaultAdaptiveRuntimeFullScreenStrategy { |
66 | *(Window window) { super(window); } |
67 | |
68 | @Override |
69 | protected void beforeEnterFullScreen() { |
70 | application().post(BeforeEnterFullScreenEvent.INSTANCE); |
71 | } |
72 | |
73 | @Override |
74 | protected void afterExitFullScreen() { |
75 | application().post(AfterExitFullScreenEvent.INSTANCE); |
76 | } |
77 | } |
Began life as a copy of #1016053
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016320 |
Snippet name: | VLCJ Player v2 (WORKS on Linux & Windows if VLC is installed) |
Eternal ID of this version: | #1016320/13 |
Text MD5: | 36937e9cbf7a959c2eff92c2b6462b34 |
Transpilation MD5: | 13bf432ab8b65461ae16db91a81d903f |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-15 20:31:54 |
Source code size: | 2551 bytes / 77 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 601 / 1464 |
Version history: | 12 change(s) |
Referenced in: | [show references] |