This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
play in background with playback notification implemented
- Loading branch information
Showing
6 changed files
with
218 additions
and
20 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
android/src/main/java/com/stellarscript/vlcvideo/VLCVideoCallbackManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.stellarscript.vlcvideo; | ||
|
||
import android.content.Intent; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class VLCVideoCallbackManager { | ||
|
||
interface IntentCallback { | ||
boolean onNewIntent(final Intent intent); | ||
} | ||
|
||
private Set<IntentCallback> callbacks; | ||
|
||
public VLCVideoCallbackManager() { | ||
callbacks = new HashSet<>(); | ||
} | ||
|
||
public boolean onNewIntent(final Intent intent) { | ||
boolean handled = false; | ||
for (final IntentCallback callback : callbacks) { | ||
if (callback.onNewIntent(intent)) { | ||
handled = true; | ||
} | ||
} | ||
|
||
return handled; | ||
} | ||
|
||
void addCallback(final IntentCallback callback) { | ||
callbacks.add(callback); | ||
} | ||
|
||
void removeCallback(final IntentCallback callback) { | ||
callbacks.remove(callback); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.