expo-libmpv 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'com.libmpv'
|
|
4
|
-
version = '0.
|
|
5
|
-
|
|
4
|
+
version = '0.2.3'
|
|
6
5
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
6
|
apply from: expoModulesCorePlugin
|
|
8
7
|
applyKotlinExpoModulesCorePlugin()
|
|
@@ -44,7 +43,7 @@ android {
|
|
|
44
43
|
namespace "com.libmpv"
|
|
45
44
|
defaultConfig {
|
|
46
45
|
versionCode 1
|
|
47
|
-
|
|
46
|
+
versionName "0.2.3"
|
|
48
47
|
}
|
|
49
48
|
lintOptions {
|
|
50
49
|
abortOnError false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibmpvVideoView.d.ts","sourceRoot":"","sources":["../src/LibmpvVideoView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAmChF,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"LibmpvVideoView.d.ts","sourceRoot":"","sources":["../src/LibmpvVideoView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAmChF,eAAO,MAAM,WAAW,+GA8CtB,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
package/build/LibmpvVideoView.js
CHANGED
|
@@ -30,7 +30,6 @@ const EVENT_LOOKUP = {
|
|
|
30
30
|
};
|
|
31
31
|
const LibmpvVideoView = requireNativeView('LibmpvVideo');
|
|
32
32
|
export const LibmpvVideo = React.forwardRef((props, parentRef) => {
|
|
33
|
-
const nativeRef = React.useRef(null);
|
|
34
33
|
// Pass mpv events and logs back up to the parent
|
|
35
34
|
const onLogEvent = (libmpvEvent) => {
|
|
36
35
|
if (props.onLibmpvEvent) {
|
|
@@ -58,15 +57,10 @@ export const LibmpvVideo = React.forwardRef((props, parentRef) => {
|
|
|
58
57
|
return props.onLibmpvLog(libmpvLog);
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
|
-
// Allow a parent to call native methods, such as tweaking subtitle properties
|
|
62
|
-
React.useImperativeHandle(parentRef, () => ({
|
|
63
|
-
runCommand: (pipeDelimitedArguments) => nativeRef.current?.runCommand?.(pipeDelimitedArguments),
|
|
64
|
-
setOptionString: (pipeDelimitedArguments) => nativeRef.current?.setOptionString?.(pipeDelimitedArguments),
|
|
65
|
-
}));
|
|
66
60
|
// The order props are handled in the native code is non-deterministic
|
|
67
61
|
// Each native prop setter checks to see if all required props are set
|
|
68
62
|
// Only then will it try to create an instance of mpv
|
|
69
|
-
return <LibmpvVideoView ref={
|
|
63
|
+
return <LibmpvVideoView ref={parentRef} style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer} playUrl={props.playUrl} isPlaying={props.isPlaying} useHardwareDecoder={props.useHardwareDecoder} surfaceWidth={props.surfaceWidth} surfaceHeight={props.surfaceHeight} selectedAudioTrack={props.selectedAudioTrack} selectedSubtitleTrack={props.selectedSubtitleTrack} seekToSeconds={props.seekToSeconds} onLibmpvEvent={onLogEvent} onLibmpvLog={onLibmpvLog}/>;
|
|
70
64
|
});
|
|
71
65
|
export default LibmpvVideo;
|
|
72
66
|
//# sourceMappingURL=LibmpvVideoView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibmpvVideoView.js","sourceRoot":"","sources":["../src/LibmpvVideoView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAA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AA","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\n\nimport { LibmpvVideoViewProps, LibmpvNativeMethods } from './LibmpvVideo.types';\n\nconst styles: any = {\n videoPlayer: {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n right: 0,\n top: 0\n }\n};\n\nconst EVENT_LOOKUP: any = {\n 0: 'NONE',\n 1: 'SHUTDOWN',\n 2: 'LOG_MESSAGE',\n 3: 'GET_PROPERTY_REPLY',\n 4: 'SET_PROPERTY_REPLY',\n 5: 'COMMAND_REPLY',\n 6: 'START_FILE',\n 7: 'END_FILE',\n 8: 'FILE_LOADED',\n 16: 'CLIENT_MESSAGE',\n 17: 'VIDEO_RECONFIG',\n 18: 'AUDIO_RECONFIG',\n 20: 'SEEK',\n 21: 'PLAYBACK_RESTART',\n 22: 'PROPERTY_CHANGE',\n 24: 'QUEUE_OVERFLOW',\n 25: 'HOOK'\n}\n\nconst LibmpvVideoView: React.ComponentType<LibmpvVideoViewProps> =\n requireNativeView('LibmpvVideo');\n\nexport const LibmpvVideo = React.forwardRef<LibmpvNativeMethods, LibmpvVideoViewProps>((props: any, parentRef: any) => {\n // Pass mpv events and logs back up to the parent\n const onLogEvent = (libmpvEvent: any) => {\n if (props.onLibmpvEvent) {\n if (libmpvEvent && libmpvEvent.nativeEvent) {\n libmpvEvent = libmpvEvent.nativeEvent\n }\n if (libmpvEvent.eventId) {\n libmpvEvent.value = parseInt(libmpvEvent.eventId, 10)\n libmpvEvent.eventKind = EVENT_LOOKUP[libmpvEvent.eventId]\n }\n else if (libmpvEvent.kind === 'long' || libmpvEvent.kind === 'double') {\n libmpvEvent.value = Number(libmpvEvent.value)\n }\n else if (libmpvEvent.kind === 'boolean') {\n libmpvEvent.value = libmpvEvent.value === 'true'\n }\n return props.onLibmpvEvent(libmpvEvent)\n }\n }\n const onLibmpvLog = (libmpvLog: any) => {\n if (props.onLibmpvLog) {\n if (libmpvLog && libmpvLog.nativeEvent) {\n libmpvLog = libmpvLog.nativeEvent\n }\n return props.onLibmpvLog(libmpvLog);\n }\n }\n\n // The order props are handled in the native code is non-deterministic\n // Each native prop setter checks to see if all required props are set\n // Only then will it try to create an instance of mpv\n return <LibmpvVideoView\n ref={parentRef}\n style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer}\n playUrl={props.playUrl}\n isPlaying={props.isPlaying}\n useHardwareDecoder={props.useHardwareDecoder}\n surfaceWidth={props.surfaceWidth}\n surfaceHeight={props.surfaceHeight}\n selectedAudioTrack={props.selectedAudioTrack}\n selectedSubtitleTrack={props.selectedSubtitleTrack}\n seekToSeconds={props.seekToSeconds}\n onLibmpvEvent={onLogEvent}\n onLibmpvLog={onLibmpvLog}\n />\n})\n\nexport default LibmpvVideo\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#! /usr/bin/python3
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import datetime
|
|
6
|
+
|
|
7
|
+
PACKAGE_JSON_PATH = './package.json'
|
|
8
|
+
BUILD_GRADLE_PATH = './android/build.gradle'
|
|
9
|
+
|
|
10
|
+
version = None
|
|
11
|
+
with open(PACKAGE_JSON_PATH,'r') as read_handle:
|
|
12
|
+
for line in read_handle.readlines():
|
|
13
|
+
if 'version' in line:
|
|
14
|
+
version = line.split(':')[1].split(',')[0].strip()
|
|
15
|
+
|
|
16
|
+
if len(sys.argv) < 2:
|
|
17
|
+
print(f"Pass a new version. Current version is {version.replace('"','')}")
|
|
18
|
+
sys.exit(1)
|
|
19
|
+
|
|
20
|
+
if sys.argv[1] == 'read':
|
|
21
|
+
print(version.replace('"',''),end='')
|
|
22
|
+
sys.exit(0)
|
|
23
|
+
|
|
24
|
+
build_date = datetime.datetime.now().strftime('%B %d, %Y')
|
|
25
|
+
build_version = sys.argv[1]
|
|
26
|
+
|
|
27
|
+
def update_info(
|
|
28
|
+
input_path:str,
|
|
29
|
+
version_needle:str=None,
|
|
30
|
+
version_replacement:str=None,
|
|
31
|
+
build_needle:str=None,
|
|
32
|
+
build_replacement:str=None
|
|
33
|
+
):
|
|
34
|
+
print(f"Updating {input_path}")
|
|
35
|
+
file_content = ''
|
|
36
|
+
with open(input_path,'r') as read_handle:
|
|
37
|
+
for line in read_handle.readlines():
|
|
38
|
+
if version_needle and version_needle in line:
|
|
39
|
+
file_content += version_replacement
|
|
40
|
+
elif build_needle and build_needle in line:
|
|
41
|
+
file_content += build_replacement
|
|
42
|
+
else:
|
|
43
|
+
file_content += line
|
|
44
|
+
with open(input_path,'w') as write_handle:
|
|
45
|
+
write_handle.write(file_content)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
update_info(
|
|
49
|
+
input_path=PACKAGE_JSON_PATH,
|
|
50
|
+
version_needle='"version"',
|
|
51
|
+
version_replacement=f' "version": "{build_version}",\n'
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
update_info(
|
|
55
|
+
input_path=BUILD_GRADLE_PATH,
|
|
56
|
+
version_needle='version = ',
|
|
57
|
+
version_replacement=f"version = '{build_version}'"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
update_info(
|
|
62
|
+
input_path=BUILD_GRADLE_PATH,
|
|
63
|
+
version_needle='versionName',
|
|
64
|
+
version_replacement=f' versionName "{build_version}"\n'
|
|
65
|
+
)
|
package/src/LibmpvVideoView.tsx
CHANGED
|
@@ -37,8 +37,6 @@ const LibmpvVideoView: React.ComponentType<LibmpvVideoViewProps> =
|
|
|
37
37
|
requireNativeView('LibmpvVideo');
|
|
38
38
|
|
|
39
39
|
export const LibmpvVideo = React.forwardRef<LibmpvNativeMethods, LibmpvVideoViewProps>((props: any, parentRef: any) => {
|
|
40
|
-
const nativeRef = React.useRef<any>(null);
|
|
41
|
-
|
|
42
40
|
// Pass mpv events and logs back up to the parent
|
|
43
41
|
const onLogEvent = (libmpvEvent: any) => {
|
|
44
42
|
if (props.onLibmpvEvent) {
|
|
@@ -67,19 +65,11 @@ export const LibmpvVideo = React.forwardRef<LibmpvNativeMethods, LibmpvVideoView
|
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
// Allow a parent to call native methods, such as tweaking subtitle properties
|
|
71
|
-
|
|
72
|
-
React.useImperativeHandle(parentRef, () => ({
|
|
73
|
-
runCommand: (pipeDelimitedArguments: string) => nativeRef.current?.runCommand?.(pipeDelimitedArguments),
|
|
74
|
-
setOptionString: (pipeDelimitedArguments: string) => nativeRef.current?.setOptionString?.(pipeDelimitedArguments),
|
|
75
|
-
}));
|
|
76
|
-
|
|
77
|
-
|
|
78
68
|
// The order props are handled in the native code is non-deterministic
|
|
79
69
|
// Each native prop setter checks to see if all required props are set
|
|
80
70
|
// Only then will it try to create an instance of mpv
|
|
81
71
|
return <LibmpvVideoView
|
|
82
|
-
ref={
|
|
72
|
+
ref={parentRef}
|
|
83
73
|
style={props.surfaceStyle ? props.surfaceStyle : styles.videoPlayer}
|
|
84
74
|
playUrl={props.playUrl}
|
|
85
75
|
isPlaying={props.isPlaying}
|