Skip to content

Commit

Permalink
FCE-748: support for protobufs (#246)
Browse files Browse the repository at this point in the history
## Description

- Updated mobile SDK to support protobufs for media events.
- This PR does not support old version of handling media events via JSON
so this is a **BREAKING CHANGE.**

## Motivation and Context

New version of fishjam added protobufs for media events.

## How has this been tested?

- Run and tested bidirectional connection between Android/iOS

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to
      not work as expected)
  • Loading branch information
MiloszFilimowski authored Dec 2, 2024
1 parent a9c9489 commit d2be0f7
Show file tree
Hide file tree
Showing 54 changed files with 38,801 additions and 1,922 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ module.exports = {
argsIgnorePattern: "^_",
},
],
"arrow-body-style": ["error", "as-needed"]
},
};
8 changes: 7 additions & 1 deletion .github/workflows/react_native_e2e_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ jobs:
rn_e2e_android:
runs-on: ubuntu-latest
timeout-minutes: 40
permissions:
contents: read
packages: read
services:
fishjam:
image: ghcr.io/fishjam-dev/fishjam:0.6.2
image: ghcr.io/fishjam-cloud/fishjam:0.10.0-dev
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
FJ_CHECK_ORIGIN: false
FJ_HOST: localhost:5002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ const createGridTracksFromPeer = (
export const parsePeersToTracks = (
localPeer: PeerWithTracks<PeerMetadata> | null,
remotePeers: PeerWithTracks<PeerMetadata>[],
): GridTrack[] => {
return [
...(localPeer ? createGridTracksFromPeer(localPeer) : []),
...remotePeers.flatMap(createGridTracksFromPeer),
];
};
): GridTrack[] => [
...(localPeer ? createGridTracksFromPeer(localPeer) : []),
...remotePeers.flatMap(createGridTracksFromPeer),
];
15 changes: 6 additions & 9 deletions examples/fishjam-chat/plugin/src/with-custom-config-android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
} from '@expo/config-plugins';
import { INFO_GENERATED_COMMENT_ANDROID } from './utils';

const withCustomSettingsGradle: ConfigPlugin = (config) => {
return withSettingsGradle(config, (configuration) => {
const withCustomSettingsGradle: ConfigPlugin = (config) =>
withSettingsGradle(config, (configuration) => {
configuration.modResults.contents += `
${INFO_GENERATED_COMMENT_ANDROID}
include ':fishjam-cloud-android-client'
Expand All @@ -16,10 +16,9 @@ project(':fishjam-cloud-android-client').projectDir = new File('../../../package

return configuration;
});
};

const withCustomProjectBuildGradle: ConfigPlugin = (config) => {
return withProjectBuildGradle(config, (configuration) => {
const withCustomProjectBuildGradle: ConfigPlugin = (config) =>
withProjectBuildGradle(config, (configuration) => {
const dokkaClasspath = `
${INFO_GENERATED_COMMENT_ANDROID}
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10")
Expand All @@ -37,10 +36,9 @@ classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10")

return configuration;
});
};

const withCustomGradleProperties: ConfigPlugin = (config) => {
return withGradleProperties(config, (configuration) => {
const withCustomGradleProperties: ConfigPlugin = (config) =>
withGradleProperties(config, (configuration) => {
configuration.modResults.push({
type: 'property',
key: 'org.gradle.caching',
Expand All @@ -58,7 +56,6 @@ const withCustomGradleProperties: ConfigPlugin = (config) => {
});
return configuration;
});
};

export const withCustomConfigAndroid: ConfigPlugin = (config) => {
config = withCustomSettingsGradle(config);
Expand Down
6 changes: 3 additions & 3 deletions examples/fishjam-chat/plugin/src/with-custom-config-ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function replaceCloudClientForExtension(podfileContent: string) {
'g',
);

podfileContent = podfileContent.replace(targetRegex, (match) => {
return match.replace(podToReplace, replacementPod);
});
podfileContent = podfileContent.replace(targetRegex, (match) =>
match.replace(podToReplace, replacementPod),
);
return podfileContent;
}

Expand Down
5 changes: 2 additions & 3 deletions examples/webdriverio-test/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ const getIosDeviceCapabilities = (
const getCapabilityIfDeviceAvailable = (
deviceName: string | undefined,
capabilityGetter: (device: string) => Capabilities.RemoteCapability,
): Capabilities.RemoteCapability | undefined => {
return deviceName ? capabilityGetter(deviceName) : undefined;
};
): Capabilities.RemoteCapability | undefined =>
deviceName ? capabilityGetter(deviceName) : undefined;

const androidDeviceName = process.env.ANDROID_DEVICE_NAME;
const iosDeviceId = process.env.IOS_DEVICE_ID;
Expand Down
12 changes: 5 additions & 7 deletions examples/webdriverio-test/utils/appium_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ type TimeoutConfig = {
interval: number;
};

const findTimeoutConfig = (selector: string): TimeoutConfig => {
return {
timeout: TIMEOUT,
timeoutMsg: `Element with selector ${selector} not found within the specified time`,
interval: INTERVAL,
};
};
const findTimeoutConfig = (selector: string): TimeoutConfig => ({
timeout: TIMEOUT,
timeoutMsg: `Element with selector ${selector} not found within the specified time`,
interval: INTERVAL,
});

const getElement = async (
driver: WebdriverIO.Browser,
Expand Down
2 changes: 1 addition & 1 deletion examples/webdriverio-test/utils/fishjam_cloud_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = new Configuration(configParam);

export const createFishjamRoom = async () => {
const { createRoom } = RoomApiFp(config);
const createRoomFunction = await createRoom();
const createRoomFunction = await createRoom({ videoCodec: 'vp8' });
try {
const response = await createRoomFunction();
return response.data.data.room;
Expand Down
3 changes: 2 additions & 1 deletion packages/android-client/FishjamClient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ dependencies {
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.google.protobuf:protobuf-kotlin:4.26.1'
implementation 'com.google.protobuf:protobuf-kotlin:4.28.3'
api 'com.google.protobuf:protobuf-java:4.28.3'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

Expand Down
Loading

0 comments on commit d2be0f7

Please sign in to comment.