Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Geoffrey Métais
VLC-Android
Commits
584bc229
Commit
584bc229
authored
May 09, 2018
by
Geoffrey Métais
Browse files
Allow VLC to receive shared urls
parent
e058d8af
Changes
2
Hide whitespace changes
Inline
Side-by-side
vlc-android/AndroidManifest.xml
View file @
584bc229
...
...
@@ -411,6 +411,11 @@
<data
android:pathPattern=
".*\\.xspf"
/>
<data
android:pathPattern=
".*\\.XSPF"
/>
</intent-filter>
<intent-filter
android:label=
"Play with VLC"
>
<action
android:name=
"android.intent.action.SEND"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<data
android:mimeType=
"*/*"
/>
</intent-filter>
<!-- Search -->
<intent-filter>
<action
android:name=
"android.intent.action.SEARCH"
/>
...
...
vlc-android/src/org/videolan/vlc/StartActivity.java
View file @
584bc229
...
...
@@ -23,8 +23,10 @@
package
org.videolan.vlc
;
import
android.content.ClipData
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.provider.MediaStore
;
...
...
@@ -53,10 +55,19 @@ public class StartActivity extends FragmentActivity implements StoragePermission
final
boolean
tv
=
showTvUi
();
final
String
action
=
intent
!=
null
?
intent
.
getAction
():
null
;
if
(
Intent
.
ACTION_VIEW
.
equals
(
action
)
&&
intent
.
getData
()
!=
null
)
{
if
(
Permissions
.
checkReadStoragePermission
(
this
,
true
))
if
(
Intent
.
ACTION_VIEW
.
equals
(
action
)
&&
intent
.
getData
()
!=
null
&&
Permissions
.
checkReadStoragePermission
(
this
,
true
))
{
startPlaybackFromApp
(
intent
);
return
;
return
;
}
else
if
(
Intent
.
ACTION_SEND
.
equals
(
action
))
{
final
ClipData
cd
=
intent
.
getClipData
();
final
ClipData
.
Item
item
=
cd
!=
null
&&
cd
.
getItemCount
()
>
0
?
cd
.
getItemAt
(
0
)
:
null
;
final
String
mrl
=
item
!=
null
?
item
.
getText
().
toString
()
:
null
;
if
(
mrl
!=
null
)
{
MediaUtils
.
openMediaNoUi
(
Uri
.
parse
(
mrl
));
finish
();
return
;
}
}
// Start application
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment