mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 14:53:24 +00:00
feat: audio track selector
This commit is contained in:
16
.github/workflows/build-mobile-comment.yml
vendored
16
.github/workflows/build-mobile-comment.yml
vendored
@@ -50,10 +50,10 @@ jobs:
|
||||
- name: Rename apk
|
||||
run: cd apps/expo && mv android/app/build/outputs/apk/release/app-release.apk android/app/build/outputs/apk/release/movie-web.apk
|
||||
|
||||
- name: Comment on pull request
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
filePath: ./apps/expo/android/app/build/outputs/apk/release/movie-web.apk
|
||||
# - name: Comment on pull request
|
||||
# uses: thollander/actions-comment-pull-request@v2
|
||||
# with:
|
||||
# filePath: ./apps/expo/android/app/build/outputs/apk/release/movie-web.apk
|
||||
|
||||
- name: Upload movie-web.apk as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -103,10 +103,10 @@ jobs:
|
||||
cd ios/build/Build/Products/Release-iphoneos
|
||||
zip -r ../../../movie-web.ipa Payload
|
||||
|
||||
- name: Comment on pull request
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
filePath: ./apps/expo/ios/build/movie-web.ipa
|
||||
# - name: Comment on pull request
|
||||
# uses: thollander/actions-comment-pull-request@v2
|
||||
# with:
|
||||
# filePath: ./apps/expo/ios/build/movie-web.ipa
|
||||
|
||||
- name: Upload movie-web.ipa as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
20
.github/workflows/build-mobile.yml
vendored
20
.github/workflows/build-mobile.yml
vendored
@@ -46,11 +46,11 @@ jobs:
|
||||
- name: Rename apk
|
||||
run: cd apps/expo && mv android/app/build/outputs/apk/release/app-release.apk android/app/build/outputs/apk/release/movie-web.apk
|
||||
|
||||
- name: Comment on pull request
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
filePath: ./apps/expo/android/app/build/outputs/apk/release/movie-web.apk
|
||||
# - name: Comment on pull request
|
||||
# if: github.event_name == 'pull_request'
|
||||
# uses: thollander/actions-comment-pull-request@v2
|
||||
# with:
|
||||
# filePath: ./apps/expo/android/app/build/outputs/apk/release/movie-web.apk
|
||||
|
||||
- name: Upload movie-web.apk as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -95,11 +95,11 @@ jobs:
|
||||
cd ios/build/Build/Products/Release-iphoneos
|
||||
zip -r ../../../movie-web.ipa Payload
|
||||
|
||||
- name: Comment on pull request
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
filePath: ./apps/expo/ios/build/movie-web.ipa
|
||||
# - name: Comment on pull request
|
||||
# if: github.event_name == 'pull_request'
|
||||
# uses: thollander/actions-comment-pull-request@v2
|
||||
# with:
|
||||
# filePath: ./apps/expo/ios/build/movie-web.ipa
|
||||
|
||||
- name: Upload movie-web.ipa as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
70
apps/expo/src/components/player/AudioTrackSelector.tsx
Normal file
70
apps/expo/src/components/player/AudioTrackSelector.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import { Pressable, ScrollView, View } from "react-native";
|
||||
import Modal from "react-native-modal";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
|
||||
import colors from "@movie-web/tailwind-config/colors";
|
||||
|
||||
import { useBoolean } from "~/hooks/useBoolean";
|
||||
import { useAudioTrackStore } from "~/stores/audio";
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
import { Button } from "../ui/Button";
|
||||
import { Text } from "../ui/Text";
|
||||
import { Controls } from "./Controls";
|
||||
|
||||
export const CaptionsSelector = () => {
|
||||
const tracks = usePlayerStore((state) => state.interface.audioTracks);
|
||||
|
||||
const setSelectedAudioTrack = useAudioTrackStore(
|
||||
(state) => state.setSelectedAudioTrack,
|
||||
);
|
||||
|
||||
const { isTrue, on, off } = useBoolean();
|
||||
|
||||
if (!tracks?.length) return null;
|
||||
|
||||
return (
|
||||
<View className="max-w-36 flex-1">
|
||||
<Controls>
|
||||
<Button
|
||||
title="Audio"
|
||||
variant="outline"
|
||||
onPress={on}
|
||||
iconLeft={
|
||||
<MaterialCommunityIcons
|
||||
name="volume-high"
|
||||
size={24}
|
||||
color={colors.primary[300]}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</Controls>
|
||||
|
||||
<Modal
|
||||
isVisible={isTrue}
|
||||
onBackdropPress={off}
|
||||
supportedOrientations={["portrait", "landscape"]}
|
||||
style={{
|
||||
width: "35%",
|
||||
justifyContent: "center",
|
||||
alignSelf: "center",
|
||||
}}
|
||||
>
|
||||
<ScrollView className="flex-1 bg-gray-900">
|
||||
<Text className="text-center font-bold">Select audio</Text>
|
||||
{tracks?.map((track) => (
|
||||
<Pressable
|
||||
className="flex w-full flex-row justify-between p-3"
|
||||
key={track.language}
|
||||
onPress={() => {
|
||||
setSelectedAudioTrack(track);
|
||||
off();
|
||||
}}
|
||||
>
|
||||
<Text>{track.name}</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
</ScrollView>
|
||||
</Modal>
|
||||
</View>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user