diff --git a/bun.lock b/bun.lock index 53e337bd..2817e54a 100644 --- a/bun.lock +++ b/bun.lock @@ -51,12 +51,13 @@ }, "example": { "name": "react-native-video-example", - "version": "7.0.0-alpha.2", + "version": "7.0.0-alpha.3", "dependencies": { "@react-native-community/slider": "^4.5.6", + "@twg/react-native-video-drm": "*", "react": "18.3.1", "react-native": "^0.77.0", - "react-native-nitro-modules": "^0.27.0", + "react-native-nitro-modules": "^0.28.0", "react-native-video": "*", }, "devDependencies": { @@ -71,16 +72,42 @@ "@react-native/metro-config": "^0.77.0", "@react-native/typescript-config": "^0.77.0", "@types/react": "^18.2.44", - "@types/react-test-renderer": "^18.0.0", "eslint": "^8.51.0", "prettier": "^3.0.3", - "react-test-renderer": "18.3.1", "typescript": "^5.2.2", }, }, + "packages/drm-plugin": { + "name": "@twg/react-native-video-drm", + "version": "0.1.0", + "devDependencies": { + "@react-native/babel-preset": "0.79.2", + "@release-it/conventional-changelog": "^9.0.2", + "@types/react": "^18.3.0", + "del-cli": "^5.1.0", + "eslint": "^8.51.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-prettier": "^5.0.1", + "nitro-codegen": "^0.28.0", + "prettier": "^3.0.3", + "react": "18.3.1", + "react-native": "^0.77.0", + "react-native-builder-bob": "^0.40.13", + "react-native-nitro-modules": "^0.28.0", + "react-native-video": "*", + "release-it": "^17.10.0", + "typescript": "^5.8.3", + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-nitro-modules": ">=0.27.2", + "react-native-video": ">=7.0.0-alpha.3", + }, + }, "packages/react-native-video": { "name": "react-native-video", - "version": "7.0.0-alpha.2", + "version": "7.0.0-alpha.3", "devDependencies": { "@expo/config-plugins": "^10.0.2", "@react-native/eslint-config": "^0.77.0", @@ -89,12 +116,12 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.27.0", + "nitro-codegen": "^0.28.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "react-native-builder-bob": "^0.40.0", - "react-native-nitro-modules": "^0.27.0", + "react-native-nitro-modules": "^0.28.0", "typescript": "^5.2.2", }, "peerDependencies": { @@ -401,6 +428,8 @@ "@babel/types": ["@babel/types@7.27.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg=="], + "@bcoe/v8-coverage": ["@bcoe/v8-coverage@0.2.3", "", {}, "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw=="], + "@colors/colors": ["@colors/colors@1.5.0", "", {}, "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ=="], "@commitlint/cli": ["@commitlint/cli@17.8.1", "", { "dependencies": { "@commitlint/format": "^17.8.1", "@commitlint/lint": "^17.8.1", "@commitlint/load": "^17.8.1", "@commitlint/read": "^17.8.1", "@commitlint/types": "^17.8.1", "execa": "^5.0.0", "lodash.isfunction": "^3.0.9", "resolve-from": "5.0.0", "resolve-global": "1.0.0", "yargs": "^17.0.0" }, "bin": { "commitlint": "cli.js" } }, "sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg=="], @@ -641,14 +670,32 @@ "@istanbuljs/schema": ["@istanbuljs/schema@0.1.3", "", {}, "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA=="], + "@jest/console": ["@jest/console@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "jest-message-util": "^29.7.0", "jest-util": "^29.7.0", "slash": "^3.0.0" } }, "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg=="], + + "@jest/core": ["@jest/core@29.7.0", "", { "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "jest-changed-files": "^29.7.0", "jest-config": "^29.7.0", "jest-haste-map": "^29.7.0", "jest-message-util": "^29.7.0", "jest-regex-util": "^29.6.3", "jest-resolve": "^29.7.0", "jest-resolve-dependencies": "^29.7.0", "jest-runner": "^29.7.0", "jest-runtime": "^29.7.0", "jest-snapshot": "^29.7.0", "jest-util": "^29.7.0", "jest-validate": "^29.7.0", "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "optionalPeers": ["node-notifier"] }, "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg=="], + "@jest/create-cache-key-function": ["@jest/create-cache-key-function@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3" } }, "sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA=="], "@jest/environment": ["@jest/environment@29.7.0", "", { "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0" } }, "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw=="], + "@jest/expect": ["@jest/expect@29.7.0", "", { "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" } }, "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ=="], + + "@jest/expect-utils": ["@jest/expect-utils@29.7.0", "", { "dependencies": { "jest-get-type": "^29.6.3" } }, "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA=="], + "@jest/fake-timers": ["@jest/fake-timers@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", "jest-message-util": "^29.7.0", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ=="], + "@jest/globals": ["@jest/globals@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", "@jest/types": "^29.6.3", "jest-mock": "^29.7.0" } }, "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ=="], + + "@jest/reporters": ["@jest/reporters@29.7.0", "", { "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", "jest-message-util": "^29.7.0", "jest-util": "^29.7.0", "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", "v8-to-istanbul": "^9.0.1" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "optionalPeers": ["node-notifier"] }, "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg=="], + "@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], + "@jest/source-map": ["@jest/source-map@29.6.3", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", "graceful-fs": "^4.2.9" } }, "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw=="], + + "@jest/test-result": ["@jest/test-result@29.7.0", "", { "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA=="], + + "@jest/test-sequencer": ["@jest/test-sequencer@29.7.0", "", { "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", "jest-haste-map": "^29.7.0", "slash": "^3.0.0" } }, "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw=="], + "@jest/transform": ["@jest/transform@29.7.0", "", { "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", "write-file-atomic": "^4.0.2" } }, "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw=="], "@jest/types": ["@jest/types@29.6.3", "", { "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw=="], @@ -759,9 +806,9 @@ "@react-native/assets-registry": ["@react-native/assets-registry@0.77.2", "", {}, "sha512-AcEhFjndzBWVVhaHaASk36vhA83iDVkQbFYb0D0vATzjuJ67vhhHVLae0+JtHl5jhghotUFDg4Vj/1QbZNDyyQ=="], - "@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.77.2", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.77.2" } }, "sha512-2PShbsfsa4NZS+Zt0y2tl1AoWza5podKFmPE5qcYjJoN915VoH3BRkiTVlSpYNKmdvs31o1aQuXAMQDTh7DZ/g=="], + "@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.79.2", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.79.2" } }, "sha512-d+NB7Uosn2ZWd4O4+7ZkB6q1a+0z2opD/4+Bzhk/Tv6fc5FrSftK2Noqxvo3/bhbdGFVPxf0yvLE8et4W17x/Q=="], - "@react-native/babel-preset": ["@react-native/babel-preset@0.77.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.77.2", "babel-plugin-syntax-hermes-parser": "0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-If6X4I0z6W5aVzqZS4JOrN7sh08w1QzEL8Q66i3g0wI8K8ZK+V+/ARlEmboy14VtcOYlmmjXEqSCv+Z2o9cuKg=="], + "@react-native/babel-preset": ["@react-native/babel-preset@0.79.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.79.2", "babel-plugin-syntax-hermes-parser": "0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-/HNu869oUq4FUXizpiNWrIhucsYZqu0/0spudJEzk9SEKar0EjVDP7zkg/sKK+KccNypDQGW7nFXT8onzvQ3og=="], "@react-native/codegen": ["@react-native/codegen@0.77.2", "", { "dependencies": { "@babel/parser": "^7.25.3", "glob": "^7.1.1", "hermes-parser": "0.25.1", "invariant": "^2.2.4", "jscodeshift": "^17.0.0", "nullthrows": "^1.1.1", "yargs": "^17.6.2" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" } }, "sha512-uJSGm9Sp9K5XAhb17cty6iOc2lZpORQKMpS61/B3gYwe9LNz9TJpcfq1L2+3Mv6lppqsulOH9+fslapo0OTfSQ=="], @@ -943,6 +990,8 @@ "@tsconfig/react-native": ["@tsconfig/react-native@2.0.3", "", {}, "sha512-jE58snEKBd9DXfyR4+ssZmYJ/W2mOSnNrvljR0aLyQJL9JKX6vlWELHkRjb3HBbcM9Uy0hZGijXbqEAjOERW2A=="], + "@twg/react-native-video-drm": ["@twg/react-native-video-drm@workspace:packages/drm-plugin"], + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ=="], "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], @@ -1037,8 +1086,6 @@ "@types/react-router-dom": ["@types/react-router-dom@5.3.3", "", { "dependencies": { "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router": "*" } }, "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw=="], - "@types/react-test-renderer": ["@types/react-test-renderer@18.3.1", "", { "dependencies": { "@types/react": "^18" } }, "sha512-vAhnk0tG2eGa37lkU9+s5SoroCsRI08xnsWFiAXOuPH2jqzMbcXvKExXViPi1P5fIklDeCvXqyrdmipFaSkZrA=="], - "@types/retry": ["@types/retry@0.12.0", "", {}, "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="], "@types/sax": ["@types/sax@1.2.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A=="], @@ -1353,6 +1400,8 @@ "ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], + "cjs-module-lexer": ["cjs-module-lexer@1.4.3", "", {}, "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q=="], + "clean-css": ["clean-css@5.3.3", "", { "dependencies": { "source-map": "~0.6.0" } }, "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg=="], "clean-stack": ["clean-stack@2.2.0", "", {}, "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="], @@ -1375,10 +1424,14 @@ "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], + "co": ["co@4.6.0", "", {}, "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ=="], + "code-block-writer": ["code-block-writer@13.0.3", "", {}, "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg=="], "collapse-white-space": ["collapse-white-space@2.1.0", "", {}, "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw=="], + "collect-v8-coverage": ["collect-v8-coverage@1.0.2", "", {}, "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q=="], + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], @@ -1483,6 +1536,8 @@ "cosmiconfig-typescript-loader": ["cosmiconfig-typescript-loader@4.4.0", "", { "peerDependencies": { "@types/node": "*", "cosmiconfig": ">=7", "ts-node": ">=10", "typescript": ">=4" } }, "sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw=="], + "create-jest": ["create-jest@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "jest-config": "^29.7.0", "jest-util": "^29.7.0", "prompts": "^2.0.1" }, "bin": { "create-jest": "bin/create-jest.js" } }, "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q=="], + "create-require": ["create-require@1.1.1", "", {}, "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="], "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], @@ -1601,6 +1656,8 @@ "diff": ["diff@4.0.2", "", {}, "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="], + "diff-sequences": ["diff-sequences@29.6.3", "", {}, "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q=="], + "dir-glob": ["dir-glob@3.0.1", "", { "dependencies": { "path-type": "^4.0.0" } }, "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA=="], "direction": ["direction@1.0.4", "", { "bin": { "direction": "cli.js" } }, "sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ=="], @@ -1639,6 +1696,8 @@ "electron-to-chromium": ["electron-to-chromium@1.5.182", "", {}, "sha512-Lv65Btwv9W4J9pyODI6EWpdnhfvrve/us5h1WspW8B2Fb0366REPtY3hX7ounk1CkV/TBjWCEvCBBbYbmV0qCA=="], + "emittery": ["emittery@0.13.1", "", {}, "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ=="], + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "emojilib": ["emojilib@2.4.0", "", {}, "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw=="], @@ -1701,7 +1760,7 @@ "eslint": ["eslint@8.57.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "8.57.1", "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA=="], - "eslint-config-prettier": ["eslint-config-prettier@9.1.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw=="], + "eslint-config-prettier": ["eslint-config-prettier@9.0.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw=="], "eslint-plugin-eslint-comments": ["eslint-plugin-eslint-comments@3.2.0", "", { "dependencies": { "escape-string-regexp": "^1.0.5", "ignore": "^5.0.5" }, "peerDependencies": { "eslint": ">=4.19.1" } }, "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ=="], @@ -1765,6 +1824,10 @@ "execa": ["execa@8.0.0", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" } }, "sha512-CTNS0BcKBcoOsawKBlpcKNmK4Kjuyz5jVLhf+PUsHGMqiKMVTa4cN3U7r7bRY8KTpfOGpXMo27fdy0dYVg2pqA=="], + "exit": ["exit@0.1.2", "", {}, "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ=="], + + "expect": ["expect@29.7.0", "", { "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", "jest-matcher-utils": "^29.7.0", "jest-message-util": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw=="], + "exponential-backoff": ["exponential-backoff@3.1.2", "", {}, "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA=="], "express": ["express@4.21.2", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA=="], @@ -1813,6 +1876,8 @@ "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], + "find-up-simple": ["find-up-simple@1.0.1", "", {}, "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ=="], + "find-yarn-workspace-root": ["find-yarn-workspace-root@2.0.0", "", { "dependencies": { "micromatch": "^4.0.2" } }, "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ=="], "flat": ["flat@5.0.2", "", { "bin": { "flat": "cli.js" } }, "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="], @@ -2033,10 +2098,14 @@ "import-lazy": ["import-lazy@4.0.0", "", {}, "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw=="], + "import-local": ["import-local@3.2.0", "", { "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" }, "bin": { "import-local-fixture": "fixtures/cli.js" } }, "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA=="], + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], "indent-string": ["indent-string@4.0.0", "", {}, "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg=="], + "index-to-position": ["index-to-position@1.1.0", "", {}, "sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg=="], + "infima": ["infima@0.2.0-alpha.45", "", {}, "sha512-uyH0zfr1erU1OohLk0fT4Rrb94AOhguWNOcD9uGrSpRvNB+6gZXUoJX5J0NtvzBO10YZ9PgvA4NFgt+fYg8ojw=="], "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], @@ -2103,6 +2172,8 @@ "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + "is-generator-fn": ["is-generator-fn@2.1.0", "", {}, "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ=="], + "is-generator-function": ["is-generator-function@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "get-proto": "^1.0.0", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ=="], "is-git-dirty": ["is-git-dirty@2.0.2", "", { "dependencies": { "execa": "^4.0.3", "is-git-repository": "^2.0.0" } }, "sha512-U3YCo+GKR/rDsY7r0v/LBICbQwsx859tDQnAT+v0E/zCDeWbQ1TUt1FtyExeyik7VIJlYOLHCIifLdz71HDalg=="], @@ -2191,26 +2262,66 @@ "istanbul-lib-instrument": ["istanbul-lib-instrument@5.2.1", "", { "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.2.0", "semver": "^6.3.0" } }, "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg=="], + "istanbul-lib-report": ["istanbul-lib-report@3.0.1", "", { "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", "supports-color": "^7.1.0" } }, "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw=="], + + "istanbul-lib-source-maps": ["istanbul-lib-source-maps@4.0.1", "", { "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" } }, "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw=="], + + "istanbul-reports": ["istanbul-reports@3.1.7", "", { "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g=="], + "iterator.prototype": ["iterator.prototype@1.1.5", "", { "dependencies": { "define-data-property": "^1.1.4", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "get-proto": "^1.0.0", "has-symbols": "^1.1.0", "set-function-name": "^2.0.2" } }, "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g=="], "jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="], + "jest": ["jest@29.7.0", "", { "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", "import-local": "^3.0.2", "jest-cli": "^29.7.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "optionalPeers": ["node-notifier"], "bin": { "jest": "bin/jest.js" } }, "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw=="], + + "jest-changed-files": ["jest-changed-files@29.7.0", "", { "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", "p-limit": "^3.1.0" } }, "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w=="], + + "jest-circus": ["jest-circus@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", "jest-each": "^29.7.0", "jest-matcher-utils": "^29.7.0", "jest-message-util": "^29.7.0", "jest-runtime": "^29.7.0", "jest-snapshot": "^29.7.0", "jest-util": "^29.7.0", "p-limit": "^3.1.0", "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw=="], + + "jest-cli": ["jest-cli@29.7.0", "", { "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "chalk": "^4.0.0", "create-jest": "^29.7.0", "exit": "^0.1.2", "import-local": "^3.0.2", "jest-config": "^29.7.0", "jest-util": "^29.7.0", "jest-validate": "^29.7.0", "yargs": "^17.3.1" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" }, "optionalPeers": ["node-notifier"], "bin": { "jest": "bin/jest.js" } }, "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg=="], + + "jest-config": ["jest-config@29.7.0", "", { "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", "@jest/types": "^29.6.3", "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", "jest-circus": "^29.7.0", "jest-environment-node": "^29.7.0", "jest-get-type": "^29.6.3", "jest-regex-util": "^29.6.3", "jest-resolve": "^29.7.0", "jest-runner": "^29.7.0", "jest-util": "^29.7.0", "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "peerDependencies": { "@types/node": "*", "ts-node": ">=9.0.0" }, "optionalPeers": ["@types/node", "ts-node"] }, "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ=="], + + "jest-diff": ["jest-diff@29.7.0", "", { "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" } }, "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw=="], + + "jest-docblock": ["jest-docblock@29.7.0", "", { "dependencies": { "detect-newline": "^3.0.0" } }, "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g=="], + + "jest-each": ["jest-each@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "jest-util": "^29.7.0", "pretty-format": "^29.7.0" } }, "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ=="], + "jest-environment-node": ["jest-environment-node@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw=="], "jest-get-type": ["jest-get-type@29.6.3", "", {}, "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw=="], "jest-haste-map": ["jest-haste-map@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.6.3", "jest-util": "^29.7.0", "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, "optionalDependencies": { "fsevents": "^2.3.2" } }, "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA=="], + "jest-leak-detector": ["jest-leak-detector@29.7.0", "", { "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" } }, "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw=="], + + "jest-matcher-utils": ["jest-matcher-utils@29.7.0", "", { "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" } }, "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g=="], + "jest-message-util": ["jest-message-util@29.7.0", "", { "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w=="], "jest-mock": ["jest-mock@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "jest-util": "^29.7.0" } }, "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw=="], + "jest-pnp-resolver": ["jest-pnp-resolver@1.2.3", "", { "peerDependencies": { "jest-resolve": "*" }, "optionalPeers": ["jest-resolve"] }, "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w=="], + "jest-regex-util": ["jest-regex-util@29.6.3", "", {}, "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg=="], + "jest-resolve": ["jest-resolve@29.7.0", "", { "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", "jest-util": "^29.7.0", "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" } }, "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA=="], + + "jest-resolve-dependencies": ["jest-resolve-dependencies@29.7.0", "", { "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" } }, "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA=="], + + "jest-runner": ["jest-runner@29.7.0", "", { "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", "jest-docblock": "^29.7.0", "jest-environment-node": "^29.7.0", "jest-haste-map": "^29.7.0", "jest-leak-detector": "^29.7.0", "jest-message-util": "^29.7.0", "jest-resolve": "^29.7.0", "jest-runtime": "^29.7.0", "jest-util": "^29.7.0", "jest-watcher": "^29.7.0", "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" } }, "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ=="], + + "jest-runtime": ["jest-runtime@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", "@jest/globals": "^29.7.0", "@jest/source-map": "^29.6.3", "@jest/test-result": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", "jest-haste-map": "^29.7.0", "jest-message-util": "^29.7.0", "jest-mock": "^29.7.0", "jest-regex-util": "^29.6.3", "jest-resolve": "^29.7.0", "jest-snapshot": "^29.7.0", "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" } }, "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ=="], + + "jest-snapshot": ["jest-snapshot@29.7.0", "", { "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", "@jest/expect-utils": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", "expect": "^29.7.0", "graceful-fs": "^4.2.9", "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", "jest-matcher-utils": "^29.7.0", "jest-message-util": "^29.7.0", "jest-util": "^29.7.0", "natural-compare": "^1.4.0", "pretty-format": "^29.7.0", "semver": "^7.5.3" } }, "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw=="], + "jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], "jest-validate": ["jest-validate@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "leven": "^3.1.0", "pretty-format": "^29.7.0" } }, "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw=="], + "jest-watcher": ["jest-watcher@29.7.0", "", { "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", "jest-util": "^29.7.0", "string-length": "^4.0.1" } }, "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g=="], + "jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], "jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="], @@ -2597,7 +2708,7 @@ "new-github-release-url": ["new-github-release-url@2.0.0", "", { "dependencies": { "type-fest": "^2.5.1" } }, "sha512-NHDDGYudnvRutt/VhKFlX26IotXe1w0cmkDm6JGquh5bz/bDTw0LufSmH/GxTjEdpHEO+bVKFTwdrcGa/9XlKQ=="], - "nitro-codegen": ["nitro-codegen@0.27.2", "", { "dependencies": { "chalk": "^5.3.0", "react-native-nitro-modules": "^0.27.2", "ts-morph": "^25.0.0", "yargs": "^17.7.2", "zod": "^4.0.5" }, "bin": { "nitro-codegen": "lib/index.js" } }, "sha512-8s47CFGu2QYvqbKacmtpowgcj577fX60pxFiIDHyM0scT8u28thwAmy6ByskCySHiLFDO7OX6yVT+TrJHc6rQQ=="], + "nitro-codegen": ["nitro-codegen@0.28.0", "", { "dependencies": { "chalk": "^5.3.0", "react-native-nitro-modules": "^0.28.0", "ts-morph": "^25.0.0", "yargs": "^17.7.2", "zod": "^4.0.5" }, "bin": { "nitro-codegen": "lib/index.js" } }, "sha512-sFvLbQQXGKyy3Xer9Oz4J6+KXe4VeKGPzIy893tG65Dfn43rrez849ZG/o/Y3iD2M637ROZeCtGFqQM8mIIo6w=="], "no-case": ["no-case@3.0.4", "", { "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" } }, "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg=="], @@ -2755,7 +2866,7 @@ "pirates": ["pirates@4.0.7", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="], - "pkg-dir": ["pkg-dir@7.0.0", "", { "dependencies": { "find-up": "^6.3.0" } }, "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA=="], + "pkg-dir": ["pkg-dir@4.2.0", "", { "dependencies": { "find-up": "^4.0.0" } }, "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="], "plist": ["plist@3.1.0", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ=="], @@ -2937,6 +3048,8 @@ "pupa": ["pupa@3.1.0", "", { "dependencies": { "escape-goat": "^4.0.0" } }, "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug=="], + "pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="], + "qs": ["qs@6.13.0", "", { "dependencies": { "side-channel": "^1.0.6" } }, "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="], "queue": ["queue@6.0.2", "", { "dependencies": { "inherits": "~2.0.3" } }, "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA=="], @@ -2973,11 +3086,11 @@ "react-native": ["react-native@0.77.2", "", { "dependencies": { "@jest/create-cache-key-function": "^29.6.3", "@react-native/assets-registry": "0.77.2", "@react-native/codegen": "0.77.2", "@react-native/community-cli-plugin": "0.77.2", "@react-native/gradle-plugin": "0.77.2", "@react-native/js-polyfills": "0.77.2", "@react-native/normalize-colors": "0.77.2", "@react-native/virtualized-lists": "0.77.2", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "babel-jest": "^29.7.0", "babel-plugin-syntax-hermes-parser": "0.25.1", "base64-js": "^1.5.1", "chalk": "^4.0.0", "commander": "^12.0.0", "event-target-shim": "^5.0.1", "flow-enums-runtime": "^0.0.6", "glob": "^7.1.1", "invariant": "^2.2.4", "jest-environment-node": "^29.6.3", "jsc-android": "^250231.0.0", "memoize-one": "^5.0.0", "metro-runtime": "^0.81.3", "metro-source-map": "^0.81.3", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.0.1", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.24.0-canary-efb381bbf-20230505", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0", "ws": "^6.2.3", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^18.2.6", "react": "^18.2.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-TE9JXsuiuWL/dmYvSvlLJQFEzZowQPzcn/9vU7vhTTJzNLnUtA33aMNoSU14Y8XikUUwmjYahRe71zjFJp6Kmw=="], - "react-native-builder-bob": ["react-native-builder-bob@0.40.12", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-transform-flow-strip-types": "^7.26.5", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "arktype": "^2.1.15", "babel-plugin-syntax-hermes-parser": "^0.28.0", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", "del": "^6.1.1", "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "glob": "^8.0.3", "is-git-dirty": "^2.0.1", "json5": "^2.2.1", "kleur": "^4.1.4", "prompts": "^2.4.2", "react-native-monorepo-config": "^0.1.8", "which": "^2.0.2", "yargs": "^17.5.1" }, "bin": { "bob": "bin/bob" } }, "sha512-dRl90Dn92zK9J9ew6HL1Zm0+y93lNF0s39oWp1DtN5CiA1/uM8E5y21YEp4demHkidH6CgFTWGFZPmSGFEoOdA=="], + "react-native-builder-bob": ["react-native-builder-bob@0.40.13", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-transform-flow-strip-types": "^7.26.5", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "arktype": "^2.1.15", "babel-plugin-syntax-hermes-parser": "^0.28.0", "browserslist": "^4.20.4", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", "del": "^6.1.1", "escape-string-regexp": "^4.0.0", "fs-extra": "^10.1.0", "glob": "^8.0.3", "is-git-dirty": "^2.0.1", "json5": "^2.2.1", "kleur": "^4.1.4", "prompts": "^2.4.2", "react-native-monorepo-config": "^0.1.8", "which": "^2.0.2", "yargs": "^17.5.1" }, "bin": { "bob": "bin/bob" } }, "sha512-CtucAJ5PMLH3GPNlg3TB5rb3UPot6VjkD9T8Uhz/AAWit/DmWll0zG33ZZeka69E2569saAjShDz3IKAoYGFtA=="], "react-native-monorepo-config": ["react-native-monorepo-config@0.1.9", "", { "dependencies": { "escape-string-regexp": "^5.0.0", "fast-glob": "^3.3.3" } }, "sha512-GLFYMEEcbltxZw7oUbbh/p0oXqA52lSirXt7o/N1qD6CFTvku84OVL6teeQ1Ef92pq+bepq4x0Qz+d6lapVbuQ=="], - "react-native-nitro-modules": ["react-native-nitro-modules@0.27.2", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-wHUs6m4e1MkhV7oPMNSZwCZcoaepLNfPScc+Pm9pwgtv26sTADXnu66MzyodSl6kO6TcTC1Pf+5VyQMgesx08w=="], + "react-native-nitro-modules": ["react-native-nitro-modules@0.28.0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-SR5fpEOxuzqObowLzwrAU7Pv9Kq+AcxKBTCprMcsaiNlURhex2R8T8moSU/hpZO8Vuf3iomdkzEVEIO8udSZ/w=="], "react-native-video": ["react-native-video@workspace:packages/react-native-video"], @@ -2991,9 +3104,7 @@ "react-router-dom": ["react-router-dom@5.3.4", "", { "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", "loose-envify": "^1.3.1", "prop-types": "^15.6.2", "react-router": "5.3.4", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" }, "peerDependencies": { "react": ">=15" } }, "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ=="], - "react-shallow-renderer": ["react-shallow-renderer@16.15.0", "", { "dependencies": { "object-assign": "^4.1.1", "react-is": "^16.12.0 || ^17.0.0 || ^18.0.0" }, "peerDependencies": { "react": "^16.0.0 || ^17.0.0 || ^18.0.0" } }, "sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA=="], - - "react-test-renderer": ["react-test-renderer@18.3.1", "", { "dependencies": { "react-is": "^18.3.1", "react-shallow-renderer": "^16.15.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-KkAgygexHUkQqtvvx/otwxtuFu5cVjfzTCtjXLH9boS19/Nbtg84zS7wIQn39G8IlrhThBpQsMKkq5ZHZIYFXA=="], + "read-package-up": ["read-package-up@11.0.0", "", { "dependencies": { "find-up-simple": "^1.0.0", "read-pkg": "^9.0.0", "type-fest": "^4.6.0" } }, "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ=="], "read-pkg": ["read-pkg@8.1.0", "", { "dependencies": { "@types/normalize-package-data": "^2.4.1", "normalize-package-data": "^6.0.0", "parse-json": "^7.0.0", "type-fest": "^4.2.0" } }, "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ=="], @@ -3085,6 +3196,8 @@ "resolve-alpn": ["resolve-alpn@1.2.1", "", {}, "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="], + "resolve-cwd": ["resolve-cwd@3.0.0", "", { "dependencies": { "resolve-from": "^5.0.0" } }, "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg=="], + "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], "resolve-global": ["resolve-global@1.0.0", "", { "dependencies": { "global-dirs": "^0.1.1" } }, "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw=="], @@ -3093,6 +3206,8 @@ "resolve-pathname": ["resolve-pathname@3.0.0", "", {}, "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="], + "resolve.exports": ["resolve.exports@2.0.3", "", {}, "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A=="], + "responselike": ["responselike@3.0.0", "", { "dependencies": { "lowercase-keys": "^3.0.0" } }, "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg=="], "restore-cursor": ["restore-cursor@5.1.0", "", { "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" } }, "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA=="], @@ -3255,6 +3370,8 @@ "stream-buffers": ["stream-buffers@2.2.0", "", {}, "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg=="], + "string-length": ["string-length@4.0.2", "", { "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" } }, "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ=="], + "string-natural-compare": ["string-natural-compare@3.0.1", "", {}, "sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw=="], "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], @@ -3281,6 +3398,8 @@ "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "strip-bom": ["strip-bom@4.0.0", "", {}, "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=="], + "strip-bom-string": ["strip-bom-string@1.0.0", "", {}, "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g=="], "strip-final-newline": ["strip-final-newline@3.0.0", "", {}, "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="], @@ -3465,6 +3584,8 @@ "v8-compile-cache-lib": ["v8-compile-cache-lib@3.0.1", "", {}, "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="], + "v8-to-istanbul": ["v8-to-istanbul@9.3.0", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", "convert-source-map": "^2.0.0" } }, "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA=="], + "validate-npm-package-license": ["validate-npm-package-license@3.0.4", "", { "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="], "validate-peer-dependencies": ["validate-peer-dependencies@1.2.0", "", { "dependencies": { "resolve-package-path": "^3.1.0", "semver": "^7.3.2" } }, "sha512-nd2HUpKc6RWblPZQ2GDuI65sxJ2n/UqZwSBVtj64xlWjMx0m7ZB2m9b2JS3v1f+n9VWH/dd1CMhkHfP6pIdckA=="], @@ -3701,6 +3822,16 @@ "@istanbuljs/load-nyc-config/js-yaml": ["js-yaml@3.14.1", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g=="], + "@jest/console/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + + "@jest/core/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + + "@jest/reporters/istanbul-lib-instrument": ["istanbul-lib-instrument@6.0.3", "", { "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", "semver": "^7.5.4" } }, "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q=="], + + "@jest/reporters/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + + "@jest/test-sequencer/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "@jest/transform/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], "@jest/transform/write-file-atomic": ["write-file-atomic@4.0.2", "", { "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" } }, "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg=="], @@ -3743,12 +3874,16 @@ "@react-native-video/docs/react": ["react@19.1.0", "", {}, "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg=="], + "@react-native/babel-plugin-codegen/@react-native/codegen": ["@react-native/codegen@0.79.2", "", { "dependencies": { "glob": "^7.1.1", "hermes-parser": "0.25.1", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "yargs": "^17.6.2" }, "peerDependencies": { "@babel/core": "*" } }, "sha512-8JTlGLuLi1p8Jx2N/enwwEd7/2CfrqJpv90Cp77QLRX3VHF2hdyavRIxAmXMwN95k+Me7CUuPtqn2X3IBXOWYg=="], + "@react-native/community-cli-plugin/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "@react-native/dev-middleware/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "@react-native/eslint-config/eslint-config-prettier": ["eslint-config-prettier@8.10.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg=="], + "@react-native/metro-babel-transformer/@react-native/babel-preset": ["@react-native/babel-preset@0.77.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.77.2", "babel-plugin-syntax-hermes-parser": "0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-If6X4I0z6W5aVzqZS4JOrN7sh08w1QzEL8Q66i3g0wI8K8ZK+V+/ARlEmboy14VtcOYlmmjXEqSCv+Z2o9cuKg=="], + "@release-it/bumper/detect-indent": ["detect-indent@7.0.1", "", {}, "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g=="], "@svgr/core/cosmiconfig": ["cosmiconfig@8.3.6", "", { "dependencies": { "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0", "path-type": "^4.0.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA=="], @@ -3757,6 +3892,8 @@ "@ts-morph/common/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + "@twg/react-native-video-drm/@release-it/conventional-changelog": ["@release-it/conventional-changelog@9.0.4", "", { "dependencies": { "concat-stream": "^2.0.0", "conventional-changelog": "^6.0.0", "conventional-recommended-bump": "^10.0.0", "git-semver-tags": "^8.0.0", "semver": "^7.6.3" }, "peerDependencies": { "release-it": "^17.0.0" } }, "sha512-eSZVATX2qiyxzpXdIVNczxTGR+uD4lG/ZEfDDYBJ8vKIj6fKp+eYicIS8Ff/eL3bA9XiQTmllKqxPRzmz9d45w=="], + "@typescript-eslint/eslint-plugin/@typescript-eslint/utils": ["@typescript-eslint/utils@7.18.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/types": "7.18.0", "@typescript-eslint/typescript-estree": "7.18.0" }, "peerDependencies": { "eslint": "^8.56.0" } }, "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw=="], "@typescript-eslint/type-utils/@typescript-eslint/utils": ["@typescript-eslint/utils@7.18.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/types": "7.18.0", "@typescript-eslint/typescript-estree": "7.18.0" }, "peerDependencies": { "eslint": "^8.56.0" } }, "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw=="], @@ -3929,6 +4066,8 @@ "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + "find-cache-dir/pkg-dir": ["pkg-dir@7.0.0", "", { "dependencies": { "find-up": "^6.3.0" } }, "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA=="], + "flat-cache/rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], "gauge/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], @@ -4021,8 +4160,28 @@ "istanbul-lib-instrument/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + "istanbul-lib-report/make-dir": ["make-dir@4.0.0", "", { "dependencies": { "semver": "^7.5.3" } }, "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw=="], + + "istanbul-lib-source-maps/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + + "jest-changed-files/execa": ["execa@5.1.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="], + + "jest-circus/dedent": ["dedent@1.6.0", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA=="], + + "jest-circus/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + + "jest-config/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "jest-message-util/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "jest-resolve/resolve": ["resolve@1.22.10", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="], + + "jest-resolve/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + + "jest-runner/source-map-support": ["source-map-support@0.5.13", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w=="], + + "jest-runtime/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], "jscodeshift/tmp": ["tmp@0.2.3", "", {}, "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w=="], @@ -4209,7 +4368,7 @@ "path-to-regexp/isarray": ["isarray@0.0.1", "", {}, "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="], - "pkg-dir/find-up": ["find-up@6.3.0", "", { "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" } }, "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw=="], + "pkg-dir/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="], "postcss-calc/postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="], @@ -4255,8 +4414,6 @@ "react-native-builder-bob/babel-plugin-syntax-hermes-parser": ["babel-plugin-syntax-hermes-parser@0.28.1", "", { "dependencies": { "hermes-parser": "0.28.1" } }, "sha512-meT17DOuUElMNsL5LZN56d+KBp22hb0EfxWfuPUeoSi54e40v1W4C2V36P75FpsH9fVEfDKpw5Nnkahc8haSsQ=="], - "react-native-builder-bob/browserslist": ["browserslist@4.24.4", "", { "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" } }, "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A=="], - "react-native-builder-bob/del": ["del@6.1.1", "", { "dependencies": { "globby": "^11.0.1", "graceful-fs": "^4.2.4", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", "is-path-inside": "^3.0.2", "p-map": "^4.0.0", "rimraf": "^3.0.2", "slash": "^3.0.0" } }, "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg=="], "react-native-builder-bob/fs-extra": ["fs-extra@10.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ=="], @@ -4267,11 +4424,17 @@ "react-native-video/@react-native/eslint-config": ["@react-native/eslint-config@0.77.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", "@react-native/eslint-plugin": "0.77.2", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-ft-flow": "^2.0.1", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0" }, "peerDependencies": { "eslint": ">=8", "prettier": ">=2" } }, "sha512-buxBnJU0YLxdkUqn85ZG7BoCjSEjia4HMcnl4X81UQSLM8Z0xCL01QeqHhxxfhYFFkiHwsJILBgHEZizx/hsdQ=="], + "react-native-video/eslint-config-prettier": ["eslint-config-prettier@9.1.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw=="], + + "react-native-video-example/@react-native/babel-preset": ["@react-native/babel-preset@0.77.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-arrow-functions": "^7.24.7", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-numeric-separator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.25.2", "@babel/plugin-transform-react-jsx-self": "^7.24.7", "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-shorthand-properties": "^7.24.7", "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/template": "^7.25.0", "@react-native/babel-plugin-codegen": "0.77.2", "babel-plugin-syntax-hermes-parser": "0.25.1", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" } }, "sha512-If6X4I0z6W5aVzqZS4JOrN7sh08w1QzEL8Q66i3g0wI8K8ZK+V+/ARlEmboy14VtcOYlmmjXEqSCv+Z2o9cuKg=="], + "react-native-video-example/@react-native/eslint-config": ["@react-native/eslint-config@0.77.2", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/eslint-parser": "^7.25.1", "@react-native/eslint-plugin": "0.77.2", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-ft-flow": "^2.0.1", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0" }, "peerDependencies": { "eslint": ">=8", "prettier": ">=2" } }, "sha512-buxBnJU0YLxdkUqn85ZG7BoCjSEjia4HMcnl4X81UQSLM8Z0xCL01QeqHhxxfhYFFkiHwsJILBgHEZizx/hsdQ=="], "react-router/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], - "react-test-renderer/scheduler": ["scheduler@0.23.2", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="], + "read-package-up/read-pkg": ["read-pkg@9.0.1", "", { "dependencies": { "@types/normalize-package-data": "^2.4.3", "normalize-package-data": "^6.0.0", "parse-json": "^8.0.0", "type-fest": "^4.6.0", "unicorn-magic": "^0.1.0" } }, "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA=="], + + "read-package-up/type-fest": ["type-fest@4.39.1", "", {}, "sha512-uW9qzd66uyHYxwyVBYiwS4Oi0qZyUqwjU+Oevr6ZogYiXt99EOYtwvzMSLw1c3lYo2HzJsep/NB23iEVEgjG/w=="], "read-pkg/normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], @@ -4681,12 +4844,18 @@ "@react-native/dev-middleware/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + "@react-native/metro-babel-transformer/@react-native/babel-preset/@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.77.2", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.77.2" } }, "sha512-2PShbsfsa4NZS+Zt0y2tl1AoWza5podKFmPE5qcYjJoN915VoH3BRkiTVlSpYNKmdvs31o1aQuXAMQDTh7DZ/g=="], + "@svgr/core/cosmiconfig/path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], "@svgr/plugin-svgo/cosmiconfig/path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], "@ts-morph/common/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog": ["conventional-changelog@6.0.0", "", { "dependencies": { "conventional-changelog-angular": "^8.0.0", "conventional-changelog-atom": "^5.0.0", "conventional-changelog-codemirror": "^5.0.0", "conventional-changelog-conventionalcommits": "^8.0.0", "conventional-changelog-core": "^8.0.0", "conventional-changelog-ember": "^5.0.0", "conventional-changelog-eslint": "^6.0.0", "conventional-changelog-express": "^5.0.0", "conventional-changelog-jquery": "^6.0.0", "conventional-changelog-jshint": "^5.0.0", "conventional-changelog-preset-loader": "^5.0.0" } }, "sha512-tuUH8H/19VjtD9Ig7l6TQRh+Z0Yt0NZ6w/cCkkyzUbGQTnUEmKfGtkC9gGfVgCfOL1Rzno5NgNF4KY8vR+Jo3w=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump": ["conventional-recommended-bump@10.0.0", "", { "dependencies": { "@conventional-changelog/git-client": "^1.0.0", "conventional-changelog-preset-loader": "^5.0.0", "conventional-commits-filter": "^5.0.0", "conventional-commits-parser": "^6.0.0", "meow": "^13.0.0" }, "bin": { "conventional-recommended-bump": "dist/cli/index.js" } }, "sha512-RK/fUnc2btot0oEVtrj3p2doImDSs7iiz/bftFCDzels0Qs1mxLghp+DFHMaOC0qiCI6sWzlTDyBFSYuot6pRA=="], + "@typescript-eslint/typescript-estree/globby/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], @@ -4789,6 +4958,8 @@ "finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + "find-cache-dir/pkg-dir/find-up": ["find-up@6.3.0", "", { "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" } }, "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw=="], + "gray-matter/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], "hast-util-from-parse5/vfile/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], @@ -4855,6 +5026,22 @@ "is-git-repository/execa/strip-final-newline": ["strip-final-newline@2.0.0", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="], + "jest-changed-files/execa/get-stream": ["get-stream@6.0.1", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="], + + "jest-changed-files/execa/human-signals": ["human-signals@2.1.0", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="], + + "jest-changed-files/execa/is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], + + "jest-changed-files/execa/npm-run-path": ["npm-run-path@4.0.1", "", { "dependencies": { "path-key": "^3.0.0" } }, "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw=="], + + "jest-changed-files/execa/onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="], + + "jest-changed-files/execa/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + + "jest-changed-files/execa/strip-final-newline": ["strip-final-newline@2.0.0", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="], + + "jest-runner/source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + "lighthouse-logger/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], "logkitty/yargs/cliui": ["cliui@6.0.0", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="], @@ -4889,9 +5076,7 @@ "parse5-htmlparser2-tree-adapter/parse5/entities": ["entities@6.0.0", "", {}, "sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw=="], - "pkg-dir/find-up/locate-path": ["locate-path@7.2.0", "", { "dependencies": { "p-locate": "^6.0.0" } }, "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA=="], - - "pkg-dir/find-up/path-exists": ["path-exists@5.0.0", "", {}, "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ=="], + "pkg-dir/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], "postcss-colormin/browserslist/caniuse-lite": ["caniuse-lite@1.0.30001712", "", {}, "sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig=="], @@ -4921,10 +5106,6 @@ "react-native-builder-bob/babel-plugin-syntax-hermes-parser/hermes-parser": ["hermes-parser@0.28.1", "", { "dependencies": { "hermes-estree": "0.28.1" } }, "sha512-nf8o+hE8g7UJWParnccljHumE9Vlq8F7MqIdeahl+4x0tvCUJYRrT0L7h0MMg/X9YJmkNwsfbaNNrzPtFXOscg=="], - "react-native-builder-bob/browserslist/caniuse-lite": ["caniuse-lite@1.0.30001712", "", {}, "sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig=="], - - "react-native-builder-bob/browserslist/electron-to-chromium": ["electron-to-chromium@1.5.133", "", {}, "sha512-mrR+g6Y1at0GKDlPlMMwLAkI6c47q3d7U/vKS3rGTa3V4xStu18oT4UCPg5ErcAhUqk7swSjXSPUGstOYd2qBw=="], - "react-native-builder-bob/del/globby": ["globby@11.1.0", "", { "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" } }, "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g=="], "react-native-builder-bob/del/is-path-cwd": ["is-path-cwd@2.2.0", "", {}, "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ=="], @@ -4935,6 +5116,8 @@ "react-native-builder-bob/glob/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "react-native-video-example/@react-native/babel-preset/@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.77.2", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.77.2" } }, "sha512-2PShbsfsa4NZS+Zt0y2tl1AoWza5podKFmPE5qcYjJoN915VoH3BRkiTVlSpYNKmdvs31o1aQuXAMQDTh7DZ/g=="], + "react-native-video-example/@react-native/eslint-config/@react-native/eslint-plugin": ["@react-native/eslint-plugin@0.77.2", "", {}, "sha512-52kD16gqvb1rwD99ivNy+PnFnL1hCfBTIOrmFnZk4Lx7gatNJvAPq/u8ONGmrk73sPRoVxuinKWYirS1kB0UdQ=="], "react-native-video-example/@react-native/eslint-config/eslint-config-prettier": ["eslint-config-prettier@8.10.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg=="], @@ -4947,6 +5130,10 @@ "react-native-video/@react-native/eslint-config/eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@4.6.2", "", { "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ=="], + "read-package-up/read-pkg/normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], + + "read-package-up/read-pkg/parse-json": ["parse-json@8.3.0", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "index-to-position": "^1.1.0", "type-fest": "^4.39.1" } }, "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ=="], + "read-pkg/parse-json/json-parse-even-better-errors": ["json-parse-even-better-errors@3.0.2", "", {}, "sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ=="], "read-pkg/parse-json/lines-and-columns": ["lines-and-columns@2.0.4", "", {}, "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A=="], @@ -5195,6 +5382,36 @@ "@react-native-community/cli/execa/onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-angular": ["conventional-changelog-angular@8.0.0", "", { "dependencies": { "compare-func": "^2.0.0" } }, "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-atom": ["conventional-changelog-atom@5.0.0", "", {}, "sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-codemirror": ["conventional-changelog-codemirror@5.0.0", "", {}, "sha512-8gsBDI5Y3vrKUCxN6Ue8xr6occZ5nsDEc4C7jO/EovFGozx8uttCAyfhRrvoUAWi2WMm3OmYs+0mPJU7kQdYWQ=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-conventionalcommits": ["conventional-changelog-conventionalcommits@8.0.0", "", { "dependencies": { "compare-func": "^2.0.0" } }, "sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core": ["conventional-changelog-core@8.0.0", "", { "dependencies": { "@hutson/parse-repository-url": "^5.0.0", "add-stream": "^1.0.0", "conventional-changelog-writer": "^8.0.0", "conventional-commits-parser": "^6.0.0", "git-raw-commits": "^5.0.0", "git-semver-tags": "^8.0.0", "hosted-git-info": "^7.0.0", "normalize-package-data": "^6.0.0", "read-package-up": "^11.0.0", "read-pkg": "^9.0.0" } }, "sha512-EATUx5y9xewpEe10UEGNpbSHRC6cVZgO+hXQjofMqpy+gFIrcGvH3Fl6yk2VFKh7m+ffenup2N7SZJYpyD9evw=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-ember": ["conventional-changelog-ember@5.0.0", "", {}, "sha512-RPflVfm5s4cSO33GH/Ey26oxhiC67akcxSKL8CLRT3kQX2W3dbE19sSOM56iFqUJYEwv9mD9r6k79weWe1urfg=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-eslint": ["conventional-changelog-eslint@6.0.0", "", {}, "sha512-eiUyULWjzq+ybPjXwU6NNRflApDWlPEQEHvI8UAItYW/h22RKkMnOAtfCZxMmrcMO1OKUWtcf2MxKYMWe9zJuw=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-express": ["conventional-changelog-express@5.0.0", "", {}, "sha512-D8Q6WctPkQpvr2HNCCmwU5GkX22BVHM0r4EW8vN0230TSyS/d6VQJDAxGb84lbg0dFjpO22MwmsikKL++Oo/oQ=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-jquery": ["conventional-changelog-jquery@6.0.0", "", {}, "sha512-2kxmVakyehgyrho2ZHBi90v4AHswkGzHuTaoH40bmeNqUt20yEkDOSpw8HlPBfvEQBwGtbE+5HpRwzj6ac2UfA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-jshint": ["conventional-changelog-jshint@5.0.0", "", { "dependencies": { "compare-func": "^2.0.0" } }, "sha512-gGNphSb/opc76n2eWaO6ma4/Wqu3tpa2w7i9WYqI6Cs2fncDSI2/ihOfMvXveeTTeld0oFvwMVNV+IYQIk3F3g=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-preset-loader": ["conventional-changelog-preset-loader@5.0.0", "", {}, "sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump/conventional-changelog-preset-loader": ["conventional-changelog-preset-loader@5.0.0", "", {}, "sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump/conventional-commits-filter": ["conventional-commits-filter@5.0.0", "", {}, "sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump/conventional-commits-parser": ["conventional-commits-parser@6.2.0", "", { "dependencies": { "meow": "^13.0.0" }, "bin": { "conventional-commits-parser": "dist/cli/index.js" } }, "sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump/meow": ["meow@13.2.0", "", {}, "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA=="], + "@typescript-eslint/utils/@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="], "@typescript-eslint/utils/@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="], @@ -5225,6 +5442,10 @@ "eslint-plugin-jest/@typescript-eslint/utils/eslint-scope/estraverse": ["estraverse@4.3.0", "", {}, "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="], + "find-cache-dir/pkg-dir/find-up/locate-path": ["locate-path@7.2.0", "", { "dependencies": { "p-locate": "^6.0.0" } }, "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA=="], + + "find-cache-dir/pkg-dir/find-up/path-exists": ["path-exists@5.0.0", "", {}, "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ=="], + "hast-util-raw/hast-util-from-parse5/hastscript/comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="], "hast-util-raw/hast-util-from-parse5/hastscript/hast-util-parse-selector": ["hast-util-parse-selector@4.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A=="], @@ -5237,6 +5458,8 @@ "is-git-repository/execa/onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], + "jest-changed-files/execa/onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], + "logkitty/yargs/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], "logkitty/yargs/yargs-parser/camelcase": ["camelcase@5.3.1", "", {}, "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="], @@ -5247,7 +5470,7 @@ "normalize-package-data/hosted-git-info/lru-cache/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], - "pkg-dir/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="], + "pkg-dir/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], "react-native-builder-bob/babel-plugin-syntax-hermes-parser/hermes-parser/hermes-estree": ["hermes-estree@0.28.1", "", {}, "sha512-w3nxl/RGM7LBae0v8LH2o36+8VqwOZGv9rX1wyoWT6YaKZLqpJZ0YQ5P0LVr3tuRpf7vCx0iIG4i/VmBJejxTQ=="], @@ -5337,19 +5560,31 @@ "@react-native-community/cli-tools/ora/cli-cursor/restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/conventional-changelog-writer": ["conventional-changelog-writer@8.2.0", "", { "dependencies": { "conventional-commits-filter": "^5.0.0", "handlebars": "^4.7.7", "meow": "^13.0.0", "semver": "^7.5.2" }, "bin": { "conventional-changelog-writer": "dist/cli/index.js" } }, "sha512-Y2aW4596l9AEvFJRwFGJGiQjt2sBYTjPD18DdvxX9Vpz0Z7HQ+g1Z+6iYDAm1vR3QOJrDBkRHixHK/+FhkR6Pw=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/conventional-commits-parser": ["conventional-commits-parser@6.2.0", "", { "dependencies": { "meow": "^13.0.0" }, "bin": { "conventional-commits-parser": "dist/cli/index.js" } }, "sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/git-raw-commits": ["git-raw-commits@5.0.0", "", { "dependencies": { "@conventional-changelog/git-client": "^1.0.0", "meow": "^13.0.0" }, "bin": { "git-raw-commits": "src/cli.js" } }, "sha512-I2ZXrXeOc0KrCvC7swqtIFXFN+rbjnC7b2T943tvemIOVNl+XP8YnA9UVwqFhzzLClnSA60KR/qEjLpXzs73Qg=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/read-pkg": ["read-pkg@9.0.1", "", { "dependencies": { "@types/normalize-package-data": "^2.4.3", "normalize-package-data": "^6.0.0", "parse-json": "^8.0.0", "type-fest": "^4.6.0", "unicorn-magic": "^0.1.0" } }, "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA=="], + "conventional-changelog-core/read-pkg-up/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="], "del/p-map/aggregate-error/clean-stack/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], "eslint-plugin-jest/@typescript-eslint/utils/@typescript-eslint/typescript-estree/globby/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "find-cache-dir/pkg-dir/find-up/locate-path/p-locate": ["p-locate@6.0.0", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="], + "inquirer/ora/cli-cursor/restore-cursor/onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="], "inquirer/ora/cli-cursor/restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], "logkitty/yargs/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], - "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="], + "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], "typescript-eslint/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/@typescript-eslint/types": ["@typescript-eslint/types@8.29.1", "", {}, "sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ=="], @@ -5385,14 +5620,26 @@ "@react-native-community/cli-tools/ora/cli-cursor/restore-cursor/onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/conventional-changelog-writer/conventional-commits-filter": ["conventional-commits-filter@5.0.0", "", {}, "sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/conventional-changelog-writer/meow": ["meow@13.2.0", "", {}, "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/conventional-commits-parser/meow": ["meow@13.2.0", "", {}, "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/git-raw-commits/meow": ["meow@13.2.0", "", {}, "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/read-pkg/parse-json": ["parse-json@8.3.0", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "index-to-position": "^1.1.0", "type-fest": "^4.39.1" } }, "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ=="], + + "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog/conventional-changelog-core/read-pkg/type-fest": ["type-fest@4.39.1", "", {}, "sha512-uW9qzd66uyHYxwyVBYiwS4Oi0qZyUqwjU+Oevr6ZogYiXt99EOYtwvzMSLw1c3lYo2HzJsep/NB23iEVEgjG/w=="], + "conventional-changelog-core/read-pkg-up/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="], + "find-cache-dir/pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@4.0.0", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="], + "inquirer/ora/cli-cursor/restore-cursor/onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], "logkitty/yargs/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], - "pkg-dir/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.1", "", {}, "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg=="], - "typescript-eslint/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils/@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "@babel/register/find-cache-dir/pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], @@ -5415,6 +5662,8 @@ "conventional-changelog-core/read-pkg-up/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.1", "", {}, "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg=="], + "find-cache-dir/pkg-dir/find-up/locate-path/p-locate/p-limit/yocto-queue": ["yocto-queue@1.2.1", "", {}, "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg=="], + "@commitlint/parse/conventional-commits-parser/meow/read-pkg-up/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], "@commitlint/read/git-raw-commits/meow/read-pkg-up/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], diff --git a/config/.editorconfig b/config/.editorconfig index 65365be6..037e070f 100644 --- a/config/.editorconfig +++ b/config/.editorconfig @@ -13,3 +13,4 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +quote_type = single diff --git a/config/.eslintrc.js b/config/.eslintrc.js index 72e7d4e9..9449203d 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { '**/babel.config.js', '**/metro.config.js', '**/react-native.config.js', - '**/tsconfig.json' + '**/tsconfig.json', ], plugins: ['@typescript-eslint', 'prettier'], parser: '@typescript-eslint/parser', @@ -33,6 +33,12 @@ module.exports = { trailingComma: 'es5', useTabs: false, }, - ] + ], + quotes: [ + 'error', + 'single', + { avoidEscape: true, allowTemplateLiterals: true }, + ], + '@react-native/no-deep-imports': 'off', }, -} +}; diff --git a/docs/docs/player/drm.md b/docs/docs/player/drm.md new file mode 100644 index 00000000..1879d9f3 --- /dev/null +++ b/docs/docs/player/drm.md @@ -0,0 +1,199 @@ +--- +sidebar_position: 3 +sidebar_label: DRM +--- + +# DRM + +## What is DRM (Digital Rights Management)? +DRM is a set of access control technologies that are used to protect copyrighted content from unauthorized use and distribution. It allows content owners to control how their digital media is used and distributed. + +### When do you need it? +If you are working with copyrighted content and want to prevent unauthorized access or distribution, you will need DRM. It is especially important for streaming services, e-learning platforms, and any application that delivers premium content that you want to protect from piracy. + +### What next? +This page explains how to play DRM‑protected content with React Native Video using the official DRM plugin. It covers installing and enabling the plugin, configuring sources with DRM, and platform‑specific notes for Android (Widevine) and iOS/visionOS (FairPlay). + +## Install and enable the DRM plugin + +:::tip Pluginable Architecture +React Native Video uses a plugin architecture. DRM support is provided by the `@twg/react-native-video-drm` plugin and is not built into the core package. +::: + +1) Install dependencies in your app: + +```sh +npm install @twg/react-native-video-drm +``` + +2) Enable the plugin at app startup (before creating any players): + +```ts +// App.tsx (or any place you want to initialize the plugin) +import { enable } from '@twg/react-native-video-drm'; + +enable(); +``` + +The plugin autolinks on both Android and iOS. Nitro Modules are required because the plugin uses Nitro under the hood. + +## Quick start + +You pass DRM configuration via `VideoConfig.drm` when creating a player or using the `useVideoPlayer` hook. If `drm.type` is omitted, the default is inferred per platform (`widevine` on Android, `fairplay` on iOS/visionOS). + +```tsx +import { VideoView, useVideoPlayer } from 'react-native-video'; + +export function Player() { + const player = useVideoPlayer({ + source: { + uri: 'https://example.com/manifest.mpd', // or HLS .m3u8 for FairPlay + // On iOS these headers are also used for the default license request + headers: { Authorization: 'Bearer ' }, + drm: { + // type: 'widevine' | 'fairplay' // optional; inferred by platform + licenseUrl: 'https://license.example.com/widevine', + }, + }, + }); + + return ; +} +``` + +:::warning +You shouldn't include your authorization token directly in the code. Instead, use a backend method to retrieve it at runtime. +::: + +## DRM config reference + +All properties are optional unless marked otherwise for a platform. The table below describes each property, the expected type, platforms where it applies, whether it's required, and important notes. + +| Property | Type | Platform | Required | Notes | +|---|---:|---|:---:|---| +| `type` | `'widevine' \| 'fairplay'` | Android, iOS, visionOS | No (defaulted) | Default inferred per platform when `drm` is present and `type` omitted (Android → `widevine`, iOS/visionOS → `fairplay`). | +| `licenseUrl` | `string` | Android, iOS, visionOS | Android: Yes; iOS/visionOS: Yes for default/custom flows | URL of the license (CKC) service. Required for license acquisition. | +| `licenseHeaders` | ``Record`` | Android | No | Extra headers sent with the Widevine license request. (On iOS, use `source.headers` for license requests.) | +| `multiSession` | `boolean` | Android | No | Whether to allow multiple Widevine sessions. | +| `certificateUrl` | `string` | iOS, visionOS | Yes (for FairPlay) | URL to fetch the FairPlay application certificate (used to create the SPC). | +| `contentId` | `string` | iOS, visionOS | No | If omitted, derived from the `skd://` key URL. Used when creating the SPC. | +| `getLicense` | ``(payload) => Promise`` | iOS, visionOS | No | Optional hook for custom FairPlay license logic; must resolve to a base64‑encoded CKC string. | + +Payload shape passed to `getLicense` (iOS/visionOS): + +| Field | Type | Description | +|---|---:|---| +| `contentId` | `string` | Content identifier for the asset. If not provided the player will try to derive it from the `skd://` key URL. | +| `licenseUrl` | `string` | The license server URL that should be used for license acquisition. | +| `keyUrl` | `string` | The key URL/identifier received from the stream (typically an `skd://` URL). | +| `spc` | `string` | The SPC (secure playback context) as a base64‑encoded string. Send raw SPC bytes to your license server (server side may expect raw bytes rather than base64). | + +## Android: Widevine + +- Set `drm.type` to `'widevine'` or omit it (the library will default to Widevine on Android if `drm` is present). +- `licenseUrl` is required; `licenseHeaders` and `multiSession` are optional. +- Implementation details: + - The plugin uses ExoPlayer’s `DefaultDrmSessionManager` and `HttpMediaDrmCallback` with your `licenseUrl` and `licenseHeaders`. + - If a first attempt fails due to device security level issues, the plugin retries with `L3` security level. + +Example: + +```tsx +useVideoPlayer({ + source: { + uri: 'https://example.com/manifest.mpd', + drm: { + // type: 'widevine', // optional + licenseUrl: 'https://license.example.com/widevine', + licenseHeaders: { 'X-Custom-Header': 'value' }, + multiSession: false, + }, + }, +}); +``` + +## iOS and visionOS: FairPlay + +Two ways to get the CKC (license): + +1) Default flow (no `getLicense`): + - Required: `certificateUrl`, `licenseUrl`. + - The plugin requests the application certificate, generates the SPC, then POSTs the SPC to `licenseUrl`. + - It uses `source.headers` (not `drm.licenseHeaders`) for the license request. + +2) Custom flow (provide `getLicense`): + - Required: `certificateUrl`, `licenseUrl`, and a `getLicense` implementation. + - You receive `{ contentId, licenseUrl, keyUrl, spc }` and must return a base64‑encoded CKC string. + +Notes: +- DRM isn’t supported in the iOS Simulator; the plugin returns `null` for DRM in Simulator builds. +- If `contentId` isn’t provided, it is derived from the `skd://` key URL. + +Default flow example: + +```tsx +useVideoPlayer({ + source: { + uri: 'https://example.com/fairplay.m3u8', + headers: { Authorization: 'Bearer ' }, // used for the license request + drm: { + // type: 'fairplay', // optional + certificateUrl: 'https://license.example.com/fps-cert', + licenseUrl: 'https://license.example.com/fps', + // contentId: 'my-content-id', // optional + }, + }, +}); +``` + +Custom `getLicense` example: + +:::tip +This is example code for a custom `getLicense` implementation. it may differ from your actual implementation provided by your DRM provider +::: + +```tsx +useVideoPlayer({ + source: { + uri: 'https://example.com/fairplay.m3u8', + drm: { + certificateUrl: 'https://license.example.com/fps-cert', + licenseUrl: 'https://license.example.com/fps', + getLicense: async ({ contentId, licenseUrl, keyUrl, spc }) => { + // Example: POST SPC to your license server and return base64 CKC + const res = await fetch(licenseUrl, { + method: 'POST', + body: Buffer.from(spc, 'base64'), // server expects raw SPC bytes + headers: { + 'Content-Type': 'application/octet-stream', + 'X-Content-ID': contentId, + 'X-Asset-Id': keyUrl, + }, + }); + if (!res.ok) throw new Error(`License request failed: ${res.status}`); + const ckc = await res.arrayBuffer(); + // return base64 CKC string + return Buffer.from(ckc).toString('base64'); + }, + }, + }, +}); +``` + +## Offline +If you are looking for implementing offline playback with DRM, make sure to checkout our [Offline Video SDK](https://www.thewidlarzgroup.com/offline-video-sdk). It provides a comprehensive solution for downloading and playing Streams and DRM-protected content. + +## Troubleshooting + +- DRMPluginNotFound: Ensure you installed `@twg/react-native-video-drm`, imported it, and called `enable()` before creating any players. +- iOS headers: The default FairPlay flow uses `source.headers` for license requests; `drm.licenseHeaders` are not used on iOS. +- Invalid CKC: `getLicense` must return a base64 string. Returning raw bytes or JSON will fail. +- 403/415 from license server: Verify required auth headers, content type, and whether the server expects raw SPC bytes vs base64. +- Android security level issues: The plugin retries with Widevine L3 if the first attempt fails. +- iOS Simulator: DRM isn’t supported in Simulator. Test on a real device. + +## Notes and defaults + +- If `drm` is provided without `type`, the library sets a platform default: Android → Widevine, iOS/visionOS → FairPlay. +- For custom DRM systems or advanced pipelines, you can implement your own plugin. See the Plugin Interface docs. + diff --git a/docs/docs/player/player-lifecycle.md b/docs/docs/player/player-lifecycle.md index 4c37634b..b47dd8a7 100644 --- a/docs/docs/player/player-lifecycle.md +++ b/docs/docs/player/player-lifecycle.md @@ -1,6 +1,6 @@ --- sidebar_label: Player Lifecycle -sidebar_position: 5 +sidebar_position: 2 --- # Player Lifecycle diff --git a/docs/docs/player/player.md b/docs/docs/player/player.md index 85075351..d28e90b6 100644 --- a/docs/docs/player/player.md +++ b/docs/docs/player/player.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 1 sidebar_label: Player --- @@ -80,9 +80,18 @@ The `VideoPlayer` class offers a comprehensive set of methods and properties to | `playInBackground` | Read/Write | `boolean` | Whether playback should continue when the app goes to the background. | | `playWhenInactive` | Read/Write | `boolean` | Whether playback should continue when the app is inactive (e.g., during a phone call). | | `isPlaying` | Read-only | `boolean` | Returns `true` if the video is currently playing. | +| `selectedTrack` | Read-only | `TextTrack \| undefined` | Currently selected text track, or `undefined` when no track is selected. | ### Error Handling | Property | Type | Description | |----------|------|-------------| -| `onError?` | `(error: VideoRuntimeError) => void` | A callback function that is invoked when a runtime error occurs in the player. You can use this to catch and handle errors gracefully. | \ No newline at end of file +| `onError?` | `(error: VideoRuntimeError) => void` | A callback function that is invoked when a runtime error occurs in the player. You can use this to catch and handle errors gracefully. | + +## DRM + +Protected content is supported via a plugin. See the full DRM guide: [DRM](./drm.md). + +Quick notes: +- Install and enable the official plugin `@twg/react-native-video-drm` and call `enable()` at app startup before creating players. +- Pass DRM configuration on the source using the `drm` property of `VideoConfig` (see the DRM guide for platform specifics and `getLicense` examples). \ No newline at end of file diff --git a/example/.eslintrc.js b/example/.eslintrc.js index 975f9f39..c31c3443 100644 --- a/example/.eslintrc.js +++ b/example/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['@react-native', '../config/.eslintrc.js'], + extends: ["../config/.eslintrc.js"], parserOptions: { tsconfigRootDir: __dirname, project: true, diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7624c144..068364d5 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,7 +8,7 @@ PODS: - hermes-engine (0.77.2): - hermes-engine/Pre-built (= 0.77.2) - hermes-engine/Pre-built (0.77.2) - - NitroModules (0.27.2): + - NitroModules (0.28.0): - DoubleConversion - glog - hermes-engine @@ -1565,7 +1565,7 @@ PODS: - React-logger (= 0.77.2) - React-perflogger (= 0.77.2) - React-utils (= 0.77.2) - - ReactNativeVideo (7.0.0-alpha.2): + - ReactNativeVideo (7.0.0-alpha.3): - DoubleConversion - glog - hermes-engine @@ -1587,6 +1587,31 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga + - ReactNativeVideoDrm (0.1.0): + - DoubleConversion + - glog + - hermes-engine + - NitroModules + - RCT-Folly (= 2024.11.18.00) + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeVideo + - Yoga - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -1661,6 +1686,7 @@ DEPENDENCIES: - ReactCodegen (from `build/generated/ios`) - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`) - ReactNativeVideo (from `../../node_modules/react-native-video`) + - "ReactNativeVideoDrm (from `../../node_modules/@twg/react-native-video-drm`)" - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: @@ -1805,6 +1831,8 @@ EXTERNAL SOURCES: :path: "../../node_modules/react-native/ReactCommon" ReactNativeVideo: :path: "../../node_modules/react-native-video" + ReactNativeVideoDrm: + :path: "../../node_modules/@twg/react-native-video-drm" Yoga: :path: "../../node_modules/react-native/ReactCommon/yoga" @@ -1816,7 +1844,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8 hermes-engine: 8eb265241fa1d7095d3a40d51fd90f7dce68217c - NitroModules: 7ed5fd8f6f1e814810b9df26830b78f3355690bf + NitroModules: 1e4150c3e3676e05209234a8a5e0e8886fc0311a RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82 RCTDeprecation: 85b72250b63cfb54f29ca96ceb108cb9ef3c2079 RCTRequired: 567cb8f5d42b990331bfd93faad1d8999b1c1736 @@ -1876,7 +1904,8 @@ SPEC CHECKSUMS: ReactAppDependencyProvider: f334cebc0beed0a72490492e978007082c03d533 ReactCodegen: 474fbb3e4bb0f1ee6c255d1955db76e13d509269 ReactCommon: 7763e59534d58e15f8f22121cdfe319040e08888 - ReactNativeVideo: db800650d21aab71c457ea1408c4f46e853b5886 + ReactNativeVideo: 213235288864ce876c68a64cc1481fe8a3eae5d5 + ReactNativeVideoDrm: 62840ae0e184f711a2e6495c18e342a74cb598f8 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: 31a098f74c16780569aebd614a0f37a907de0189 diff --git a/example/package.json b/example/package.json index 0340cd11..2ed6aa34 100644 --- a/example/package.json +++ b/example/package.json @@ -7,14 +7,15 @@ "ios": "react-native run-ios", "lint": "eslint .", "typecheck": "tsc", - "start": "react-native start" + "start": "react-native start --client-logs" }, "dependencies": { "@react-native-community/slider": "^4.5.6", "react": "18.3.1", "react-native": "^0.77.0", - "react-native-nitro-modules": "^0.27.0", - "react-native-video": "*" + "react-native-nitro-modules": "^0.28.0", + "react-native-video": "*", + "@twg/react-native-video-drm": "*" }, "devDependencies": { "@babel/core": "^7.25.2", @@ -28,10 +29,8 @@ "@react-native/metro-config": "^0.77.0", "@react-native/typescript-config": "^0.77.0", "@types/react": "^18.2.44", - "@types/react-test-renderer": "^18.0.0", "eslint": "^8.51.0", "prettier": "^3.0.3", - "react-test-renderer": "18.3.1", "typescript": "^5.2.2" }, "engines": { diff --git a/example/patches/react-native-nitro-modules+0.27.2.patch b/example/patches/react-native-nitro-modules+0.28.0.patch similarity index 100% rename from example/patches/react-native-nitro-modules+0.27.2.patch rename to example/patches/react-native-nitro-modules+0.28.0.patch diff --git a/example/src/App.tsx b/example/src/App.tsx index 00697ece..118e0ca6 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,67 +1,28 @@ +import React from 'react'; +import { Alert, SafeAreaView, ScrollView, Text, View } from 'react-native'; +import { styles } from './styles'; +import { + ActionButton, + ControlButton, + SwitchControl, + ToggleButton, +} from './components/Controls'; import Slider from '@react-native-community/slider'; -import * as React from 'react'; import { - Alert, - SafeAreaView, - ScrollView, - StyleSheet, - Switch, - Text, - TouchableOpacity, - View, -} from 'react-native'; -import { - useEvent, - useVideoPlayer, - VideoPlayer, - VideoView, - type IgnoreSilentSwitchMode, - type MixAudioMode, + type VideoViewRef, type onLoadData, type onProgressData, - type onVolumeChangeData, - type ResizeMode, - type TextTrack, - type VideoConfig, type VideoPlayerStatus, - type VideoViewRef, + type onVolumeChangeData, + useVideoPlayer, + useEvent, + VideoView, + type VideoConfig, } from 'react-native-video'; - -const formatTime = (seconds: number) => { - if (isNaN(seconds)) return '--:--'; - const m = Math.floor(seconds / 60); - const s = Math.floor(seconds % 60); - return `${m}:${s < 10 ? '0' : ''}${s}`; -}; - -// Consolidated state interface -interface VideoSettings { - show: boolean; - volume: number; - muted: boolean; - rate: number; - loop: boolean; - showNativeControls: boolean; - resizeMode: ResizeMode; - mixAudioMode: MixAudioMode; - ignoreSilentSwitchMode: IgnoreSilentSwitchMode; - playInBackground: boolean; - playWhenInactive: boolean; -} - -const defaultSettings: VideoSettings = { - show: false, - volume: 1, - muted: false, - rate: 1, - loop: false, - showNativeControls: false, - resizeMode: 'contain', - mixAudioMode: 'auto', - ignoreSilentSwitchMode: 'auto', - playInBackground: true, - playWhenInactive: false, -}; +import TextTrackManager from './components/TextTrackManager'; +import { type VideoSettings, defaultSettings } from './types/videoSettings'; +import { formatTime } from './utils/time'; +import { getVideoSource } from './utils/videoSource'; const VideoDemo = () => { const videoViewRef = React.useRef(null); @@ -72,7 +33,6 @@ const VideoDemo = () => { Array<{ id: string; message: string; timestamp: string }> >([]); - // Helper function to update settings const updateSetting = ( key: K, value: VideoSettings[K] @@ -80,17 +40,15 @@ const VideoDemo = () => { setSettings((prev) => ({ ...prev, [key]: value })); }; - // Helper function to add events const addEvent = React.useCallback((message: string) => { const newEvent = { id: `${Date.now()}-${Math.random()}`, message, timestamp: new Date().toLocaleTimeString(), }; - setEvents((prev) => [newEvent, ...prev.slice(0, 49)]); // Keep latest 50 events + setEvents((prev) => [newEvent, ...prev.slice(0, 49)]); }, []); - // Event handlers const handleFullscreenChange = React.useCallback( (fullscreen: boolean) => { addEvent( @@ -161,20 +119,9 @@ const VideoDemo = () => { [addEvent] ); - // Setup player const player = useVideoPlayer( - { - uri: 'https://www.w3schools.com/html/movie.mp4', - externalSubtitles: [ - { - uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt', - label: 'External', - }, - ], - }, - (_player) => { - // Setup player - } + getVideoSource(defaultSettings.videoType), + (_player) => {} ); useEvent(player, 'onEnd', handlePlayerEnd); @@ -186,7 +133,6 @@ const VideoDemo = () => { useEvent(player, 'onPlaybackStateChange', handlePlayerStateChange); useEvent(player, 'onVolumeChange', handleVolumeChange); - // Sync settings with player React.useEffect(() => { if (!settings.show) return; @@ -207,7 +153,6 @@ const VideoDemo = () => { return ( - {/* Video Player */} {settings.show ? ( { )} - {/* Progress Controls */} {formatTime(progress)} @@ -250,7 +194,6 @@ const VideoDemo = () => { - {/* Transport Controls */} player.seekTo(0)} /> @@ -262,9 +205,22 @@ const VideoDemo = () => { /> player.seekBy(10)} /> + Video Type + + {(['hls', 'mp4', 'drm'] as const).map((mode) => ( + { + updateSetting('videoType', mode); + await player.replaceSourceAsync(getVideoSource(mode)); + }} + /> + ))} + - {/* Display Settings */} Display Settings @@ -296,7 +252,6 @@ const VideoDemo = () => { - {/* Audio Controls */} Audio Controls @@ -349,7 +304,6 @@ const VideoDemo = () => { - {/* Background Playback Controls */} Background Playback @@ -366,7 +320,6 @@ const VideoDemo = () => { - {/* Audio Settings */} Audio Settings @@ -397,13 +350,11 @@ const VideoDemo = () => { - {/* Text Track Controls */} Text Tracks - {/* Advanced Controls */} Advanced Controls @@ -471,7 +422,6 @@ const VideoDemo = () => { - {/* Event Log */} Event Log @@ -496,237 +446,6 @@ const VideoDemo = () => { ); }; -// Reusable Components -const ControlButton = ({ - icon, - onPress, - size = 'normal', -}: { - icon: string; - onPress: () => void; - size?: 'normal' | 'large'; -}) => ( - - - {icon} - - -); - -const SwitchControl = ({ - label, - value, - onValueChange, -}: { - label: string; - value: boolean; - onValueChange: (value: boolean) => void; -}) => ( - - {label} - - -); - -const ToggleButton = ({ - label, - active, - onPress, -}: { - label: string; - active: boolean; - onPress: () => void; -}) => ( - - - {label} - - -); - -const ActionButton = ({ - label, - onPress, -}: { - label: string; - onPress: () => void; -}) => ( - - {label} - -); - -const TextTrackManager = ({ player }: { player: VideoPlayer }) => { - const [textTracks, setTextTracks] = React.useState([]); - const [selectedTrackId, setSelectedTrackId] = React.useState( - null - ); - const [currentSelectedTrack, setCurrentSelectedTrack] = - React.useState(null); - const [trackChangeEvents, setTrackChangeEvents] = React.useState( - [] - ); - - const loadTextTracks = React.useCallback(() => { - try { - const tracks = player.getAvailableTextTracks(); - setTextTracks(tracks); - - // Get currently selected track using the new property - const selectedTrack = player.selectedTrack; - setSelectedTrackId(selectedTrack?.id || null); - setCurrentSelectedTrack(selectedTrack || null); - - console.log('Available text tracks:', tracks); - console.log('Currently selected track:', selectedTrack); - } catch (error) { - console.error('Error loading text tracks:', error); - } - }, [player]); - - const selectTrack = React.useCallback( - (track: TextTrack) => { - try { - player.selectTextTrack(track); - console.log('Selected text track:', track); - // onTrackChange event will update the state automatically - } catch (error) { - console.error('Error selecting text track:', error); - } - }, - [player] - ); - - const disableTextTracks = React.useCallback(() => { - try { - // Pass null to disable text tracks - player.selectTextTrack(null); - console.log('Disabled text tracks'); - // onTrackChange event will update the state automatically - } catch (error) { - console.error('Error disabling text tracks:', error); - } - }, [player]); - - useEvent(player, 'onReadyToDisplay', () => { - loadTextTracks(); - }); - - useEvent(player, 'onTrackChange', (track) => { - // Update state when track changes through any means (API or native controls) - setCurrentSelectedTrack(track); - setSelectedTrackId(track?.id || null); - - // Add to event log - const timestamp = new Date().toLocaleTimeString(); - const eventMessage = track - ? `${timestamp}: Track changed to "${track.label}" (${track.id})${track.id.startsWith('external-') ? ' [External]' : ''}` - : `${timestamp}: All tracks disabled`; - - setTrackChangeEvents((prev) => [eventMessage, ...prev.slice(0, 4)]); // Keep last 5 events - }); - - return ( - - - - - { - try { - const selectedTrack = player.selectedTrack; - setCurrentSelectedTrack(selectedTrack || null); - setSelectedTrackId(selectedTrack?.id || null); - } catch (error) { - console.error('Error syncing selection:', error); - } - }} - /> - - - {currentSelectedTrack && ( - - Currently Selected: - - {currentSelectedTrack.label} - {currentSelectedTrack.language && - ` (${currentSelectedTrack.language})`} - {currentSelectedTrack.id.startsWith('external-') && ' [External]'} - - - )} - - {trackChangeEvents.length > 0 && ( - - Track Change Events: - {trackChangeEvents.map((event, index) => ( - - {event} - - ))} - - )} - - {textTracks.length > 0 ? ( - - - Available Tracks ({textTracks.length}) - - {textTracks.map((track) => ( - selectTrack(track)} - > - - {track.label} {track.language && `(${track.language})`} - {track.selected && ' ✓'} - {track.id.startsWith('external-') && ' [External]'} - - - ))} - - ) : ( - - No text tracks available - - Make sure the video is loaded. External subtitles are loaded but not - automatically enabled - you need to select them manually. - - - )} - - ); -}; - export default function App() { const [mounted, setMounted] = React.useState(true); @@ -742,313 +461,3 @@ export default function App() { ); } - -const styles = StyleSheet.create({ - app: { - flex: 1, - backgroundColor: '#f8f9fa', - }, - container: { - flex: 1, - padding: 16, - }, - videoContainer: { - width: '100%', - aspectRatio: 16 / 9, - backgroundColor: '#000', - borderRadius: 12, - overflow: 'hidden', - marginBottom: 16, - elevation: 3, - shadowColor: '#000', - shadowOffset: { width: 0, height: 2 }, - shadowOpacity: 0.1, - shadowRadius: 4, - }, - video: { - width: '100%', - height: '100%', - }, - hiddenVideo: { - width: '100%', - height: '100%', - backgroundColor: '#333', - alignItems: 'center', - justifyContent: 'center', - }, - hiddenVideoText: { - color: '#fff', - fontSize: 18, - fontWeight: '600', - }, - section: { - backgroundColor: '#fff', - borderRadius: 12, - padding: 16, - marginBottom: 12, - elevation: 1, - shadowColor: '#000', - shadowOffset: { width: 0, height: 1 }, - shadowOpacity: 0.05, - shadowRadius: 2, - }, - sectionTitle: { - fontSize: 18, - fontWeight: '700', - color: '#1a1a1a', - marginBottom: 12, - }, - subSectionTitle: { - fontSize: 14, - fontWeight: '600', - color: '#666', - marginTop: 12, - marginBottom: 8, - }, - progressRow: { - flexDirection: 'row', - alignItems: 'center', - }, - progressSlider: { - flex: 1, - marginHorizontal: 12, - }, - timeText: { - fontSize: 14, - fontWeight: '600', - color: '#666', - width: 50, - textAlign: 'center', - fontVariant: ['tabular-nums'], - }, - transportRow: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', - gap: 12, - }, - controlButton: { - width: 48, - height: 48, - borderRadius: 24, - backgroundColor: '#f0f0f0', - alignItems: 'center', - justifyContent: 'center', - elevation: 2, - shadowColor: '#000', - shadowOffset: { width: 0, height: 1 }, - shadowOpacity: 0.1, - shadowRadius: 2, - }, - controlButtonLarge: { - width: 64, - height: 64, - borderRadius: 32, - backgroundColor: '#007aff', - }, - controlIcon: { - fontSize: 20, - color: '#333', - }, - controlIconLarge: { - fontSize: 28, - color: '#fff', - }, - audioControls: { - gap: 16, - }, - sliderControl: { - flexDirection: 'row', - alignItems: 'center', - gap: 12, - }, - controlLabel: { - fontSize: 14, - fontWeight: '600', - color: '#333', - width: 60, - }, - slider: { - flex: 1, - }, - valueText: { - fontSize: 14, - fontWeight: '600', - color: '#666', - width: 40, - textAlign: 'right', - }, - switchRow: { - flexDirection: 'row', - gap: 20, - flexWrap: 'wrap', - }, - switchColumn: { - flexDirection: 'column', - gap: 8, - }, - switchControl: { - flexDirection: 'row', - alignItems: 'center', - gap: 8, - flex: 1, - minWidth: 120, - }, - switchLabel: { - fontSize: 14, - fontWeight: '500', - color: '#333', - }, - buttonGroup: { - flexDirection: 'row', - flexWrap: 'wrap', - gap: 8, - }, - toggleButton: { - paddingHorizontal: 16, - paddingVertical: 8, - borderRadius: 20, - backgroundColor: '#f0f0f0', - borderWidth: 1, - borderColor: '#e0e0e0', - }, - toggleButtonActive: { - backgroundColor: '#007aff', - borderColor: '#007aff', - }, - toggleButtonText: { - fontSize: 14, - fontWeight: '500', - color: '#666', - textTransform: 'capitalize', - }, - toggleButtonTextActive: { - color: '#fff', - fontWeight: '600', - }, - actionGrid: { - flexDirection: 'row', - flexWrap: 'wrap', - gap: 8, - }, - actionButton: { - backgroundColor: '#007aff', - paddingHorizontal: 16, - paddingVertical: 10, - borderRadius: 8, - elevation: 2, - shadowColor: '#000', - shadowOffset: { width: 0, height: 1 }, - shadowOpacity: 0.1, - shadowRadius: 2, - }, - actionButtonText: { - color: '#fff', - fontWeight: '600', - fontSize: 14, - }, - eventLog: { - backgroundColor: '#f8f9fa', - borderRadius: 8, - borderLeftWidth: 3, - borderLeftColor: '#007aff', - height: 200, - }, - eventLogScroll: { - flex: 1, - padding: 12, - }, - eventItem: { - paddingVertical: 4, - borderBottomWidth: 1, - borderBottomColor: '#e1e1e1', - }, - eventTime: { - fontSize: 10, - color: '#999', - fontFamily: 'monospace', - marginBottom: 2, - }, - eventText: { - fontSize: 12, - color: '#666', - fontFamily: 'monospace', - }, - mountControl: { - padding: 16, - alignItems: 'center', - }, - trackList: { - marginTop: 12, - }, - trackButton: { - padding: 12, - borderWidth: 1, - borderColor: '#e0e0e0', - borderRadius: 8, - marginBottom: 8, - }, - trackButtonSelected: { - backgroundColor: '#007aff', - borderColor: '#007aff', - }, - trackButtonText: { - fontSize: 14, - fontWeight: '600', - color: '#333', - }, - trackButtonTextSelected: { - color: '#fff', - fontWeight: '600', - }, - noTracksText: { - fontSize: 14, - color: '#666', - fontWeight: '600', - textAlign: 'center', - }, - noTracksSubText: { - fontSize: 12, - color: '#999', - textAlign: 'center', - }, - selectedTrackInfo: { - backgroundColor: '#e7f4ff', - padding: 12, - borderRadius: 8, - borderLeftWidth: 3, - borderLeftColor: '#007aff', - marginBottom: 12, - }, - selectedTrackLabel: { - fontSize: 12, - fontWeight: '600', - color: '#666', - marginBottom: 4, - }, - selectedTrackText: { - fontSize: 14, - fontWeight: '600', - color: '#007aff', - }, - eventLogContainer: { - backgroundColor: '#f8f9fa', - padding: 12, - borderRadius: 8, - borderLeftWidth: 3, - borderLeftColor: '#28a745', - marginBottom: 12, - }, - eventLogTitle: { - fontSize: 12, - fontWeight: '600', - color: '#666', - marginBottom: 8, - }, - eventLogText: { - fontSize: 11, - color: '#333', - fontFamily: 'monospace', - marginBottom: 2, - }, -}); diff --git a/example/src/components/Controls.tsx b/example/src/components/Controls.tsx new file mode 100644 index 00000000..3e3d2098 --- /dev/null +++ b/example/src/components/Controls.tsx @@ -0,0 +1,80 @@ +import React from 'react'; +import { Switch, Text, TouchableOpacity, View } from 'react-native'; +import { styles } from '../styles'; + +export const ControlButton = ({ + icon, + onPress, + size = 'normal', +}: { + icon: string; + onPress: () => void; + size?: 'normal' | 'large'; +}) => ( + + + {icon} + + +); + +export const SwitchControl = ({ + label, + value, + onValueChange, +}: { + label: string; + value: boolean; + onValueChange: (value: boolean) => void; +}) => ( + + {label} + + +); + +export const ToggleButton = ({ + label, + active, + onPress, +}: { + label: string; + active: boolean; + onPress: () => void; +}) => ( + + + {label} + + +); + +export const ActionButton = ({ + label, + onPress, +}: { + label: string; + onPress: () => void; +}) => ( + + {label} + +); diff --git a/example/src/components/TextTrackManager.tsx b/example/src/components/TextTrackManager.tsx new file mode 100644 index 00000000..55b6ecf3 --- /dev/null +++ b/example/src/components/TextTrackManager.tsx @@ -0,0 +1,149 @@ +import React from 'react'; +import { Text, TouchableOpacity, View } from 'react-native'; +import { useEvent, type TextTrack, type VideoPlayer } from 'react-native-video'; +import { styles } from '../styles'; +import { ActionButton } from './Controls'; + +export const TextTrackManager = ({ player }: { player: VideoPlayer }) => { + const [textTracks, setTextTracks] = React.useState([]); + const [selectedTrackId, setSelectedTrackId] = React.useState( + null + ); + const [currentSelectedTrack, setCurrentSelectedTrack] = + React.useState(null); + const [trackChangeEvents, setTrackChangeEvents] = React.useState( + [] + ); + + const loadTextTracks = React.useCallback(() => { + try { + const tracks = player.getAvailableTextTracks(); + setTextTracks(tracks); + + const selectedTrack = player.selectedTrack; + setSelectedTrackId(selectedTrack?.id || null); + setCurrentSelectedTrack(selectedTrack || null); + } catch (error) { + console.error('Error loading text tracks:', error); + } + }, [player]); + + const selectTrack = React.useCallback( + (track: TextTrack) => { + try { + player.selectTextTrack(track); + } catch (error) { + console.error('Error selecting text track:', error); + } + }, + [player] + ); + + const disableTextTracks = React.useCallback(() => { + try { + player.selectTextTrack(null); + } catch (error) { + console.error('Error disabling text tracks:', error); + } + }, [player]); + + useEvent(player, 'onReadyToDisplay', () => { + loadTextTracks(); + }); + + useEvent(player, 'onTrackChange', (track) => { + setCurrentSelectedTrack(track); + setSelectedTrackId(track?.id || null); + + const timestamp = new Date().toLocaleTimeString(); + const eventMessage = track + ? `${timestamp}: Track changed to "${track.label}" (${track.id})${track.id.startsWith('external-') ? ' [External]' : ''}` + : `${timestamp}: All tracks disabled`; + + setTrackChangeEvents((prev) => [eventMessage, ...prev.slice(0, 4)]); + }); + + return ( + + + + + { + try { + const selectedTrack = player.selectedTrack; + setCurrentSelectedTrack(selectedTrack || null); + setSelectedTrackId(selectedTrack?.id || null); + } catch (error) { + console.error('Error syncing selection:', error); + } + }} + /> + + + {currentSelectedTrack && ( + + Currently Selected: + + {currentSelectedTrack.label} + {currentSelectedTrack.language && + ` (${currentSelectedTrack.language})`} + {currentSelectedTrack.id.startsWith('external-') && ' [External]'} + + + )} + + {trackChangeEvents.length > 0 && ( + + Track Change Events: + {trackChangeEvents.map((event, index) => ( + + {event} + + ))} + + )} + + {textTracks.length > 0 ? ( + + + Available Tracks ({textTracks.length}) + + {textTracks.map((track) => ( + selectTrack(track)} + > + + {track.label} {track.language && `(${track.language})`} + {track.selected && ' ✓'} + {track.id.startsWith('external-') && ' [External]'} + + + ))} + + ) : ( + + No text tracks available + + Make sure the video is loaded. External subtitles are loaded but not + automatically enabled - you need to select them manually. + + + )} + + ); +}; + +export default TextTrackManager; diff --git a/example/src/styles.ts b/example/src/styles.ts new file mode 100644 index 00000000..e84fa666 --- /dev/null +++ b/example/src/styles.ts @@ -0,0 +1,311 @@ +import { StyleSheet } from 'react-native'; + +export const styles = StyleSheet.create({ + app: { + flex: 1, + backgroundColor: '#f8f9fa', + }, + container: { + flex: 1, + padding: 16, + }, + videoContainer: { + width: '100%', + aspectRatio: 16 / 9, + backgroundColor: '#000', + borderRadius: 12, + overflow: 'hidden', + marginBottom: 16, + elevation: 3, + shadowColor: '#000', + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 4, + }, + video: { + width: '100%', + height: '100%', + }, + hiddenVideo: { + width: '100%', + height: '100%', + backgroundColor: '#333', + alignItems: 'center', + justifyContent: 'center', + }, + hiddenVideoText: { + color: '#fff', + fontSize: 18, + fontWeight: '600', + }, + section: { + backgroundColor: '#fff', + borderRadius: 12, + padding: 16, + marginBottom: 12, + elevation: 1, + shadowColor: '#000', + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.05, + shadowRadius: 2, + }, + sectionTitle: { + fontSize: 18, + fontWeight: '700', + color: '#1a1a1a', + marginBottom: 12, + }, + subSectionTitle: { + fontSize: 14, + fontWeight: '600', + color: '#666', + marginTop: 12, + marginBottom: 8, + }, + progressRow: { + flexDirection: 'row', + alignItems: 'center', + }, + progressSlider: { + flex: 1, + marginHorizontal: 12, + }, + timeText: { + fontSize: 14, + fontWeight: '600', + color: '#666', + width: 50, + textAlign: 'center', + fontVariant: ['tabular-nums'], + }, + transportRow: { + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', + gap: 12, + }, + controlButton: { + width: 48, + height: 48, + borderRadius: 24, + backgroundColor: '#f0f0f0', + alignItems: 'center', + justifyContent: 'center', + elevation: 2, + shadowColor: '#000', + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.1, + shadowRadius: 2, + }, + controlButtonLarge: { + width: 64, + height: 64, + borderRadius: 32, + backgroundColor: '#007aff', + }, + controlIcon: { + fontSize: 20, + color: '#333', + }, + controlIconLarge: { + fontSize: 28, + color: '#fff', + }, + audioControls: { + gap: 16, + }, + sliderControl: { + flexDirection: 'row', + alignItems: 'center', + gap: 12, + }, + controlLabel: { + fontSize: 14, + fontWeight: '600', + color: '#333', + width: 60, + }, + slider: { + flex: 1, + }, + valueText: { + fontSize: 14, + fontWeight: '600', + color: '#666', + width: 40, + textAlign: 'right', + }, + switchRow: { + flexDirection: 'row', + gap: 20, + flexWrap: 'wrap', + }, + switchColumn: { + flexDirection: 'column', + gap: 8, + }, + switchControl: { + flexDirection: 'row', + alignItems: 'center', + gap: 8, + flex: 1, + minWidth: 120, + }, + switchLabel: { + fontSize: 14, + fontWeight: '500', + color: '#333', + }, + buttonGroup: { + flexDirection: 'row', + flexWrap: 'wrap', + gap: 8, + }, + toggleButton: { + paddingHorizontal: 16, + paddingVertical: 8, + borderRadius: 20, + backgroundColor: '#f0f0f0', + borderWidth: 1, + borderColor: '#e0e0e0', + }, + toggleButtonActive: { + backgroundColor: '#007aff', + borderColor: '#007aff', + }, + toggleButtonText: { + fontSize: 14, + fontWeight: '500', + color: '#666', + textTransform: 'capitalize', + }, + toggleButtonTextActive: { + color: '#fff', + fontWeight: '600', + }, + actionGrid: { + flexDirection: 'row', + flexWrap: 'wrap', + gap: 8, + }, + actionButton: { + backgroundColor: '#007aff', + paddingHorizontal: 16, + paddingVertical: 10, + borderRadius: 8, + elevation: 2, + shadowColor: '#000', + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.1, + shadowRadius: 2, + }, + actionButtonText: { + color: '#fff', + fontWeight: '600', + fontSize: 14, + }, + eventLog: { + backgroundColor: '#f8f9fa', + borderRadius: 8, + borderLeftWidth: 3, + borderLeftColor: '#007aff', + height: 200, + }, + eventLogScroll: { + flex: 1, + padding: 12, + }, + eventItem: { + paddingVertical: 4, + borderBottomWidth: 1, + borderBottomColor: '#e1e1e1', + }, + eventTime: { + fontSize: 10, + color: '#999', + fontFamily: 'monospace', + marginBottom: 2, + }, + eventText: { + fontSize: 12, + color: '#666', + fontFamily: 'monospace', + }, + mountControl: { + padding: 16, + alignItems: 'center', + }, + trackList: { + marginTop: 12, + }, + trackButton: { + padding: 12, + borderWidth: 1, + borderColor: '#e0e0e0', + borderRadius: 8, + marginBottom: 8, + }, + trackButtonSelected: { + backgroundColor: '#007aff', + borderColor: '#007aff', + }, + trackButtonText: { + fontSize: 14, + fontWeight: '600', + color: '#333', + }, + trackButtonTextSelected: { + color: '#fff', + fontWeight: '600', + }, + noTracksText: { + fontSize: 14, + color: '#666', + fontWeight: '600', + textAlign: 'center', + }, + noTracksSubText: { + fontSize: 12, + color: '#999', + textAlign: 'center', + }, + selectedTrackInfo: { + backgroundColor: '#e7f4ff', + padding: 12, + borderRadius: 8, + borderLeftWidth: 3, + borderLeftColor: '#007aff', + marginBottom: 12, + }, + selectedTrackLabel: { + fontSize: 12, + fontWeight: '600', + color: '#666', + marginBottom: 4, + }, + selectedTrackText: { + fontSize: 14, + fontWeight: '600', + color: '#007aff', + }, + eventLogContainer: { + backgroundColor: '#f8f9fa', + padding: 12, + borderRadius: 8, + borderLeftWidth: 3, + borderLeftColor: '#28a745', + marginBottom: 12, + }, + eventLogTitle: { + fontSize: 12, + fontWeight: '600', + color: '#666', + marginBottom: 8, + }, + eventLogText: { + fontSize: 11, + color: '#333', + fontFamily: 'monospace', + marginBottom: 2, + }, +}); diff --git a/example/src/types/videoSettings.ts b/example/src/types/videoSettings.ts new file mode 100644 index 00000000..5112f2ee --- /dev/null +++ b/example/src/types/videoSettings.ts @@ -0,0 +1,35 @@ +import type { + IgnoreSilentSwitchMode, + MixAudioMode, + ResizeMode, +} from 'react-native-video'; + +export interface VideoSettings { + show: boolean; + videoType: 'hls' | 'mp4' | 'drm'; + volume: number; + muted: boolean; + rate: number; + loop: boolean; + showNativeControls: boolean; + resizeMode: ResizeMode; + mixAudioMode: MixAudioMode; + ignoreSilentSwitchMode: IgnoreSilentSwitchMode; + playInBackground: boolean; + playWhenInactive: boolean; +} + +export const defaultSettings: VideoSettings = { + show: false, + videoType: 'hls', + volume: 1, + muted: false, + rate: 1, + loop: false, + showNativeControls: false, + resizeMode: 'contain', + mixAudioMode: 'auto', + ignoreSilentSwitchMode: 'auto', + playInBackground: true, + playWhenInactive: false, +}; diff --git a/example/src/utils/time.ts b/example/src/utils/time.ts new file mode 100644 index 00000000..bb6cf31b --- /dev/null +++ b/example/src/utils/time.ts @@ -0,0 +1,6 @@ +export const formatTime = (seconds: number) => { + if (isNaN(seconds)) return '--:--'; + const m = Math.floor(seconds / 60); + const s = Math.floor(seconds % 60); + return `${m}:${s < 10 ? '0' : ''}${s}`; +}; diff --git a/example/src/utils/videoSource.ts b/example/src/utils/videoSource.ts new file mode 100644 index 00000000..7c03ad4b --- /dev/null +++ b/example/src/utils/videoSource.ts @@ -0,0 +1,107 @@ +import { Platform } from 'react-native'; +import type { VideoConfig } from 'react-native-video'; +import { + enable as enableDRMPlugin, + disable as disableDRMPlugin, + isEnabled as isDRMPluginEnabled, +} from '@twg/react-native-video-drm'; + +const getDRMSource = (): VideoConfig => { + const HLS = + 'https://d2e67eijd6imrw.cloudfront.net/559c7a7e-960d-4cd8-9dba-bc4e59890177/assets/47cfca69-91b5-4311-bf6c-b9b1f297ed9b/videokit-720p-dash-hls-drm/hls/index.m3u8'; + const DASH = + 'https://d2e67eijd6imrw.cloudfront.net/559c7a7e-960d-4cd8-9dba-bc4e59890177/assets/47cfca69-91b5-4311-bf6c-b9b1f297ed9b/videokit-720p-dash-hls-drm/dash/index.mpd'; + const CERT = + 'https://thewidlarzgroup.la.drm.cloud/certificate/fairplay?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177'; + const FAIRPLAY_LICENSE = + 'https://thewidlarzgroup.la.drm.cloud/acquire-license/fairplay?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177'; + const WIDEVINE_LICENSE = + 'https://thewidlarzgroup.la.drm.cloud/acquire-license/widevine?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177'; + const USER_TOKEN = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTU3NzQzMTQsImtpZCI6WyIqIl0sImR1cmF0aW9uIjo4NjQwMCwicGVyc2lzdGVudCI6dHJ1ZSwid2lkZXZpbmUiOnsibGljZW5zZV9kdXJhdGlvbiI6OTk5OTk5OSwicGxheWJhY2tfZHVyYXRpb24iOjk5OTk5OTksInJlbnRpYWxfZHVyYXRpb24iOjk5OTk5OTl9LCJmYWlycGxheSI6eyJzdG9yYWdlX2R1cmF0aW9uIjo5OTk5OTk5LCJwbGF5YmFja19kdXJhdGlvbiI6OTk5OTk5OX19.Gm5caVyq_pSTJIy8mZ-vrCeATKueRATmubirh-ajqVg'; + + if (Platform.OS === 'ios') { + return { + uri: HLS, + drm: { + type: 'fairplay', + licenseUrl: FAIRPLAY_LICENSE, + certificateUrl: CERT, + getLicense: async ({ spc, keyUrl }) => { + const formData = new FormData(); + formData.append('spc', spc); + + const fixedLicenseUrl = keyUrl.replace('skd://', 'https://'); + + try { + const response = await fetch( + `${fixedLicenseUrl}&userToken=${USER_TOKEN}`, + { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + 'Accept': 'application/json', + }, + body: formData, + } + ); + + const responseData = await response.json(); + return responseData.ckc; + } catch (error) { + console.error('Error fetching license:', error); + throw error; + } + }, + }, + } as VideoConfig; + } + + if (Platform.OS === 'android') { + return { + uri: DASH, + headers: { + 'x-drm-userToken': USER_TOKEN, + }, + drm: { + type: 'widevine', + licenseUrl: WIDEVINE_LICENSE, + }, + } as VideoConfig; + } + + throw new Error( + 'DRM is not Supported or Configured on Platform not supported' + ); +}; + +export type VideoType = 'hls' | 'mp4' | 'drm'; + +export const getVideoSource = (type: VideoType): VideoConfig => { + if (type === 'drm') { + if (!isDRMPluginEnabled) { + enableDRMPlugin(); + } + return getDRMSource(); + } + + if (isDRMPluginEnabled) { + disableDRMPlugin(); + } + + const HLS = 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8'; + const MP4 = + 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_30MB.mp4'; + + return { + uri: type === 'hls' ? HLS : MP4, + externalSubtitles: [ + { + label: 'External', + uri: 'https://gist.githubusercontent.com/samdutton/ca37f3adaf4e23679957b8083e061177/raw/e19399fbccbc069a2af4266e5120ae6bad62699a/sample.vtt', + language: 'en', + type: 'vtt', + }, + ], + } as VideoConfig; +}; diff --git a/package.json b/package.json index f6c98106..a97859e9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@react-native-video", + "name": "react-native-video-monorepo", "packageManager": "bun@1.1.42", "version": "7.0.0-alpha.3", "private": true, @@ -7,41 +7,44 @@ "author": "TheWidlarzGroup (https://github.com/TheWidlarzGroup)", "workspaces": [ "packages/react-native-video", + "packages/drm-plugin", "example", "docs" ], "scripts": { - "build": "bun react-native-video build", + "build": "bun --filter=\"./packages/**\" run build", + "specs": "bun --filter=\"./packages/**\" specs", "lint": "bun --filter=\"**\" lint", "typecheck": "bun --filter=\"**\" typecheck", "clean": "git clean -xdf", "react-native-video": "bun run --cwd packages/react-native-video", + "drm-plugin": "bun run --cwd packages/drm-plugin", "example": "bun run --cwd example", "postinstall": "patch-package --patch-dir example/patches", "release:github": "release-it --preRelease alpha", "release": "./scripts/release.sh" }, "devDependencies": { - "@eslint/js": "^9.10.0", - "@react-native/eslint-config": "^0.77.0", "@commitlint/config-conventional": "^17.0.2", + "@eslint/js": "^9.10.0", "@evilmartians/lefthook": "^1.5.0", - "commitlint": "^17.0.2", + "@react-native/eslint-config": "^0.77.0", "@release-it-plugins/workspaces": "^4.2.0", "@release-it/bumper": "^6.0.1", "@release-it/conventional-changelog": "^8.0.2", "@tsconfig/react-native": "^2.0.2", "@types/eslint__js": "^8.42.3", "@types/react": "^18.2.44", + "commitlint": "^17.0.2", "eslint": "^8.51.0", "eslint-plugin-prettier": "^5.0.1", + "patch-package": "^8.0.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "release-it": "^17.10.0", "typescript": "^5.2.2", - "typescript-eslint": "^8.13.0", - "patch-package": "^8.0.0" + "typescript-eslint": "^8.13.0" }, "commitlint": { "extends": [ diff --git a/packages/drm-plugin/.eslintrc.js b/packages/drm-plugin/.eslintrc.js new file mode 100644 index 00000000..c7f1183f --- /dev/null +++ b/packages/drm-plugin/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + root: true, + extends: ['../../config/.eslintrc.js'], + parserOptions: { + tsconfigRootDir: __dirname, + project: true, + }, +}; diff --git a/packages/drm-plugin/.gitattributes b/packages/drm-plugin/.gitattributes new file mode 100644 index 00000000..e27f70fa --- /dev/null +++ b/packages/drm-plugin/.gitattributes @@ -0,0 +1,3 @@ +*.pbxproj -text +# specific for windows script files +*.bat text eol=crlf diff --git a/packages/drm-plugin/.gitignore b/packages/drm-plugin/.gitignore new file mode 100644 index 00000000..46c939a7 --- /dev/null +++ b/packages/drm-plugin/.gitignore @@ -0,0 +1,83 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.classpath +.cxx +.gradle +.idea +.project +.settings +local.properties +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +# Expo +.expo/ + +# Turborepo +.turbo/ + +# generated by bob +lib/ + +# React Native Codegen +ios/generated +android/generated diff --git a/packages/drm-plugin/.watchmanconfig b/packages/drm-plugin/.watchmanconfig new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/packages/drm-plugin/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/drm-plugin/README.md b/packages/drm-plugin/README.md new file mode 100644 index 00000000..6f472fe8 --- /dev/null +++ b/packages/drm-plugin/README.md @@ -0,0 +1,95 @@ +# @twg/react-native-video-drm + +DRM plugin for react-native-video. It adds Widevine (Android) and FairPlay (iOS, visionOS) playback support via the react-native-video plugin system. + +## Requirements + +- react-native-video >= 7.0.0-alpha.3 +- react-native-nitro-modules >= 0.27.2 + +## Installation + +```sh +npm install @twg/react-native-video-drm react-native-video react-native-nitro-modules +# then for iOS +npx pod-install +``` + +Notes +- This library uses Nitro Modules; autolinking is supported. No manual native changes are needed besides running CocoaPods on iOS. +- On Expo, use a prebuild workflow (npx expo prebuild) — pure managed apps aren’t supported. + +## Quick start + +Enable the plugin once at app start, then pass DRM params on your video source. + +```tsx +import React from 'react'; +import { Platform } from 'react-native'; +import { VideoView, useVideoPlayer } from 'react-native-video'; +import { enable, isEnabled } from '@twg/react-native-video-drm'; + +// Enable at startup (required on Android; safe on iOS) +enable(); + +export default function Player() { + const player = useVideoPlayer({ + uri: 'https://example.com/stream.m3u8', + // Request headers used by the media request and (on iOS default flow) the license request + headers: { Authorization: 'Bearer ' }, + drm: { + // Optional: defaults to platform (fairplay on Apple, widevine on Android) + type: Platform.select({ ios: 'fairplay', default: 'widevine' }), + + // Android (Widevine) + licenseUrl: 'https://license.example.com/widevine', + licenseHeaders: { 'x-custom': 'value' }, + multiSession: true, + + // iOS (FairPlay) + // For FairPlay provide certificateUrl and (optionally) contentId. + // When contentId is not provided, the plugin tries to infer it from the skd:// key URL. + certificateUrl: Platform.OS === 'ios' ? 'https://license.example.com/fps.cer' : undefined, + }, + }); + + return ; +} +``` + +## API + +From `@twg/react-native-video-drm`: + +- `enable(): void` — registers the plugin. Call once during app startup (Android requires it; iOS tries to auto-enable, but calling is safe). +- `disable(): void` — unregisters the plugin. +- `isEnabled: boolean` — plugin registration status. + +DRM params (provided via `useVideoPlayer({ drm: ... })` or equivalent config in react-native-video): + +- `type?: 'widevine' | 'fairplay' | string` — DRM system. Defaults: Android → widevine, Apple → fairplay. +- `licenseUrl?: string` — license server URL. Required for both Widevine and FairPlay default flows. +- `licenseHeaders?: Record` — headers for license requests (Android only). +- `multiSession?: boolean` — allow multiple sessions (Android only). +- `certificateUrl?: string` — FairPlay application certificate URL (iOS/visionOS). +- `contentId?: string` — FairPlay content ID (iOS/visionOS). If omitted, inferred from `skd://` key URL when possible. +- `getLicense?: (payload) => Promise` — iOS custom license fetch. Receives `{ contentId, licenseUrl, keyUrl, spc }` and must resolve to a base64-encoded CKC. + +## Platform notes + +- iOS/visionOS + - FairPlay is not supported on the simulator — test on a real device. + - Default license flow posts SPC bytes to `licenseUrl` and uses `source.headers` (not `licenseHeaders`). Use `getLicense` for full control. + - Provide `certificateUrl`; set `contentId` if your server needs it. +- Android + - Widevine is handled via ExoPlayer (Media3). Use `licenseHeaders` for request headers and `multiSession` if needed. + +## Troubleshooting + +- “Failed to fetch certificate/license” — verify URLs are reachable and correct, and that headers/tokens are included. On iOS default flow, set headers in `source.headers`. +- “Unsupported DRM type” — set `drm.type` appropriately or omit it to use platform defaults. +- “DRM not working on simulator” — FairPlay does not work on the iOS simulator. + +## License + +MIT diff --git a/packages/drm-plugin/ReactNativeVideoDrm.podspec b/packages/drm-plugin/ReactNativeVideoDrm.podspec new file mode 100644 index 00000000..8596ac3c --- /dev/null +++ b/packages/drm-plugin/ReactNativeVideoDrm.podspec @@ -0,0 +1,31 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) + +Pod::Spec.new do |s| + s.name = "ReactNativeVideoDrm" + s.version = package["version"] + s.summary = package["description"] + s.homepage = package["homepage"] + s.license = package["license"] + s.authors = package["author"] + + s.platforms = { :ios => min_ios_version_supported } + s.source = { :git => "https://github.com/TheWidlarzGroup/react-native-video-drm.git", :tag => "#{s.version}" } + + + s.source_files = [ + "ios/**/*.{swift}", + "ios/**/*.{m,mm}", + "cpp/**/*.{hpp,cpp}", + ] + + s.dependency 'React-jsi' + s.dependency 'React-callinvoker' + s.dependency 'ReactNativeVideo' + + load 'nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb' + add_nitrogen_files(s) + + install_modules_dependencies(s) +end diff --git a/packages/drm-plugin/android/CMakeLists.txt b/packages/drm-plugin/android/CMakeLists.txt new file mode 100644 index 00000000..1395eafe --- /dev/null +++ b/packages/drm-plugin/android/CMakeLists.txt @@ -0,0 +1,24 @@ +project(ReactNativeVideoDrm) +cmake_minimum_required(VERSION 3.9.0) + +set(PACKAGE_NAME ReactNativeVideoDrm) +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_CXX_STANDARD 20) + +# Define C++ library and add all sources +add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp) + +# Add Nitrogen specs :) +include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake) + +# Set up local includes +include_directories("src/main/cpp" "../cpp") + +find_library(LOG_LIB log) + +# Link all libraries together +target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + android # <-- Android core +) diff --git a/packages/drm-plugin/android/build.gradle b/packages/drm-plugin/android/build.gradle new file mode 100644 index 00000000..3c9eb619 --- /dev/null +++ b/packages/drm-plugin/android/build.gradle @@ -0,0 +1,135 @@ +buildscript { + ext.getExtOrDefault = {name -> + return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['VideoDrm_' + name] + } + + repositories { + google() + mavenCentral() + } + + dependencies { + classpath "com.android.tools.build:gradle:8.7.2" + // noinspection DifferentKotlinGradleVersion + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}" + } +} + +def reactNativeArchitectures() { + def value = rootProject.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] +} + +apply plugin: "com.android.library" +apply plugin: "kotlin-android" +apply from: '../nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle' + +apply plugin: "com.facebook.react" + +def getExtOrIntegerDefault(name) { + return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["VideoDrm_" + name]).toInteger() +} + +android { + namespace "com.twg.videodrm" + + compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") + + defaultConfig { + minSdkVersion getExtOrIntegerDefault("minSdkVersion") + targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") + + externalNativeBuild { + cmake { + cppFlags "-frtti -fexceptions -Wall -fstack-protector-all" + arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" + abiFilters (*reactNativeArchitectures()) + + buildTypes { + debug { + cppFlags "-O1 -g" + } + release { + cppFlags "-O2" + } + } + } + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + + packagingOptions { + excludes = [ + "META-INF", + "META-INF/**", + "**/libc++_shared.so", + "**/libfbjni.so", + "**/libjsi.so", + "**/libfolly_json.so", + "**/libfolly_runtime.so", + "**/libglog.so", + "**/libhermes.so", + "**/libhermes-executor-debug.so", + "**/libhermes_executor.so", + "**/libreactnative.so", + "**/libreactnativejni.so", + "**/libturbomodulejsijni.so", + "**/libreact_nativemodule_core.so", + "**/libjscexecutor.so" + ] + } + + buildFeatures { + buildConfig true + prefab true + } + + buildTypes { + release { + minifyEnabled false + } + } + + lintOptions { + disable "GradleCompatible" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + sourceSets { + main { + java.srcDirs += [ + "generated/java", + "generated/jni" + ] + } + } +} + +repositories { + mavenCentral() + google() +} + +def kotlin_version = getExtOrDefault("kotlinVersion") + +dependencies { + implementation "com.facebook.react:react-android" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + implementation "androidx.media3:media3-common:1.4.1" + implementation "androidx.media3:media3-exoplayer:1.4.1" + implementation "androidx.media3:media3-datasource-okhttp:1.4.1" + + implementation project(":react-native-nitro-modules") + implementation project(":react-native-video") +} + diff --git a/packages/drm-plugin/android/gradle.properties b/packages/drm-plugin/android/gradle.properties new file mode 100644 index 00000000..16d4838a --- /dev/null +++ b/packages/drm-plugin/android/gradle.properties @@ -0,0 +1,5 @@ +VideoDrm_kotlinVersion=2.0.21 +VideoDrm_minSdkVersion=24 +VideoDrm_targetSdkVersion=34 +VideoDrm_compileSdkVersion=35 +VideoDrm_ndkVersion=27.1.12297006 diff --git a/packages/drm-plugin/android/src/main/AndroidManifest.xml b/packages/drm-plugin/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a2f47b60 --- /dev/null +++ b/packages/drm-plugin/android/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/packages/drm-plugin/android/src/main/cpp/cpp-adapter.cpp b/packages/drm-plugin/android/src/main/cpp/cpp-adapter.cpp new file mode 100644 index 00000000..ba61632e --- /dev/null +++ b/packages/drm-plugin/android/src/main/cpp/cpp-adapter.cpp @@ -0,0 +1,6 @@ +#include +#include "ReactNativeVideoDrmOnLoad.hpp" + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + return margelo::nitro::videodrm::initialize(vm); +} diff --git a/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMManager/DRMManager.kt b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMManager/DRMManager.kt new file mode 100644 index 00000000..acb7976e --- /dev/null +++ b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMManager/DRMManager.kt @@ -0,0 +1,107 @@ +package com.twg.videodrm.DRMManager + +import android.content.Context +import androidx.annotation.OptIn +import androidx.media3.common.MediaItem.DrmConfiguration +import androidx.media3.common.util.UnstableApi +import androidx.media3.common.util.Util +import androidx.media3.datasource.okhttp.OkHttpDataSource +import androidx.media3.exoplayer.drm.DefaultDrmSessionManager +import androidx.media3.exoplayer.drm.DrmSessionManager +import androidx.media3.exoplayer.drm.FrameworkMediaDrm +import androidx.media3.exoplayer.drm.HttpMediaDrmCallback +import androidx.media3.exoplayer.drm.MediaDrmCallback +import com.video.core.player.DRMManagerSpec +import com.margelo.nitro.NitroModules +import com.margelo.nitro.video.NativeDrmParams +import com.video.core.player.buildHttpDataSourceFactory +import com.video.core.plugins.NativeVideoPlayerSource +import java.util.UUID + +class DRMManager(val source: NativeVideoPlayerSource) : DRMManagerSpec { + private var hasDrmFailed = false + private val context: Context + get() { + return NitroModules.applicationContext ?: throw Error("Context is not found") + } + + private var headersHash = -1 + private var httpDataSourceFactory: OkHttpDataSource.Factory? = null + + private fun shouldRebuildHttpDataSource(): Boolean { + val header = source.config.headers + if (header == null) { + return false + } + + val hash = header.hashCode() + if (hash == headersHash) { + return false + } + + headersHash = hash + return true + } + + private fun getHttpDataSourceFactory(): OkHttpDataSource.Factory { + if (shouldRebuildHttpDataSource() || httpDataSourceFactory == null) { + httpDataSourceFactory = buildHttpDataSourceFactory(context, source) + } + + return httpDataSourceFactory ?: throw Error("Couldn't build HttpDataSourceFactory") + } + + @OptIn(UnstableApi::class) + override fun buildDrmSessionManager( + drmParams: NativeDrmParams, + drmUuid: UUID?, + retryCount: Int + ): DrmSessionManager { + try { + val uuid = drmUuid ?: throw Error("DRM UUID is not set") + val mediaDrm = FrameworkMediaDrm.newInstance(uuid) + val mediaDrmCallback = HttpMediaDrmCallback( + drmParams.licenseUrl, + getHttpDataSourceFactory(), + ) + + if (drmParams.licenseHeaders != null) { + for ((key, value) in drmParams.licenseHeaders) { + mediaDrmCallback.setKeyRequestProperty(key, value) + } + } + + if (hasDrmFailed) { + mediaDrm.setPropertyString("securityLevel", "L3") + } + + return DefaultDrmSessionManager.Builder() + .setUuidAndExoMediaDrmProvider(uuid) { mediaDrm } + .setKeyRequestParameters(null) + .setMultiSession(drmParams.multiSession == true) + .build(mediaDrmCallback) + } catch (err: Exception) { + if (retryCount < 3) { + hasDrmFailed = true + return buildDrmSessionManager(drmParams, drmUuid, retryCount + 1) + } + + throw err + } + } + + @OptIn(UnstableApi::class) + override fun getDRMConfiguration(drmParams: NativeDrmParams): DrmConfiguration { + val uuid = Util.getDrmUuid(drmParams.type ?: "widevine") ?: throw Error("DRM UUID is not set") + + val configurationBuilder = DrmConfiguration.Builder(uuid) + .setMultiSession(drmParams.multiSession == true) + .setLicenseUri(drmParams.licenseUrl) + + drmParams.licenseHeaders?.let { + configurationBuilder.setLicenseRequestHeaders(it) + } + + return configurationBuilder.build() + } +} \ No newline at end of file diff --git a/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMPlugin.kt b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMPlugin.kt new file mode 100644 index 00000000..ca683ee3 --- /dev/null +++ b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/DRMPlugin.kt @@ -0,0 +1,12 @@ +package com.twg.videodrm + +import com.twg.videodrm.DRMManager.DRMManager +import com.video.core.player.DRMManagerSpec +import com.video.core.plugins.NativeVideoPlayerSource +import com.video.core.plugins.ReactNativeVideoPlugin + +class DRMPlugin(name: String) : ReactNativeVideoPlugin(name) { + override fun getDRMManager(source: NativeVideoPlayerSource): DRMManagerSpec? { + return DRMManager(source) + } +} \ No newline at end of file diff --git a/packages/drm-plugin/android/src/main/java/com/twg/videodrm/PluginManager.kt b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/PluginManager.kt new file mode 100644 index 00000000..290bf6b6 --- /dev/null +++ b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/PluginManager.kt @@ -0,0 +1,53 @@ +package com.margelo.nitro.videodrm + +import com.facebook.proguard.annotations.DoNotStrip +import com.twg.videodrm.DRMPlugin +import com.video.core.plugins.PluginsRegistry + +@DoNotStrip +class PluginManager : HybridPluginManagerSpec() { + private var plugin: DRMPlugin? = null + + override val isEnabled: Boolean + get() = plugin != null + + override fun enable() { + if (isEnabled) { + return + } + + initializePlugin() + } + + override fun disable() { + if (!isEnabled) { + return + } + + destroyPlugin() + } + + private fun initializePlugin() { + plugin = DRMPlugin("ReactNativeVideoDRM") + + plugin?.let { + PluginsRegistry.shared.register(it) + } ?: throw Error("Failed to initialize DRM plugin.") + } + + private fun destroyPlugin() { + plugin?.let { + PluginsRegistry.shared.unregister(it) + } ?: throw Error("Plugin is not initialized!") + + plugin = null + } + + override fun dispose() { + if (isEnabled) { + try { + destroyPlugin() + } catch (_: Exception) { } + } + } +} diff --git a/packages/drm-plugin/android/src/main/java/com/twg/videodrm/VideoDrmPackage.kt b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/VideoDrmPackage.kt new file mode 100644 index 00000000..4391310a --- /dev/null +++ b/packages/drm-plugin/android/src/main/java/com/twg/videodrm/VideoDrmPackage.kt @@ -0,0 +1,22 @@ +package com.twg.videodrm + +import com.facebook.react.TurboReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.model.ReactModuleInfoProvider + +class VideoDrmPackage : TurboReactPackage() { + override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { + return null + } + + override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { + return ReactModuleInfoProvider { HashMap() } + } + + companion object { + init { + System.loadLibrary("ReactNativeVideoDrm") + } + } +} diff --git a/packages/drm-plugin/babel.config.js b/packages/drm-plugin/babel.config.js new file mode 100644 index 00000000..0c05fd69 --- /dev/null +++ b/packages/drm-plugin/babel.config.js @@ -0,0 +1,12 @@ +module.exports = { + overrides: [ + { + exclude: /\/node_modules\//, + presets: ['module:react-native-builder-bob/babel-preset'], + }, + { + include: /\/node_modules\//, + presets: ['module:@react-native/babel-preset'], + }, + ], +}; diff --git a/packages/drm-plugin/ios/DRMManager/DRMManager+AVContentKeySessionDelegate.swift b/packages/drm-plugin/ios/DRMManager/DRMManager+AVContentKeySessionDelegate.swift new file mode 100644 index 00000000..7dd7e7b9 --- /dev/null +++ b/packages/drm-plugin/ios/DRMManager/DRMManager+AVContentKeySessionDelegate.swift @@ -0,0 +1,63 @@ +// +// DRMManager+AVContentKeySessionDelegate.swift +// ReactNativeVideoDrm +// +// Created by Krzysztof Moch on 07/08/2025. +// + +import AVFoundation +import Foundation +import NitroModules + +extension DRMManager: AVContentKeySessionDelegate { + func contentKeySession( + _: AVContentKeySession, + didProvide keyRequest: AVContentKeyRequest + ) { + handleContentKeyRequest(keyRequest: keyRequest) + } + + func contentKeySession( + _: AVContentKeySession, + didProvideRenewingContentKeyRequest keyRequest: AVContentKeyRequest + ) { + handleContentKeyRequest(keyRequest: keyRequest) + } + + func contentKeySession( + _: AVContentKeySession, + shouldRetry _: AVContentKeyRequest, + reason retryReason: AVContentKeyRequest.RetryReason + ) -> Bool { + let retryReasons: [AVContentKeyRequest.RetryReason] = [ + .timedOut, + .receivedResponseWithExpiredLease, + .receivedObsoleteContentKey, + ] + return retryReasons.contains(retryReason) + } + + func contentKeySession( + _: AVContentKeySession, + didProvide keyRequest: AVPersistableContentKeyRequest + ) { + handleError( + error: RuntimeError.error( + withMessage: + "Persistable content key requests are not supported in This Plugin. Please see Offline Video SDK if you need this functionality." + ), + for: keyRequest + ) + } + + func contentKeySession( + _: AVContentKeySession, + contentKeyRequest _: AVContentKeyRequest, + didFailWithError error: Error + ) { + // TODO: Handle error appropriately + print( + "[ReactNativeVideo] DRMManager: Content key request failed with error: \(error.localizedDescription)" + ) + } +} diff --git a/packages/drm-plugin/ios/DRMManager/DRMManager.swift b/packages/drm-plugin/ios/DRMManager/DRMManager.swift new file mode 100644 index 00000000..5f92fe62 --- /dev/null +++ b/packages/drm-plugin/ios/DRMManager/DRMManager.swift @@ -0,0 +1,229 @@ +// +// DRMManager.swift +// ReactNativeVideoDrm +// +// Created by Krzysztof Moch on 07/08/2025. +// + +import AVFoundation +import Foundation +import NitroModules +import ReactNativeVideo + +class DRMManager: NSObject, DRMManagerSpec { + static let queue = DispatchQueue( + label: "ReactNativeVideoDrmContentKeyDelegateQueue" + ) + + let contentKeySession: AVContentKeySession + weak var source: NativeVideoPlayerSource? + + var drmParams: NativeDrmParams? { + return source?.config.drm + } + + init(source: NativeVideoPlayerSource) { + contentKeySession = AVContentKeySession(keySystem: .fairPlayStreaming) + self.source = source + + super.init() + contentKeySession.setDelegate(self, queue: DRMManager.queue) + } + + func createContentKeyRequest( + for asset: AVURLAsset, + drmParams: NativeDrmParams + ) throws { + if drmParams.type != "fairplay" { + throw RuntimeError.error( + withMessage: + "Unsupported DRM type: \(String(describing: drmParams.type))" + ) + } + + contentKeySession.addContentKeyRecipient(asset) + } + + // MARK: - Internal Methods + internal func handleError(error: Error, for keyRequest: AVContentKeyRequest) { + print( + "[ReactNativeVideo] DRM Error: \(error.localizedDescription) for source \(source?.uri ?? "unknown source")" + ) + + keyRequest.processContentKeyResponseError(error) + } + + internal func handleContentKeyRequest(keyRequest: AVContentKeyRequest) { + Task { + do { + try await processContentKeyRequest(keyRequest: keyRequest) + } catch { + handleError(error: error, for: keyRequest) + } + } + } + + internal func finishProcessingContentKeyRequest( + keyRequest: AVContentKeyRequest, + license: Data + ) throws { + let keyResponse = AVContentKeyResponse( + fairPlayStreamingKeyResponseData: license + ) + keyRequest.processContentKeyResponse(keyResponse) + } + + // MARK: - Private Methods + + private func processContentKeyRequest(keyRequest: AVContentKeyRequest) + async throws + { + guard let assetId = getAssetId(keyRequest: keyRequest), + let assetIdData = assetId.data(using: .utf8) + else { + throw RuntimeError.error( + withMessage: + "No asset ID found for content key request (For \(source?.uri ?? "unknown source"))" + ) + } + + let appCertificate = try await requestApplicationCertificate() + let spcData = try await keyRequest.makeStreamingContentKeyRequestData( + forApp: appCertificate, + contentIdentifier: assetIdData + ) + + if let getLicense = drmParams?.getLicense { + + guard let licenseUrl = drmParams?.licenseUrl, + let keyUrl = keyRequest.identifier as? String + else { + throw RuntimeError.error( + withMessage: + "Missing required parameters for getLicense (For \(source?.uri ?? "unknown source"))" + ) + } + + let payload = OnGetLicensePayload( + contentId: assetId, + licenseUrl: licenseUrl, + keyUrl: keyUrl, + spc: spcData.base64EncodedString() + ) + + // Get Promise from JavaScript + let getLicenseJS = try await getLicense(payload).await() + + // Resolve Promise from JavaScript + let license = try await getLicenseJS.await() + + guard let licenseData = Data(base64Encoded: license) else { + throw RuntimeError.error( + withMessage: + "Invalid license data received from getLicense (For \(source?.uri ?? "unknown source"))" + ) + } + + try finishProcessingContentKeyRequest( + keyRequest: keyRequest, + license: licenseData + ) + } else { + + // Try "Default" License Request + let license = try await requestLicense(spcData: spcData) + try finishProcessingContentKeyRequest( + keyRequest: keyRequest, + license: license + ) + } + } + + private func requestApplicationCertificate() async throws -> Data { + guard let urlString = drmParams?.certificateUrl, + let url = URL(string: urlString) + else { + throw RuntimeError.error( + withMessage: + "No certificate URL provided (For \(source?.uri ?? "unknown source"))" + ) + } + + let (data, response) = try await URLSession.shared.data(from: url) + + guard let httpResponse = response as? HTTPURLResponse, + httpResponse.statusCode == 200 + else { + throw RuntimeError.error( + withMessage: "Failed to fetch certificate from \(urlString)" + ) + } + + if let base64EncodedData = String(data: data, encoding: .utf8), + let certData = Data(base64Encoded: base64EncodedData) + { + return certData + } + + return data + } + + private func requestLicense(spcData: Data) async throws -> Data { + guard let licenseServerUrlString = drmParams?.licenseUrl, + let licenseServerUrl = URL(string: licenseServerUrlString) + else { + throw RuntimeError.error( + withMessage: + "No license URL provided (For \(source?.uri ?? "unknown source"))" + ) + } + + var request = URLRequest(url: licenseServerUrl) + request.httpMethod = "POST" + request.httpBody = spcData + + // Use source headers for now, there was some issues with headers in the DRM params + if let headers = source?.config.headers { + for (key, value) in headers { + request.setValue(value, forHTTPHeaderField: key) + } + } + + let (data, response) = try await URLSession.shared.data(for: request) + + guard let httpResponse = response as? HTTPURLResponse else { + throw RuntimeError.error( + withMessage: + "Invalid response from license server (For \(source?.uri ?? "unknown source")) - \(String(describing: response))" + ) + } + + guard httpResponse.statusCode == 200 else { + throw RuntimeError.error( + withMessage: + "License request failed with status code \(httpResponse.statusCode) (For \(source?.uri ?? "unknown source"))" + ) + } + + guard !data.isEmpty else { + throw RuntimeError.error( + withMessage: + "License response is empty (For \(source?.uri ?? "unknown source"))" + ) + } + + return data + } + + private func getAssetId(keyRequest: AVContentKeyRequest) -> String? { + if let assetId = drmParams?.contentId { + return assetId + } + + if let url = keyRequest.identifier as? String { + return url.replacingOccurrences(of: "skd://", with: "") + } + + return nil + } +} diff --git a/packages/drm-plugin/ios/DRMPlugin.swift b/packages/drm-plugin/ios/DRMPlugin.swift new file mode 100644 index 00000000..e213b001 --- /dev/null +++ b/packages/drm-plugin/ios/DRMPlugin.swift @@ -0,0 +1,21 @@ +// +// DRMPlugin.swift +// ReactNativeVideoDrm +// +// Created by Krzysztof Moch on 07/08/2025. +// + +import Foundation +import ReactNativeVideo + +class DRMPlugin: ReactNativeVideoPlugin { + override func getDRMManager(source: any NativeVideoPlayerSource) -> (any DRMManagerSpec)? { + #if targetEnvironment(simulator) + // DRM is not supported on the simulator. + print("[ReactNativeVideoDRM] DRM is not supported on the simulator. Returning nil.") + return nil + #else + return DRMManager(source: source) + #endif + } +} diff --git a/packages/drm-plugin/ios/PluginManager.swift b/packages/drm-plugin/ios/PluginManager.swift new file mode 100644 index 00000000..63bd4999 --- /dev/null +++ b/packages/drm-plugin/ios/PluginManager.swift @@ -0,0 +1,72 @@ +// +// PluginManager.swift +// ReactNativeVideoDrm +// +// Created by Krzysztof Moch on 07/08/2025. +// + +import NitroModules +import ReactNativeVideo + +class PluginManager: HybridPluginManagerSpec { + var plugin: DRMPlugin? = nil + + override init() { + super.init() + do { + try enable() + } catch { + // Handle error if needed, for example log it + print("Failed to enable DRM plugin: \(error)") + } + } + + var isEnabled: Bool { + return plugin != nil + } + + func enable() throws { + if isEnabled { + return + } + + try initializePlugin() + } + + func disable() throws { + if !isEnabled { + return + } + + try destroyPlugin() + } + + private func initializePlugin() throws { + plugin = DRMPlugin(name: "ReactNativeVideoDRM") + + guard let plugin else { + throw RuntimeError.error(withMessage: "Failed to initialize DRM plugin.") + } + + PluginsRegistry.shared.register(plugin: plugin) + } + + private func destroyPlugin() throws { + guard let plugin else { + throw RuntimeError.error(withMessage: "Plugin is not initialized.") + } + + PluginsRegistry.shared.unregister(plugin: plugin) + self.plugin = nil + } + + func dispose() { + if isEnabled { + do { + try destroyPlugin() + } catch { + // ignore errors during disposal + } + } + } +} diff --git a/packages/drm-plugin/nitro.json b/packages/drm-plugin/nitro.json new file mode 100644 index 00000000..93b11bcd --- /dev/null +++ b/packages/drm-plugin/nitro.json @@ -0,0 +1,17 @@ +{ + "cxxNamespace": ["videodrm"], + "ios": { + "iosModuleName": "ReactNativeVideoDrm" + }, + "android": { + "androidNamespace": ["videodrm"], + "androidCxxLibName": "ReactNativeVideoDrm" + }, + "autolinking": { + "PluginManager": { + "swift": "PluginManager", + "kotlin": "PluginManager" + } + }, + "ignorePaths": ["node_modules"] +} diff --git a/packages/drm-plugin/nitrogen/generated/.gitattributes b/packages/drm-plugin/nitrogen/generated/.gitattributes new file mode 100644 index 00000000..fb7a0d5a --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/.gitattributes @@ -0,0 +1 @@ +** linguist-generated=true diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake new file mode 100644 index 00000000..bc625974 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake @@ -0,0 +1,78 @@ +# +# ReactNativeVideoDrm+autolinking.cmake +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/mrousavy/nitro +# Copyright © 2025 Marc Rousavy @ Margelo +# + +# This is a CMake file that adds all files generated by Nitrogen +# to the current CMake project. +# +# To use it, add this to your CMakeLists.txt: +# ```cmake +# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake) +# ``` + +# Add all headers that were generated by Nitrogen +include_directories( + "../nitrogen/generated/shared/c++" + "../nitrogen/generated/android/c++" + "../nitrogen/generated/android/" +) + +# Add all .cpp sources that were generated by Nitrogen +target_sources( + # CMake project name (Android C++ library name) + ReactNativeVideoDrm PRIVATE + # Autolinking Setup + ../nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp + # Shared Nitrogen C++ sources + ../nitrogen/generated/shared/c++/HybridPluginManagerSpec.cpp + # Android-specific Nitrogen C++ sources + ../nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp +) + +# Define a flag to check if we are building properly +add_definitions(-DBUILDING_REACTNATIVEVIDEODRM_WITH_GENERATED_CMAKE_PROJECT) + +# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake +# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake + target_compile_definitions( + ReactNativeVideoDrm PRIVATE + -DFOLLY_NO_CONFIG=1 + -DFOLLY_HAVE_CLOCK_GETTIME=1 + -DFOLLY_USE_LIBCPP=1 + -DFOLLY_CFG_NO_COROUTINES=1 + -DFOLLY_MOBILE=1 + -DFOLLY_HAVE_RECVMMSG=1 + -DFOLLY_HAVE_PTHREAD=1 + # Once we target android-23 above, we can comment + # the following line. NDK uses GNU style stderror_r() after API 23. + -DFOLLY_HAVE_XSI_STRERROR_R=1 +) + +# Add all libraries required by the generated specs +find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ +find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) +find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library + +# Link all libraries together +target_link_libraries( + ReactNativeVideoDrm + fbjni::fbjni # <-- Facebook C++ JNI helpers + ReactAndroid::jsi # <-- RN: JSI + react-native-nitro-modules::NitroModules # <-- NitroModules Core :) +) + +# Link react-native (different prefab between RN 0.75 and RN 0.76) +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + ReactNativeVideoDrm + ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab + ) +else() + target_link_libraries( + ReactNativeVideoDrm + ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core + ) +endif() diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle new file mode 100644 index 00000000..2fda2208 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle @@ -0,0 +1,27 @@ +/// +/// ReactNativeVideoDrm+autolinking.gradle +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +/// This is a Gradle file that adds all files generated by Nitrogen +/// to the current Gradle project. +/// +/// To use it, add this to your build.gradle: +/// ```gradle +/// apply from: '../nitrogen/generated/android/ReactNativeVideoDrm+autolinking.gradle' +/// ``` + +logger.warn("[NitroModules] 🔥 ReactNativeVideoDrm is boosted by nitro!") + +android { + sourceSets { + main { + java.srcDirs += [ + // Nitrogen files + "${project.projectDir}/../nitrogen/generated/android/kotlin" + ] + } + } +} diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp new file mode 100644 index 00000000..7f1e9d26 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp @@ -0,0 +1,45 @@ +/// +/// ReactNativeVideoDrmOnLoad.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#ifndef BUILDING_REACTNATIVEVIDEODRM_WITH_GENERATED_CMAKE_PROJECT +#error ReactNativeVideoDrmOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? +#endif + +#include "ReactNativeVideoDrmOnLoad.hpp" + +#include +#include +#include + +#include "JHybridPluginManagerSpec.hpp" +#include + +namespace margelo::nitro::videodrm { + +int initialize(JavaVM* vm) { + using namespace margelo::nitro; + using namespace margelo::nitro::videodrm; + using namespace facebook; + + return facebook::jni::initialize(vm, [] { + // Register native JNI methods + margelo::nitro::videodrm::JHybridPluginManagerSpec::registerNatives(); + + // Register Nitro Hybrid Objects + HybridObjectRegistry::registerHybridObjectConstructor( + "PluginManager", + []() -> std::shared_ptr { + static DefaultConstructableObject object("com/margelo/nitro/videodrm/PluginManager"); + auto instance = object.create(); + auto globalRef = jni::make_global(instance); + return globalRef->cthis()->shared(); + } + ); + }); +} + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.hpp b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.hpp new file mode 100644 index 00000000..718d0412 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.hpp @@ -0,0 +1,25 @@ +/// +/// ReactNativeVideoDrmOnLoad.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#include +#include + +namespace margelo::nitro::videodrm { + + /** + * Initializes the native (C++) part of ReactNativeVideoDrm, and autolinks all Hybrid Objects. + * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). + * Example: + * ```cpp (cpp-adapter.cpp) + * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + * return margelo::nitro::videodrm::initialize(vm); + * } + * ``` + */ + int initialize(JavaVM* vm); + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp b/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp new file mode 100644 index 00000000..3db3d032 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp @@ -0,0 +1,53 @@ +/// +/// JHybridPluginManagerSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#include "JHybridPluginManagerSpec.hpp" + + + + + +namespace margelo::nitro::videodrm { + + jni::local_ref JHybridPluginManagerSpec::initHybrid(jni::alias_ref jThis) { + return makeCxxInstance(jThis); + } + + void JHybridPluginManagerSpec::registerNatives() { + registerHybrid({ + makeNativeMethod("initHybrid", JHybridPluginManagerSpec::initHybrid), + }); + } + + size_t JHybridPluginManagerSpec::getExternalMemorySize() noexcept { + static const auto method = javaClassStatic()->getMethod("getMemorySize"); + return method(_javaPart); + } + + void JHybridPluginManagerSpec::dispose() noexcept { + static const auto method = javaClassStatic()->getMethod("dispose"); + method(_javaPart); + } + + // Properties + bool JHybridPluginManagerSpec::getIsEnabled() { + static const auto method = javaClassStatic()->getMethod("isEnabled"); + auto __result = method(_javaPart); + return static_cast(__result); + } + + // Methods + void JHybridPluginManagerSpec::enable() { + static const auto method = javaClassStatic()->getMethod("enable"); + method(_javaPart); + } + void JHybridPluginManagerSpec::disable() { + static const auto method = javaClassStatic()->getMethod("disable"); + method(_javaPart); + } + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.hpp b/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.hpp new file mode 100644 index 00000000..8e23a069 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/c++/JHybridPluginManagerSpec.hpp @@ -0,0 +1,65 @@ +/// +/// HybridPluginManagerSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include +#include "HybridPluginManagerSpec.hpp" + + + + +namespace margelo::nitro::videodrm { + + using namespace facebook; + + class JHybridPluginManagerSpec: public jni::HybridClass, + public virtual HybridPluginManagerSpec { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/videodrm/HybridPluginManagerSpec;"; + static jni::local_ref initHybrid(jni::alias_ref jThis); + static void registerNatives(); + + protected: + // C++ constructor (called from Java via `initHybrid()`) + explicit JHybridPluginManagerSpec(jni::alias_ref jThis) : + HybridObject(HybridPluginManagerSpec::TAG), + HybridBase(jThis), + _javaPart(jni::make_global(jThis)) {} + + public: + ~JHybridPluginManagerSpec() override { + // Hermes GC can destroy JS objects on a non-JNI Thread. + jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); + } + + public: + size_t getExternalMemorySize() noexcept override; + void dispose() noexcept override; + + public: + inline const jni::global_ref& getJavaPart() const noexcept { + return _javaPart; + } + + public: + // Properties + bool getIsEnabled() override; + + public: + // Methods + void enable() override; + void disable() override; + + private: + friend HybridBase; + using HybridBase::HybridBase; + jni::global_ref _javaPart; + }; + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/HybridPluginManagerSpec.kt b/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/HybridPluginManagerSpec.kt new file mode 100644 index 00000000..e74dfe4f --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/HybridPluginManagerSpec.kt @@ -0,0 +1,58 @@ +/// +/// HybridPluginManagerSpec.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.videodrm + +import androidx.annotation.Keep +import com.facebook.jni.HybridData +import com.facebook.proguard.annotations.DoNotStrip +import com.margelo.nitro.core.* + +/** + * A Kotlin class representing the PluginManager HybridObject. + * Implement this abstract class to create Kotlin-based instances of PluginManager. + */ +@DoNotStrip +@Keep +@Suppress( + "KotlinJniMissingFunction", "unused", + "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", + "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" +) +abstract class HybridPluginManagerSpec: HybridObject() { + @DoNotStrip + private var mHybridData: HybridData = initHybrid() + + init { + super.updateNative(mHybridData) + } + + override fun updateNative(hybridData: HybridData) { + mHybridData = hybridData + super.updateNative(hybridData) + } + + // Properties + @get:DoNotStrip + @get:Keep + abstract val isEnabled: Boolean + + // Methods + @DoNotStrip + @Keep + abstract fun enable(): Unit + + @DoNotStrip + @Keep + abstract fun disable(): Unit + + private external fun initHybrid(): HybridData + + companion object { + private const val TAG = "HybridPluginManagerSpec" + } +} diff --git a/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/ReactNativeVideoDrmOnLoad.kt b/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/ReactNativeVideoDrmOnLoad.kt new file mode 100644 index 00000000..8611c078 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/android/kotlin/com/margelo/nitro/videodrm/ReactNativeVideoDrmOnLoad.kt @@ -0,0 +1,35 @@ +/// +/// ReactNativeVideoDrmOnLoad.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.videodrm + +import android.util.Log + +internal class ReactNativeVideoDrmOnLoad { + companion object { + private const val TAG = "ReactNativeVideoDrmOnLoad" + private var didLoad = false + /** + * Initializes the native part of "ReactNativeVideoDrm". + * This method is idempotent and can be called more than once. + */ + @JvmStatic + fun initializeNative() { + if (didLoad) return + try { + Log.i(TAG, "Loading ReactNativeVideoDrm C++ library...") + System.loadLibrary("ReactNativeVideoDrm") + Log.i(TAG, "Successfully loaded ReactNativeVideoDrm C++ library!") + didLoad = true + } catch (e: Error) { + Log.e(TAG, "Failed to load ReactNativeVideoDrm C++ library! Is it properly installed and linked? " + + "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) + throw e + } + } + } +} diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb new file mode 100644 index 00000000..d0d61646 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb @@ -0,0 +1,60 @@ +# +# ReactNativeVideoDrm+autolinking.rb +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/mrousavy/nitro +# Copyright © 2025 Marc Rousavy @ Margelo +# + +# This is a Ruby script that adds all files generated by Nitrogen +# to the given podspec. +# +# To use it, add this to your .podspec: +# ```ruby +# Pod::Spec.new do |spec| +# # ... +# +# # Add all files generated by Nitrogen +# load 'nitrogen/generated/ios/ReactNativeVideoDrm+autolinking.rb' +# add_nitrogen_files(spec) +# end +# ``` + +def add_nitrogen_files(spec) + Pod::UI.puts "[NitroModules] 🔥 ReactNativeVideoDrm is boosted by nitro!" + + spec.dependency "NitroModules" + + current_source_files = Array(spec.attributes_hash['source_files']) + spec.source_files = current_source_files + [ + # Generated cross-platform specs + "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", + # Generated bridges for the cross-platform specs + "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", + ] + + current_public_header_files = Array(spec.attributes_hash['public_header_files']) + spec.public_header_files = current_public_header_files + [ + # Generated specs + "nitrogen/generated/shared/**/*.{h,hpp}", + # Swift to C++ bridging helpers + "nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp" + ] + + current_private_header_files = Array(spec.attributes_hash['private_header_files']) + spec.private_header_files = current_private_header_files + [ + # iOS specific specs + "nitrogen/generated/ios/c++/**/*.{h,hpp}", + # Views are framework-specific and should be private + "nitrogen/generated/shared/**/views/**/*" + ] + + current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} + spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ + # Use C++ 20 + "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", + # Enables C++ <-> Swift interop (by default it's only C) + "SWIFT_OBJC_INTEROP_MODE" => "objcxx", + # Enables stricter modular headers + "DEFINES_MODULE" => "YES", + }) +end diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp new file mode 100644 index 00000000..51ee190a --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp @@ -0,0 +1,32 @@ +/// +/// ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#include "ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp" + +// Include C++ implementation defined types +#include "HybridPluginManagerSpecSwift.hpp" +#include "ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp" + +namespace margelo::nitro::videodrm::bridge::swift { + + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* _Nonnull swiftUnsafePointer) { + ReactNativeVideoDrm::HybridPluginManagerSpec_cxx swiftPart = ReactNativeVideoDrm::HybridPluginManagerSpec_cxx::fromUnsafe(swiftUnsafePointer); + return std::make_shared(swiftPart); + } + void* _Nonnull get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType) { + std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); + #ifdef NITRO_DEBUG + if (swiftWrapper == nullptr) [[unlikely]] { + throw std::runtime_error("Class \"HybridPluginManagerSpec\" is not implemented in Swift!"); + } + #endif + ReactNativeVideoDrm::HybridPluginManagerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); + return swiftPart.toUnsafe(); + } + +} // namespace margelo::nitro::videodrm::bridge::swift diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp new file mode 100644 index 00000000..8e9b436e --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp @@ -0,0 +1,51 @@ +/// +/// ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridPluginManagerSpec` to properly resolve imports. +namespace margelo::nitro::videodrm { class HybridPluginManagerSpec; } + +// Forward declarations of Swift defined types +// Forward declaration of `HybridPluginManagerSpec_cxx` to properly resolve imports. +namespace ReactNativeVideoDrm { class HybridPluginManagerSpec_cxx; } + +// Include C++ defined types +#include "HybridPluginManagerSpec.hpp" +#include +#include +#include + +/** + * Contains specialized versions of C++ templated types so they can be accessed from Swift, + * as well as helper functions to interact with those C++ types from Swift. + */ +namespace margelo::nitro::videodrm::bridge::swift { + + // pragma MARK: std::shared_ptr + /** + * Specialized version of `std::shared_ptr`. + */ + using std__shared_ptr_HybridPluginManagerSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType); + + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridPluginManagerSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridPluginManagerSpec_ weakify_std__shared_ptr_HybridPluginManagerSpec_(const std::shared_ptr& strong) { return strong; } + + // pragma MARK: Result + using Result_void_ = Result; + inline Result_void_ create_Result_void_() { + return Result::withValue(); + } + inline Result_void_ create_Result_void_(const std::exception_ptr& error) { + return Result::withError(error); + } + +} // namespace margelo::nitro::videodrm::bridge::swift diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp new file mode 100644 index 00000000..0dbec1a9 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp @@ -0,0 +1,43 @@ +/// +/// ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridPluginManagerSpec` to properly resolve imports. +namespace margelo::nitro::videodrm { class HybridPluginManagerSpec; } + +// Include C++ defined types +#include "HybridPluginManagerSpec.hpp" +#include +#include +#include + +// C++ helpers for Swift +#include "ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp" + +// Common C++ types used in Swift +#include +#include +#include +#include + +// Forward declarations of Swift defined types +// Forward declaration of `HybridPluginManagerSpec_cxx` to properly resolve imports. +namespace ReactNativeVideoDrm { class HybridPluginManagerSpec_cxx; } + +// Include Swift defined types +#if __has_include("ReactNativeVideoDrm-Swift.h") +// This header is generated by Xcode/Swift on every app build. +// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeVideoDrm". +#include "ReactNativeVideoDrm-Swift.h" +// Same as above, but used when building with frameworks (`use_frameworks`) +#elif __has_include() +#include +#else +#error ReactNativeVideoDrm's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeVideoDrm", and try building the app first. +#endif diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.mm b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.mm new file mode 100644 index 00000000..a28fbe6d --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.mm @@ -0,0 +1,33 @@ +/// +/// ReactNativeVideoDrmAutolinking.mm +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#import +#import +#import "ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp" +#import + +#include "HybridPluginManagerSpecSwift.hpp" + +@interface ReactNativeVideoDrmAutolinking : NSObject +@end + +@implementation ReactNativeVideoDrmAutolinking + ++ (void) load { + using namespace margelo::nitro; + using namespace margelo::nitro::videodrm; + + HybridObjectRegistry::registerHybridObjectConstructor( + "PluginManager", + []() -> std::shared_ptr { + std::shared_ptr hybridObject = ReactNativeVideoDrm::ReactNativeVideoDrmAutolinking::createPluginManager(); + return hybridObject; + } + ); +} + +@end diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.swift b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.swift new file mode 100644 index 00000000..f654b80e --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrmAutolinking.swift @@ -0,0 +1,25 @@ +/// +/// ReactNativeVideoDrmAutolinking.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +public final class ReactNativeVideoDrmAutolinking { + public typealias bridge = margelo.nitro.videodrm.bridge.swift + + /** + * Creates an instance of a Swift class that implements `HybridPluginManagerSpec`, + * and wraps it in a Swift class that can directly interop with C++ (`HybridPluginManagerSpec_cxx`) + * + * This is generated by Nitrogen and will initialize the class specified + * in the `"autolinking"` property of `nitro.json` (in this case, `PluginManager`). + */ + public static func createPluginManager() -> bridge.std__shared_ptr_HybridPluginManagerSpec_ { + let hybridObject = PluginManager() + return { () -> bridge.std__shared_ptr_HybridPluginManagerSpec_ in + let __cxxWrapped = hybridObject.getCxxWrapper() + return __cxxWrapped.getCxxPart() + }() + } +} diff --git a/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.cpp b/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.cpp new file mode 100644 index 00000000..609dc66a --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.cpp @@ -0,0 +1,11 @@ +/// +/// HybridPluginManagerSpecSwift.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#include "HybridPluginManagerSpecSwift.hpp" + +namespace margelo::nitro::videodrm { +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.hpp b/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.hpp new file mode 100644 index 00000000..595efbc7 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/c++/HybridPluginManagerSpecSwift.hpp @@ -0,0 +1,79 @@ +/// +/// HybridPluginManagerSpecSwift.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#include "HybridPluginManagerSpec.hpp" + +// Forward declaration of `HybridPluginManagerSpec_cxx` to properly resolve imports. +namespace ReactNativeVideoDrm { class HybridPluginManagerSpec_cxx; } + + + + + +#include "ReactNativeVideoDrm-Swift-Cxx-Umbrella.hpp" + +namespace margelo::nitro::videodrm { + + /** + * The C++ part of HybridPluginManagerSpec_cxx.swift. + * + * HybridPluginManagerSpecSwift (C++) accesses HybridPluginManagerSpec_cxx (Swift), and might + * contain some additional bridging code for C++ <> Swift interop. + * + * Since this obviously introduces an overhead, I hope at some point in + * the future, HybridPluginManagerSpec_cxx can directly inherit from the C++ class HybridPluginManagerSpec + * to simplify the whole structure and memory management. + */ + class HybridPluginManagerSpecSwift: public virtual HybridPluginManagerSpec { + public: + // Constructor from a Swift instance + explicit HybridPluginManagerSpecSwift(const ReactNativeVideoDrm::HybridPluginManagerSpec_cxx& swiftPart): + HybridObject(HybridPluginManagerSpec::TAG), + _swiftPart(swiftPart) { } + + public: + // Get the Swift part + inline ReactNativeVideoDrm::HybridPluginManagerSpec_cxx& getSwiftPart() noexcept { + return _swiftPart; + } + + public: + inline size_t getExternalMemorySize() noexcept override { + return _swiftPart.getMemorySize(); + } + void dispose() noexcept override { + _swiftPart.dispose(); + } + + public: + // Properties + inline bool getIsEnabled() noexcept override { + return _swiftPart.isEnabled(); + } + + public: + // Methods + inline void enable() override { + auto __result = _swiftPart.enable(); + if (__result.hasError()) [[unlikely]] { + std::rethrow_exception(__result.error()); + } + } + inline void disable() override { + auto __result = _swiftPart.disable(); + if (__result.hasError()) [[unlikely]] { + std::rethrow_exception(__result.error()); + } + } + + private: + ReactNativeVideoDrm::HybridPluginManagerSpec_cxx _swiftPart; + }; + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec.swift b/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec.swift new file mode 100644 index 00000000..46f5983b --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec.swift @@ -0,0 +1,50 @@ +/// +/// HybridPluginManagerSpec.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import Foundation +import NitroModules + +/// See ``HybridPluginManagerSpec`` +public protocol HybridPluginManagerSpec_protocol: HybridObject { + // Properties + var isEnabled: Bool { get } + + // Methods + func enable() throws -> Void + func disable() throws -> Void +} + +/// See ``HybridPluginManagerSpec`` +open class HybridPluginManagerSpec_base { + private weak var cxxWrapper: HybridPluginManagerSpec_cxx? = nil + public init() { } + public func getCxxWrapper() -> HybridPluginManagerSpec_cxx { + #if DEBUG + guard self is HybridPluginManagerSpec else { + fatalError("`self` is not a `HybridPluginManagerSpec`! Did you accidentally inherit from `HybridPluginManagerSpec_base` instead of `HybridPluginManagerSpec`?") + } + #endif + if let cxxWrapper = self.cxxWrapper { + return cxxWrapper + } else { + let cxxWrapper = HybridPluginManagerSpec_cxx(self as! HybridPluginManagerSpec) + self.cxxWrapper = cxxWrapper + return cxxWrapper + } + } +} + +/** + * A Swift base-protocol representing the PluginManager HybridObject. + * Implement this protocol to create Swift-based instances of PluginManager. + * ```swift + * class HybridPluginManager : HybridPluginManagerSpec { + * // ... + * } + * ``` + */ +public typealias HybridPluginManagerSpec = HybridPluginManagerSpec_protocol & HybridPluginManagerSpec_base diff --git a/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec_cxx.swift b/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec_cxx.swift new file mode 100644 index 00000000..5357d15b --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/ios/swift/HybridPluginManagerSpec_cxx.swift @@ -0,0 +1,138 @@ +/// +/// HybridPluginManagerSpec_cxx.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import Foundation +import NitroModules + +/** + * A class implementation that bridges HybridPluginManagerSpec over to C++. + * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. + * + * Also, some Swift types need to be bridged with special handling: + * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) + * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper + * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ + */ +open class HybridPluginManagerSpec_cxx { + /** + * The Swift <> C++ bridge's namespace (`margelo::nitro::videodrm::bridge::swift`) + * from `ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp`. + * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. + */ + public typealias bridge = margelo.nitro.videodrm.bridge.swift + + /** + * Holds an instance of the `HybridPluginManagerSpec` Swift protocol. + */ + private var __implementation: any HybridPluginManagerSpec + + /** + * Holds a weak pointer to the C++ class that wraps the Swift class. + */ + private var __cxxPart: bridge.std__weak_ptr_HybridPluginManagerSpec_ + + /** + * Create a new `HybridPluginManagerSpec_cxx` that wraps the given `HybridPluginManagerSpec`. + * All properties and methods bridge to C++ types. + */ + public init(_ implementation: any HybridPluginManagerSpec) { + self.__implementation = implementation + self.__cxxPart = .init() + /* no base class */ + } + + /** + * Get the actual `HybridPluginManagerSpec` instance this class wraps. + */ + @inline(__always) + public func getHybridPluginManagerSpec() -> any HybridPluginManagerSpec { + return __implementation + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `HybridPluginManagerSpec_cxx`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridPluginManagerSpec_cxx { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } + + /** + * Gets (or creates) the C++ part of this Hybrid Object. + * The C++ part is a `std::shared_ptr`. + */ + public func getCxxPart() -> bridge.std__shared_ptr_HybridPluginManagerSpec_ { + let cachedCxxPart = self.__cxxPart.lock() + if cachedCxxPart.__convertToBool() { + return cachedCxxPart + } else { + let newCxxPart = bridge.create_std__shared_ptr_HybridPluginManagerSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridPluginManagerSpec_(newCxxPart) + return newCxxPart + } + } + + + + /** + * Get the memory size of the Swift class (plus size of any other allocations) + * so the JS VM can properly track it and garbage-collect the JS object if needed. + */ + @inline(__always) + public var memorySize: Int { + return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize + } + + /** + * Call dispose() on the Swift class. + * This _may_ be called manually from JS. + */ + @inline(__always) + public func dispose() { + self.__implementation.dispose() + } + + // Properties + public final var isEnabled: Bool { + @inline(__always) + get { + return self.__implementation.isEnabled + } + } + + // Methods + @inline(__always) + public final func enable() -> bridge.Result_void_ { + do { + try self.__implementation.enable() + return bridge.create_Result_void_() + } catch (let __error) { + let __exceptionPtr = __error.toCpp() + return bridge.create_Result_void_(__exceptionPtr) + } + } + + @inline(__always) + public final func disable() -> bridge.Result_void_ { + do { + try self.__implementation.disable() + return bridge.create_Result_void_() + } catch (let __error) { + let __exceptionPtr = __error.toCpp() + return bridge.create_Result_void_(__exceptionPtr) + } + } +} diff --git a/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.cpp b/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.cpp new file mode 100644 index 00000000..740348ab --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.cpp @@ -0,0 +1,23 @@ +/// +/// HybridPluginManagerSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#include "HybridPluginManagerSpec.hpp" + +namespace margelo::nitro::videodrm { + + void HybridPluginManagerSpec::loadHybridMethods() { + // load base methods/properties + HybridObject::loadHybridMethods(); + // load custom methods/properties + registerHybrids(this, [](Prototype& prototype) { + prototype.registerHybridGetter("isEnabled", &HybridPluginManagerSpec::getIsEnabled); + prototype.registerHybridMethod("enable", &HybridPluginManagerSpec::enable); + prototype.registerHybridMethod("disable", &HybridPluginManagerSpec::disable); + }); + } + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.hpp b/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.hpp new file mode 100644 index 00000000..20c5ff43 --- /dev/null +++ b/packages/drm-plugin/nitrogen/generated/shared/c++/HybridPluginManagerSpec.hpp @@ -0,0 +1,63 @@ +/// +/// HybridPluginManagerSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + + + + + +namespace margelo::nitro::videodrm { + + using namespace margelo::nitro; + + /** + * An abstract base class for `PluginManager` + * Inherit this class to create instances of `HybridPluginManagerSpec` in C++. + * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. + * @example + * ```cpp + * class HybridPluginManager: public HybridPluginManagerSpec { + * public: + * HybridPluginManager(...): HybridObject(TAG) { ... } + * // ... + * }; + * ``` + */ + class HybridPluginManagerSpec: public virtual HybridObject { + public: + // Constructor + explicit HybridPluginManagerSpec(): HybridObject(TAG) { } + + // Destructor + ~HybridPluginManagerSpec() override = default; + + public: + // Properties + virtual bool getIsEnabled() = 0; + + public: + // Methods + virtual void enable() = 0; + virtual void disable() = 0; + + protected: + // Hybrid Setup + void loadHybridMethods() override; + + protected: + // Tag for logging + static constexpr auto TAG = "PluginManager"; + }; + +} // namespace margelo::nitro::videodrm diff --git a/packages/drm-plugin/package.json b/packages/drm-plugin/package.json new file mode 100644 index 00000000..c767fa50 --- /dev/null +++ b/packages/drm-plugin/package.json @@ -0,0 +1,133 @@ +{ + "name": "@twg/react-native-video-drm", + "version": "0.1.0", + "description": "DRM plugin for react-native-video", + "main": "./lib/module/index.js", + "types": "./lib/typescript/src/index.d.ts", + "exports": { + ".": { + "source": "./src/index.tsx", + "types": "./lib/typescript/src/index.d.ts", + "default": "./lib/module/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "src", + "lib", + "android", + "ios", + "cpp", + "nitrogen", + "nitro.json", + "*.podspec", + "react-native.config.js", + "!ios/build", + "!android/build", + "!android/gradle", + "!android/gradlew", + "!android/gradlew.bat", + "!android/local.properties", + "!**/__tests__", + "!**/__fixtures__", + "!**/__mocks__", + "!**/.*" + ], + "scripts": { + "test": "jest", + "typecheck": "tsc", + "lint": "eslint \"**/*.{js,ts,tsx}\"", + "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", + "prepare": "bun run build", + "build": "bob build", + "specs": "nitro-codegen", + "release": "release-it --only-version" + }, + "keywords": [ + "react-native", + "react-native-video", + "drm", + "ios", + "android" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/TheWidlarzGroup/react-native-video.git" + }, + "author": "TheWidlarzGroup (https://github.com/TheWidlarzGroup)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TheWidlarzGroup/react-native-video/issues" + }, + "homepage": "https://github.com/TheWidlarzGroup/react-native-video#readme", + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "devDependencies": { + "@react-native/babel-preset": "0.79.2", + "@release-it/conventional-changelog": "^9.0.2", + "@types/react": "^18.3.0", + "del-cli": "^5.1.0", + "eslint": "^8.51.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-prettier": "^5.0.1", + "nitro-codegen": "^0.28.0", + "prettier": "^3.0.3", + "react": "18.3.1", + "react-native": "^0.77.0", + "react-native-builder-bob": "^0.40.13", + "react-native-nitro-modules": "^0.28.0", + "release-it": "^17.10.0", + "typescript": "^5.8.3", + "react-native-video": "*" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-video": ">=7.0.0-alpha.3", + "react-native-nitro-modules": ">=0.27.2" + }, + "jest": { + "preset": "react-native", + "modulePathIgnorePatterns": [ + "/example/node_modules", + "/lib/" + ] + }, + "release-it": { + "git": false, + "npm": { + "publish": true + }, + "github": { + "release": false + }, + "hooks": { + "before:init": "bun typecheck && bun lint", + "after:bump": "bun run build && cp ../../LICENSE ./LICENSE" + } + }, + "react-native-builder-bob": { + "source": "src", + "output": "lib", + "targets": [ + [ + "module", + { + "esm": true + } + ], + [ + "typescript", + { + "project": "tsconfig.build.json" + } + ] + ] + }, + "create-react-native-library": { + "languages": "kotlin-swift", + "type": "nitro-module", + "version": "0.52.0" + } +} diff --git a/packages/drm-plugin/src/PluginManager.nitro.ts b/packages/drm-plugin/src/PluginManager.nitro.ts new file mode 100644 index 00000000..343e692a --- /dev/null +++ b/packages/drm-plugin/src/PluginManager.nitro.ts @@ -0,0 +1,8 @@ +import type { HybridObject } from 'react-native-nitro-modules'; + +export interface PluginManager + extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> { + enable(): void; + disable(): void; + readonly isEnabled: boolean; +} diff --git a/packages/drm-plugin/src/index.tsx b/packages/drm-plugin/src/index.tsx new file mode 100644 index 00000000..fc210aa3 --- /dev/null +++ b/packages/drm-plugin/src/index.tsx @@ -0,0 +1,15 @@ +import { NitroModules } from 'react-native-nitro-modules'; +import type { PluginManager as PluginManagerSpec } from './PluginManager.nitro'; + +const PluginManager = + NitroModules.createHybridObject('PluginManager'); + +export function enable() { + return PluginManager.enable(); +} + +export function disable() { + return PluginManager.disable(); +} + +export const isEnabled: boolean = PluginManager.isEnabled; diff --git a/packages/drm-plugin/tsconfig.build.json b/packages/drm-plugin/tsconfig.build.json new file mode 100644 index 00000000..3c0636ad --- /dev/null +++ b/packages/drm-plugin/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig", + "exclude": ["example", "lib"] +} diff --git a/packages/drm-plugin/tsconfig.json b/packages/drm-plugin/tsconfig.json new file mode 100644 index 00000000..ac14d7a3 --- /dev/null +++ b/packages/drm-plugin/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "rootDir": ".", + "paths": { + "react-native-video-drm": ["./src/index"] + }, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react-jsx", + "lib": ["ESNext"], + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noStrictGenericChecks": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "target": "ESNext", + "verbatimModuleSyntax": true + } +} diff --git a/packages/react-native-video/.eslintrc.js b/packages/react-native-video/.eslintrc.js index 677031a9..56aa5e85 100644 --- a/packages/react-native-video/.eslintrc.js +++ b/packages/react-native-video/.eslintrc.js @@ -1,8 +1,8 @@ module.exports = { root: true, - extends: ["@react-native", "../../config/.eslintrc.js"], - parserOptions: { - tsconfigRootDir: __dirname, - project: true, - }, -} + extends: ["../../config/.eslintrc.js"], + parserOptions: { + tsconfigRootDir: __dirname, + project: true, + }, +}; diff --git a/packages/react-native-video/android/src/main/java/com/video/core/player/DRMManagerSpec.kt b/packages/react-native-video/android/src/main/java/com/video/core/player/DRMManagerSpec.kt new file mode 100644 index 00000000..3fef5404 --- /dev/null +++ b/packages/react-native-video/android/src/main/java/com/video/core/player/DRMManagerSpec.kt @@ -0,0 +1,23 @@ +package com.video.core.player + +import androidx.annotation.OptIn +import androidx.media3.common.MediaItem +import androidx.media3.common.util.UnstableApi +import androidx.media3.common.util.Util +import androidx.media3.exoplayer.drm.DrmSessionManager +import com.margelo.nitro.video.NativeDrmParams +import java.util.UUID + +@OptIn(UnstableApi::class) +interface DRMManagerSpec { + fun buildDrmSessionManager(drmParams: NativeDrmParams): DrmSessionManager { + val drmScheme = drmParams.type ?: "widevine" + val drmUuid = Util.getDrmUuid(drmScheme) + + return buildDrmSessionManager(drmParams, drmUuid) + } + + fun buildDrmSessionManager(drmParams: NativeDrmParams, drmUuid: UUID?, retryCount: Int = 0): DrmSessionManager + + fun getDRMConfiguration(drmParams: NativeDrmParams): MediaItem.DrmConfiguration +} \ No newline at end of file diff --git a/packages/react-native-video/android/src/main/java/com/video/core/player/DataSourceFactoryUtils.kt b/packages/react-native-video/android/src/main/java/com/video/core/player/DataSourceFactoryUtils.kt index 986a39d6..fdfedd9a 100644 --- a/packages/react-native-video/android/src/main/java/com/video/core/player/DataSourceFactoryUtils.kt +++ b/packages/react-native-video/android/src/main/java/com/video/core/player/DataSourceFactoryUtils.kt @@ -10,7 +10,6 @@ import com.facebook.react.bridge.ReactContext import com.facebook.react.modules.network.CookieJarContainer import com.facebook.react.modules.network.ForwardingCookieHandler import com.facebook.react.modules.network.OkHttpClientProvider -import com.margelo.nitro.video.HybridVideoPlayerSource import com.margelo.nitro.video.HybridVideoPlayerSourceSpec import okhttp3.JavaNetCookieJar diff --git a/packages/react-native-video/android/src/main/java/com/video/core/player/MediaItemUtils.kt b/packages/react-native-video/android/src/main/java/com/video/core/player/MediaItemUtils.kt index 559e0276..ec13bd50 100644 --- a/packages/react-native-video/android/src/main/java/com/video/core/player/MediaItemUtils.kt +++ b/packages/react-native-video/android/src/main/java/com/video/core/player/MediaItemUtils.kt @@ -9,8 +9,10 @@ import androidx.media3.common.C import androidx.media3.common.MimeTypes import androidx.media3.common.util.UnstableApi import com.margelo.nitro.video.HybridVideoPlayerSource +import com.margelo.nitro.video.NativeDrmParams import com.margelo.nitro.video.NativeVideoConfig import com.margelo.nitro.video.SubtitleType +import com.video.core.LibraryError import com.video.core.SourceError import com.video.core.extensions.toStringExtension import com.video.core.plugins.PluginsRegistry @@ -25,6 +27,12 @@ fun createMediaItemFromVideoConfig( mediaItemBuilder.setUri(source.config.uri) + source.config.drm?.let { drmParams -> + val drmManager = source.drmManager ?: throw LibraryError.DRMPluginNotFound + val drmConfiguration = drmManager.getDRMConfiguration(drmParams) + mediaItemBuilder.setDrmConfiguration(drmConfiguration) + } + return PluginsRegistry.shared.overrideMediaItemBuilder( source, mediaItemBuilder diff --git a/packages/react-native-video/android/src/main/java/com/video/core/player/MediaSourceUtils.kt b/packages/react-native-video/android/src/main/java/com/video/core/player/MediaSourceUtils.kt index 1d34b0f8..5d198715 100644 --- a/packages/react-native-video/android/src/main/java/com/video/core/player/MediaSourceUtils.kt +++ b/packages/react-native-video/android/src/main/java/com/video/core/player/MediaSourceUtils.kt @@ -11,10 +11,12 @@ import androidx.media3.common.C import androidx.media3.common.MediaItem import androidx.media3.common.util.UnstableApi import androidx.media3.exoplayer.dash.DashMediaSource +import androidx.media3.exoplayer.drm.DrmSessionManager import androidx.media3.exoplayer.hls.HlsMediaSource import androidx.media3.exoplayer.source.DefaultMediaSourceFactory import androidx.media3.exoplayer.source.MergingMediaSource import com.margelo.nitro.video.HybridVideoPlayerSource +import com.video.core.LibraryError import com.video.core.SourceError import com.video.core.plugins.PluginsRegistry @@ -52,6 +54,11 @@ fun buildMediaSource(context: Context, source: HybridVideoPlayerSource, mediaIte } } + source.config.drm?.let { + val drmSessionManager = source.drmSessionManager ?: throw LibraryError.DRMPluginNotFound + mediaSourceFactory.setDrmSessionManagerProvider { drmSessionManager } + } + return PluginsRegistry.shared.overrideMediaSourceFactory( source, mediaSourceFactory, @@ -66,23 +73,36 @@ fun buildExternalSubtitlesMediaSource(context: Context, source: HybridVideoPlaye buildBaseDataSourceFactory(context, source) ) - val mediaItemBuilder = MediaItem.Builder() + val mediaItemBuilderWithSubtitles = MediaItem.Builder() .setUri(source.uri.toUri()) .setSubtitleConfigurations(getSubtitlesConfiguration(source.config)) - val mediaItem = PluginsRegistry.shared.overrideMediaItemBuilder( + val mediaItemBuilder = PluginsRegistry.shared.overrideMediaItemBuilder( source, - mediaItemBuilder - ).build() + mediaItemBuilderWithSubtitles + ) val mediaSourceFactory = DefaultMediaSourceFactory(context) .setDataSourceFactory(dataSourceFactory) + if (source.config.drm != null) { + if (source.drmManager == null) { + throw LibraryError.DRMPluginNotFound + } + + mediaSourceFactory.setDrmSessionManagerProvider { + source.drmManager as DrmSessionManager + } + + val drmConfiguration = source.drmManager!!.getDRMConfiguration(source.config.drm!!) + mediaItemBuilder.setDrmConfiguration(drmConfiguration) + } + return PluginsRegistry.shared.overrideMediaSourceFactory( source, mediaSourceFactory, dataSourceFactory - ).createMediaSource(mediaItem) + ).createMediaSource(mediaItemBuilder.build()) } diff --git a/packages/react-native-video/android/src/main/java/com/video/core/plugins/PluginsRegistry.kt b/packages/react-native-video/android/src/main/java/com/video/core/plugins/PluginsRegistry.kt index db62cd2c..c4471794 100644 --- a/packages/react-native-video/android/src/main/java/com/video/core/plugins/PluginsRegistry.kt +++ b/packages/react-native-video/android/src/main/java/com/video/core/plugins/PluginsRegistry.kt @@ -10,6 +10,7 @@ import com.margelo.nitro.video.HybridVideoPlayer import com.margelo.nitro.video.HybridVideoPlayerSource import com.video.BuildConfig import com.video.core.LibraryError +import com.video.core.player.DRMManagerSpec import com.video.view.VideoView import java.lang.ref.WeakReference @@ -108,14 +109,13 @@ class PluginsRegistry { return overriddenSource } - // TODO: Update type once DRM will be implemented /** * Returns the DRM manager instance from the plugins. * * @throws LibraryError.DRMPluginNotFound If no DRM manager is found. * @return Any */ - internal fun getDRMManager(source: NativeVideoPlayerSource): Any { + internal fun getDRMManager(source: NativeVideoPlayerSource): DRMManagerSpec { for (plugin in plugins.values) { val manager = plugin.getDRMManager(source) diff --git a/packages/react-native-video/android/src/main/java/com/video/core/plugins/ReactNativeVideoPlugin.kt b/packages/react-native-video/android/src/main/java/com/video/core/plugins/ReactNativeVideoPlugin.kt index 965a0e43..3e7e402a 100644 --- a/packages/react-native-video/android/src/main/java/com/video/core/plugins/ReactNativeVideoPlugin.kt +++ b/packages/react-native-video/android/src/main/java/com/video/core/plugins/ReactNativeVideoPlugin.kt @@ -4,6 +4,7 @@ import androidx.media3.common.MediaItem import androidx.media3.common.util.UnstableApi import androidx.media3.datasource.DataSource import androidx.media3.exoplayer.source.MediaSource +import com.video.core.player.DRMManagerSpec import com.video.view.VideoView import java.lang.ref.WeakReference @@ -64,7 +65,7 @@ interface ReactNativeVideoPluginSpec { * * @return The DRM manager instance. */ - fun getDRMManager(source: NativeVideoPlayerSource): Any? + fun getDRMManager(source: NativeVideoPlayerSource): DRMManagerSpec? /** @@ -142,7 +143,7 @@ open class ReactNativeVideoPlugin(override val name: String) : ReactNativeVideoP return source } - override fun getDRMManager(source: NativeVideoPlayerSource): Any? { return null } + override fun getDRMManager(source: NativeVideoPlayerSource): DRMManagerSpec? { return null } override fun getMediaDataSourceFactory( source: NativeVideoPlayerSource, diff --git a/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSource.kt b/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSource.kt index c9377b0b..88009692 100644 --- a/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSource.kt +++ b/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSource.kt @@ -1,18 +1,18 @@ package com.margelo.nitro.video -import android.content.Context import androidx.media3.common.MediaItem +import androidx.media3.common.util.UnstableApi +import androidx.media3.exoplayer.drm.DrmSessionManager import androidx.media3.exoplayer.source.MediaSource -import com.facebook.proguard.annotations.DoNotStrip import com.margelo.nitro.NitroModules import com.margelo.nitro.core.Promise import com.video.core.LibraryError +import com.video.core.player.DRMManagerSpec import com.video.core.player.buildMediaSource import com.video.core.player.createMediaItemFromVideoConfig import com.video.core.plugins.PluginsRegistry import com.video.core.utils.VideoInformationUtils -@DoNotStrip class HybridVideoPlayerSource(): HybridVideoPlayerSourceSpec() { override lateinit var uri: String override lateinit var config: NativeVideoConfig @@ -20,12 +20,22 @@ class HybridVideoPlayerSource(): HybridVideoPlayerSourceSpec() { private lateinit var mediaItem: MediaItem lateinit var mediaSource: MediaSource + var drmManager: DRMManagerSpec? = null + + @UnstableApi + var drmSessionManager: DrmSessionManager? = null + constructor(config: NativeVideoConfig) : this() { this.uri = config.uri this.config = config val overriddenSource = PluginsRegistry.shared.overrideSource(this) + config.drm?.let { + drmManager = PluginsRegistry.shared.getDRMManager(this) + drmSessionManager = drmManager?.buildDrmSessionManager(it) + } + this.mediaItem = createMediaItemFromVideoConfig( overriddenSource ) diff --git a/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSourceFactory.kt b/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSourceFactory.kt index 25f924df..7adcd27e 100644 --- a/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSourceFactory.kt +++ b/packages/react-native-video/android/src/main/java/com/video/hybrids/videoplayersource/HybridVideoPlayerSourceFactory.kt @@ -5,7 +5,7 @@ import com.facebook.proguard.annotations.DoNotStrip @DoNotStrip class HybridVideoPlayerSourceFactory: HybridVideoPlayerSourceFactorySpec() { override fun fromUri(uri: String): HybridVideoPlayerSourceSpec { - val config = NativeVideoConfig(uri, null, null) + val config = NativeVideoConfig(uri, null, null, null) return HybridVideoPlayerSource(config) } diff --git a/packages/react-native-video/ios/core/Plugins/PluginsRegistry.swift b/packages/react-native-video/ios/core/Plugins/PluginsRegistry.swift index 6e2ed6a5..2b712a2c 100644 --- a/packages/react-native-video/ios/core/Plugins/PluginsRegistry.swift +++ b/packages/react-native-video/ios/core/Plugins/PluginsRegistry.swift @@ -52,10 +52,9 @@ public final class PluginsRegistry { return plugins.contains { $0.value.id == plugin.id } } - // TODO: Replace `Any` with a specific DRM manager type when created - internal func getDrmManager(source: NativeVideoPlayerSource) async throws -> Any? { + internal func getDrmManager(source: NativeVideoPlayerSource) throws -> DRMManagerSpec? { for plugin in plugins.values { - if let drmManager = await plugin.getDRMManager(source: source) { + if let drmManager = plugin.getDRMManager(source: source) { return drmManager } } diff --git a/packages/react-native-video/ios/core/Plugins/ReactNativeVideoPlugin.swift b/packages/react-native-video/ios/core/Plugins/ReactNativeVideoPlugin.swift index 65a31fc9..24a111e9 100644 --- a/packages/react-native-video/ios/core/Plugins/ReactNativeVideoPlugin.swift +++ b/packages/react-native-video/ios/core/Plugins/ReactNativeVideoPlugin.swift @@ -61,7 +61,7 @@ public protocol ReactNativeVideoPluginSpec { * @param source The source instance. * @return The DRM manager instance. */ - func getDRMManager(source: NativeVideoPlayerSource) async -> Any? + func getDRMManager(source: NativeVideoPlayerSource) -> DRMManagerSpec? } open class ReactNativeVideoPlugin: ReactNativeVideoPluginSpec { @@ -85,7 +85,7 @@ open class ReactNativeVideoPlugin: ReactNativeVideoPluginSpec { return source } - open func getDRMManager(source: NativeVideoPlayerSource) async -> Any? { + open func getDRMManager(source: NativeVideoPlayerSource) -> DRMManagerSpec? { return nil } } diff --git a/packages/react-native-video/ios/core/Spec/DRMManagerSpec.swift b/packages/react-native-video/ios/core/Spec/DRMManagerSpec.swift new file mode 100644 index 00000000..105703b5 --- /dev/null +++ b/packages/react-native-video/ios/core/Spec/DRMManagerSpec.swift @@ -0,0 +1,14 @@ +// +// DRMManagerSpec.swift +// ReactNativeVideo +// +// Created by Krzysztof Moch on 05/08/2025. +// + +import Foundation +import AVFoundation + +public protocol DRMManagerSpec: AVContentKeySessionDelegate { + /// Creates a content key request for the given asset and DRM parameters. + func createContentKeyRequest(for asset: AVURLAsset, drmParams: NativeDrmParams) throws +} diff --git a/packages/react-native-video/ios/core/Utils/ExternalSubtitlesUtils.swift b/packages/react-native-video/ios/core/Utils/ExternalSubtitlesUtils.swift index f8dd50e2..ab175d11 100644 --- a/packages/react-native-video/ios/core/Utils/ExternalSubtitlesUtils.swift +++ b/packages/react-native-video/ios/core/Utils/ExternalSubtitlesUtils.swift @@ -34,37 +34,32 @@ enum ExternalSubtitlesUtils { let textTracks = subtitlesAssets?.flatMap { $0.tracks(withMediaType: .text) } ?? [] - guard - let videoTrack = mainVideoTracks.first(where: { $0.mediaType == .video } - ), - let audioTrack = mainAudioTracks.first(where: { $0.mediaType == .audio } - ) - else { - throw PlayerError.invalidSource.error() - } - let composition = AVMutableComposition() - if let compositionVideoTrack = composition.addMutableTrack( - withMediaType: .video, - preferredTrackID: kCMPersistentTrackID_Invalid - ) { - try compositionVideoTrack.insertTimeRange( - CMTimeRange(start: .zero, duration: videoTrack.timeRange.duration), - of: videoTrack, - at: .zero - ) + if let videoTrack = mainVideoTracks.first(where: { $0.mediaType == .video }){ + if let compositionVideoTrack = composition.addMutableTrack( + withMediaType: .video, + preferredTrackID: kCMPersistentTrackID_Invalid + ) { + try compositionVideoTrack.insertTimeRange( + CMTimeRange(start: .zero, duration: videoTrack.timeRange.duration), + of: videoTrack, + at: .zero + ) + } } - if let compositionAudioTrack = composition.addMutableTrack( - withMediaType: .audio, - preferredTrackID: kCMPersistentTrackID_Invalid - ) { - try compositionAudioTrack.insertTimeRange( - CMTimeRange(start: .zero, duration: audioTrack.timeRange.duration), - of: audioTrack, - at: .zero - ) + if let audioTrack = mainAudioTracks.first(where: { $0.mediaType == .audio }) { + if let compositionAudioTrack = composition.addMutableTrack( + withMediaType: .audio, + preferredTrackID: kCMPersistentTrackID_Invalid + ) { + try compositionAudioTrack.insertTimeRange( + CMTimeRange(start: .zero, duration: audioTrack.timeRange.duration), + of: audioTrack, + at: .zero + ) + } } for textTrack in textTracks { @@ -73,7 +68,7 @@ enum ExternalSubtitlesUtils { preferredTrackID: kCMPersistentTrackID_Invalid ) { try compositionTextTrack.insertTimeRange( - CMTimeRange(start: .zero, duration: videoTrack.timeRange.duration), + CMTimeRange(start: .zero, duration: textTrack.timeRange.duration), of: textTrack, at: .zero ) diff --git a/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSource.swift b/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSource.swift index 98ffd8ed..5f318453 100644 --- a/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSource.swift +++ b/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSource.swift @@ -14,6 +14,8 @@ class HybridVideoPlayerSource: HybridVideoPlayerSourceSpec, NativeVideoPlayerSou var uri: String var config: NativeVideoConfig + var drmManager: DRMManagerSpec? + let url: URL init(config: NativeVideoConfig) throws { @@ -25,6 +27,14 @@ class HybridVideoPlayerSource: HybridVideoPlayerSourceSpec, NativeVideoPlayerSou } self.url = url + + super.init() + + if config.drm != nil { + // Try to get the DRM manager + // If no DRM manager is found, it will throw an error + _ = try PluginsRegistry.shared.getDrmManager(source: self) + } } deinit { @@ -80,6 +90,20 @@ class HybridVideoPlayerSource: HybridVideoPlayerSourceSpec, NativeVideoPlayerSou throw SourceError.failedToInitializeAsset.error() } + if let drmParams = config.drm { + drmManager = try PluginsRegistry.shared.getDrmManager(source: self) + + guard let drmManager else { + throw LibraryError.DRMPluginNotFound.error() + } + + do { + try drmManager.createContentKeyRequest(for: asset, drmParams: drmParams) + } catch { + print("[ReactNativeVideo] Failed to create content key request for DRM: \(drmParams)") + } + } + // Code browned from expo-video https://github.com/expo/expo/blob/ea17c9b1ce5111e1454b089ba381f3feb93f33cc/packages/expo-video/ios/VideoPlayerItem.swift#L40C30-L40C73 // If we don't load those properties, they will be loaded on main thread causing lags _ = try? await asset.load(.duration, .preferredTransform, .isPlayable) as Any diff --git a/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift b/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift index eed77695..11629175 100644 --- a/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift +++ b/packages/react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift @@ -13,7 +13,7 @@ class HybridVideoPlayerSourceFactory: HybridVideoPlayerSourceFactorySpec { } func fromUri(uri: String) throws -> HybridVideoPlayerSourceSpec { - let config = NativeVideoConfig(uri: uri, externalSubtitles: nil, headers: nil) + let config = NativeVideoConfig(uri: uri, externalSubtitles: nil, drm: nil, headers: nil) return try HybridVideoPlayerSource(config: config) } } diff --git a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp index ab0d614d..239d6812 100644 --- a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp +++ b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp @@ -32,10 +32,10 @@ #include "JFunc_void_onVolumeChangeData.hpp" #include "JFunc_void_VideoPlayerStatus.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" +#include "JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp" #include "JHybridVideoPlayerSourceFactorySpec.hpp" #include "JHybridVideoViewViewManagerSpec.hpp" #include "JHybridVideoViewViewManagerFactorySpec.hpp" -#include #include namespace margelo::nitro::video { @@ -64,6 +64,7 @@ int initialize(JavaVM* vm) { margelo::nitro::video::JFunc_void_onVolumeChangeData_cxx::registerNatives(); margelo::nitro::video::JFunc_void_VideoPlayerStatus_cxx::registerNatives(); margelo::nitro::video::JHybridVideoPlayerSourceSpec::registerNatives(); + margelo::nitro::video::JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx::registerNatives(); margelo::nitro::video::JHybridVideoPlayerSourceFactorySpec::registerNatives(); margelo::nitro::video::JHybridVideoViewViewManagerSpec::registerNatives(); margelo::nitro::video::JHybridVideoViewViewManagerFactorySpec::registerNatives(); @@ -75,7 +76,7 @@ int initialize(JavaVM* vm) { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoPlayerFactory"); auto instance = object.create(); auto globalRef = jni::make_global(instance); - return JNISharedPtr::make_shared_from_jni(globalRef); + return globalRef->cthis()->shared(); } ); HybridObjectRegistry::registerHybridObjectConstructor( @@ -84,7 +85,7 @@ int initialize(JavaVM* vm) { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoPlayerSourceFactory"); auto instance = object.create(); auto globalRef = jni::make_global(instance); - return JNISharedPtr::make_shared_from_jni(globalRef); + return globalRef->cthis()->shared(); } ); HybridObjectRegistry::registerHybridObjectConstructor( @@ -93,7 +94,7 @@ int initialize(JavaVM* vm) { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoViewViewManagerFactory"); auto instance = object.create(); auto globalRef = jni::make_global(instance); - return JNISharedPtr::make_shared_from_jni(globalRef); + return globalRef->cthis()->shared(); } ); }); diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp new file mode 100644 index 00000000..be5e6d9b --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp @@ -0,0 +1,125 @@ +/// +/// JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include + +#include +#include +#include "OnGetLicensePayload.hpp" +#include +#include +#include "JOnGetLicensePayload.hpp" + +namespace margelo::nitro::video { + + using namespace facebook; + + /** + * Represents the Java/Kotlin callback `(payload: OnGetLicensePayload) -> Promise>`. + * This can be passed around between C++ and Java/Kotlin. + */ + struct JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload: public jni::JavaClass { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload;"; + + public: + /** + * Invokes the function this `JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload` instance holds through JNI. + */ + std::shared_ptr>>> invoke(const OnGetLicensePayload& payload) const { + static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* payload */)>("invoke"); + auto __result = method(self(), JOnGetLicensePayload::fromCpp(payload)); + return [&]() { + auto __promise = Promise>>::create(); + __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { + auto __result = jni::static_ref_cast(__boxedResult); + __promise->resolve([&]() { + auto __promise = Promise::create(); + __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { + auto __result = jni::static_ref_cast(__boxedResult); + __promise->resolve(__result->toStdString()); + }); + __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { + jni::JniException __jniError(__throwable); + __promise->reject(std::make_exception_ptr(__jniError)); + }); + return __promise; + }()); + }); + __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { + jni::JniException __jniError(__throwable); + __promise->reject(std::make_exception_ptr(__jniError)); + }); + return __promise; + }(); + } + }; + + /** + * An implementation of Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload that is backed by a C++ implementation (using `std::function<...>`) + */ + struct JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx final: public jni::HybridClass { + public: + static jni::local_ref fromCpp(const std::function>>>(const OnGetLicensePayload& /* payload */)>& func) { + return JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx::newObjectCxxArgs(func); + } + + public: + /** + * Invokes the C++ `std::function<...>` this `JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx` instance holds. + */ + jni::local_ref invoke_cxx(jni::alias_ref payload) { + std::shared_ptr>>> __result = _func(payload->toCpp()); + return [&]() { + jni::local_ref __localPromise = JPromise::create(); + jni::global_ref __promise = jni::make_global(__localPromise); + __result->addOnResolvedListener([=](const std::shared_ptr>& __result) { + __promise->cthis()->resolve([&]() { + jni::local_ref __localPromise = JPromise::create(); + jni::global_ref __promise = jni::make_global(__localPromise); + __result->addOnResolvedListener([=](const std::string& __result) { + __promise->cthis()->resolve(jni::make_jstring(__result)); + }); + __result->addOnRejectedListener([=](const std::exception_ptr& __error) { + auto __jniError = jni::getJavaExceptionForCppException(__error); + __promise->cthis()->reject(__jniError); + }); + return __localPromise; + }()); + }); + __result->addOnRejectedListener([=](const std::exception_ptr& __error) { + auto __jniError = jni::getJavaExceptionForCppException(__error); + __promise->cthis()->reject(__jniError); + }); + return __localPromise; + }(); + } + + public: + [[nodiscard]] + inline const std::function>>>(const OnGetLicensePayload& /* payload */)>& getFunction() const { + return _func; + } + + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx;"; + static void registerNatives() { + registerHybrid({makeNativeMethod("invoke_cxx", JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx::invoke_cxx)}); + } + + private: + explicit JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx(const std::function>>>(const OnGetLicensePayload& /* payload */)>& func): _func(func) { } + + private: + friend HybridBase; + std::function>>>(const OnGetLicensePayload& /* payload */)> _func; + }; + +} // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_bool.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_bool.hpp index 662eda55..aba55d48 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_bool.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_bool.hpp @@ -17,7 +17,7 @@ namespace margelo::nitro::video { using namespace facebook; /** - * Represents the Java/Kotlin callback `(fullscreen: Boolean) -> Unit`. + * Represents the Java/Kotlin callback `(isInPictureInPicture: Boolean) -> Unit`. * This can be passed around between C++ and Java/Kotlin. */ struct JFunc_void_bool: public jni::JavaClass { @@ -28,9 +28,9 @@ namespace margelo::nitro::video { /** * Invokes the function this `JFunc_void_bool` instance holds through JNI. */ - void invoke(bool fullscreen) const { - static const auto method = javaClassStatic()->getMethod("invoke"); - method(self(), fullscreen); + void invoke(bool isInPictureInPicture) const { + static const auto method = javaClassStatic()->getMethod("invoke"); + method(self(), isInPictureInPicture); } }; @@ -39,7 +39,7 @@ namespace margelo::nitro::video { */ struct JFunc_void_bool_cxx final: public jni::HybridClass { public: - static jni::local_ref fromCpp(const std::function& func) { + static jni::local_ref fromCpp(const std::function& func) { return JFunc_void_bool_cxx::newObjectCxxArgs(func); } @@ -47,13 +47,13 @@ namespace margelo::nitro::video { /** * Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds. */ - void invoke_cxx(jboolean fullscreen) { - _func(static_cast(fullscreen)); + void invoke_cxx(jboolean isInPictureInPicture) { + _func(static_cast(isInPictureInPicture)); } public: [[nodiscard]] - inline const std::function& getFunction() const { + inline const std::function& getFunction() const { return _func; } @@ -64,11 +64,11 @@ namespace margelo::nitro::video { } private: - explicit JFunc_void_bool_cxx(const std::function& func): _func(func) { } + explicit JFunc_void_bool_cxx(const std::function& func): _func(func) { } private: friend HybridBase; - std::function _func; + std::function _func; }; } // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_double.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_double.hpp index a0d071ad..653e2a01 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_double.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_double.hpp @@ -17,7 +17,7 @@ namespace margelo::nitro::video { using namespace facebook; /** - * Represents the Java/Kotlin callback `(seekTime: Double) -> Unit`. + * Represents the Java/Kotlin callback `(rate: Double) -> Unit`. * This can be passed around between C++ and Java/Kotlin. */ struct JFunc_void_double: public jni::JavaClass { @@ -28,9 +28,9 @@ namespace margelo::nitro::video { /** * Invokes the function this `JFunc_void_double` instance holds through JNI. */ - void invoke(double seekTime) const { - static const auto method = javaClassStatic()->getMethod("invoke"); - method(self(), seekTime); + void invoke(double rate) const { + static const auto method = javaClassStatic()->getMethod("invoke"); + method(self(), rate); } }; @@ -39,7 +39,7 @@ namespace margelo::nitro::video { */ struct JFunc_void_double_cxx final: public jni::HybridClass { public: - static jni::local_ref fromCpp(const std::function& func) { + static jni::local_ref fromCpp(const std::function& func) { return JFunc_void_double_cxx::newObjectCxxArgs(func); } @@ -47,13 +47,13 @@ namespace margelo::nitro::video { /** * Invokes the C++ `std::function<...>` this `JFunc_void_double_cxx` instance holds. */ - void invoke_cxx(double seekTime) { - _func(seekTime); + void invoke_cxx(double rate) { + _func(rate); } public: [[nodiscard]] - inline const std::function& getFunction() const { + inline const std::function& getFunction() const { return _func; } @@ -64,11 +64,11 @@ namespace margelo::nitro::video { } private: - explicit JFunc_void_double_cxx(const std::function& func): _func(func) { } + explicit JFunc_void_double_cxx(const std::function& func): _func(func) { } private: friend HybridBase; - std::function _func; + std::function _func; }; } // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_onLoadStartData.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_onLoadStartData.hpp index 8b359924..c59aac9f 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_onLoadStartData.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JFunc_void_onLoadStartData.hpp @@ -18,7 +18,6 @@ #include #include "HybridVideoPlayerSourceSpec.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" -#include namespace margelo::nitro::video { diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.cpp index f05f299f..ffe1f899 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.cpp @@ -54,7 +54,6 @@ namespace margelo::nitro::video { enum class VideoPlayerStatus; } #include #include "HybridVideoPlayerSourceSpec.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" -#include #include "onPlaybackStateChangeData.hpp" #include "JFunc_void_onPlaybackStateChangeData.hpp" #include "JonPlaybackStateChangeData.hpp" diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.hpp index 6c207737..589919d0 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoPlayerEventEmitterSpec(jni::alias_ref jThis) : HybridObject(HybridVideoPlayerEventEmitterSpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.cpp index 9446369c..5eeb9a9c 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.cpp @@ -15,7 +15,6 @@ namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; } #include #include "HybridVideoPlayerSpec.hpp" #include "JHybridVideoPlayerSpec.hpp" -#include #include "HybridVideoPlayerSourceSpec.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" @@ -45,10 +44,10 @@ namespace margelo::nitro::video { // Methods - std::shared_ptr JHybridVideoPlayerFactorySpec::createPlayer(const std::shared_ptr& source) { + std::shared_ptr JHybridVideoPlayerFactorySpec::createPlayer(const std::shared_ptr& source) { static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* source */)>("createPlayer"); auto __result = method(_javaPart, std::dynamic_pointer_cast(source)->getJavaPart()); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } } // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.hpp index 2bf9a028..eba1b7ba 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoPlayerFactorySpec(jni::alias_ref jThis) : HybridObject(HybridVideoPlayerFactorySpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: @@ -52,7 +53,7 @@ namespace margelo::nitro::video { public: // Methods - std::shared_ptr createPlayer(const std::shared_ptr& source) override; + std::shared_ptr createPlayer(const std::shared_ptr& source) override; private: friend HybridBase; diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.cpp index 8bec92f0..88126eed 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.cpp @@ -15,11 +15,14 @@ namespace margelo::nitro::video { struct NativeVideoConfig; } namespace margelo::nitro::video { struct NativeExternalSubtitle; } // Forward declaration of `SubtitleType` to properly resolve imports. namespace margelo::nitro::video { enum class SubtitleType; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } #include #include "HybridVideoPlayerSourceSpec.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" -#include #include #include "NativeVideoConfig.hpp" #include "JNativeVideoConfig.hpp" @@ -29,7 +32,15 @@ namespace margelo::nitro::video { enum class SubtitleType; } #include "JNativeExternalSubtitle.hpp" #include "SubtitleType.hpp" #include "JSubtitleType.hpp" +#include "NativeDrmParams.hpp" +#include "JNativeDrmParams.hpp" #include +#include +#include "OnGetLicensePayload.hpp" +#include +#include "JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp" +#include +#include "JOnGetLicensePayload.hpp" namespace margelo::nitro::video { @@ -57,15 +68,15 @@ namespace margelo::nitro::video { // Methods - std::shared_ptr JHybridVideoPlayerSourceFactorySpec::fromUri(const std::string& uri) { + std::shared_ptr JHybridVideoPlayerSourceFactorySpec::fromUri(const std::string& uri) { static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* uri */)>("fromUri"); auto __result = method(_javaPart, jni::make_jstring(uri)); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } - std::shared_ptr JHybridVideoPlayerSourceFactorySpec::fromVideoConfig(const NativeVideoConfig& config) { + std::shared_ptr JHybridVideoPlayerSourceFactorySpec::fromVideoConfig(const NativeVideoConfig& config) { static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* config */)>("fromVideoConfig"); auto __result = method(_javaPart, JNativeVideoConfig::fromCpp(config)); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } } // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.hpp index f320640e..b7ffa7f2 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoPlayerSourceFactorySpec(jni::alias_ref jThis) : HybridObject(HybridVideoPlayerSourceFactorySpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: @@ -52,8 +53,8 @@ namespace margelo::nitro::video { public: // Methods - std::shared_ptr fromUri(const std::string& uri) override; - std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) override; + std::shared_ptr fromUri(const std::string& uri) override; + std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) override; private: friend HybridBase; diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.cpp index 4a90b8fe..9242daa5 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.cpp @@ -13,6 +13,10 @@ namespace margelo::nitro::video { struct NativeVideoConfig; } namespace margelo::nitro::video { struct NativeExternalSubtitle; } // Forward declaration of `SubtitleType` to properly resolve imports. namespace margelo::nitro::video { enum class SubtitleType; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } // Forward declaration of `VideoInformation` to properly resolve imports. namespace margelo::nitro::video { struct VideoInformation; } // Forward declaration of `VideoOrientation` to properly resolve imports. @@ -27,10 +31,16 @@ namespace margelo::nitro::video { enum class VideoOrientation; } #include "JNativeExternalSubtitle.hpp" #include "SubtitleType.hpp" #include "JSubtitleType.hpp" +#include "NativeDrmParams.hpp" +#include "JNativeDrmParams.hpp" #include -#include "VideoInformation.hpp" #include +#include "OnGetLicensePayload.hpp" +#include +#include "JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp" #include +#include "JOnGetLicensePayload.hpp" +#include "VideoInformation.hpp" #include "JVideoInformation.hpp" #include "VideoOrientation.hpp" #include "JVideoOrientation.hpp" diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.hpp index 7c826b74..82fa476f 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoPlayerSourceSpec(jni::alias_ref jThis) : HybridObject(HybridVideoPlayerSourceSpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.cpp index 584478ab..37ca5a14 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.cpp @@ -23,7 +23,6 @@ namespace margelo::nitro::video { struct TextTrack; } #include #include "HybridVideoPlayerSourceSpec.hpp" #include "JHybridVideoPlayerSourceSpec.hpp" -#include #include "HybridVideoPlayerEventEmitterSpec.hpp" #include "JHybridVideoPlayerEventEmitterSpec.hpp" #include "VideoPlayerStatus.hpp" @@ -63,15 +62,15 @@ namespace margelo::nitro::video { } // Properties - std::shared_ptr JHybridVideoPlayerSpec::getSource() { + std::shared_ptr JHybridVideoPlayerSpec::getSource() { static const auto method = javaClassStatic()->getMethod()>("getSource"); auto __result = method(_javaPart); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } - std::shared_ptr JHybridVideoPlayerSpec::getEventEmitter() { + std::shared_ptr JHybridVideoPlayerSpec::getEventEmitter() { static const auto method = javaClassStatic()->getMethod()>("getEventEmitter"); auto __result = method(_javaPart); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } VideoPlayerStatus JHybridVideoPlayerSpec::getStatus() { static const auto method = javaClassStatic()->getMethod()>("getStatus"); @@ -176,7 +175,7 @@ namespace margelo::nitro::video { } // Methods - std::shared_ptr> JHybridVideoPlayerSpec::replaceSourceAsync(const std::optional>& source) { + std::shared_ptr> JHybridVideoPlayerSpec::replaceSourceAsync(const std::optional>& source) { static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* source */)>("replaceSourceAsync"); auto __result = method(_javaPart, source.has_value() ? std::dynamic_pointer_cast(source.value())->getJavaPart() : nullptr); return [&]() { diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.hpp index bfa09026..633262f9 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoPlayerSpec(jni::alias_ref jThis) : HybridObject(HybridVideoPlayerSpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: @@ -48,8 +49,8 @@ namespace margelo::nitro::video { public: // Properties - std::shared_ptr getSource() override; - std::shared_ptr getEventEmitter() override; + std::shared_ptr getSource() override; + std::shared_ptr getEventEmitter() override; VideoPlayerStatus getStatus() override; double getDuration() override; double getVolume() override; @@ -75,7 +76,7 @@ namespace margelo::nitro::video { public: // Methods - std::shared_ptr> replaceSourceAsync(const std::optional>& source) override; + std::shared_ptr> replaceSourceAsync(const std::optional>& source) override; std::vector getAvailableTextTracks() override; void selectTextTrack(const std::optional& textTrack) override; std::shared_ptr> preload() override; diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp index 4c6d088e..e3110548 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp @@ -13,7 +13,6 @@ namespace margelo::nitro::video { class HybridVideoViewViewManagerSpec; } #include #include "HybridVideoViewViewManagerSpec.hpp" #include "JHybridVideoViewViewManagerSpec.hpp" -#include namespace margelo::nitro::video { @@ -41,10 +40,10 @@ namespace margelo::nitro::video { // Methods - std::shared_ptr JHybridVideoViewViewManagerFactorySpec::createViewManager(double nitroId) { + std::shared_ptr JHybridVideoViewViewManagerFactorySpec::createViewManager(double nitroId) { static const auto method = javaClassStatic()->getMethod(double /* nitroId */)>("createViewManager"); auto __result = method(_javaPart, nitroId); - return JNISharedPtr::make_shared_from_jni(jni::make_global(__result)); + return __result->cthis()->shared_cast(); } } // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.hpp index 508d256e..1e2b59c8 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoViewViewManagerFactorySpec(jni::alias_ref jThis) : HybridObject(HybridVideoViewViewManagerFactorySpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: @@ -52,7 +53,7 @@ namespace margelo::nitro::video { public: // Methods - std::shared_ptr createViewManager(double nitroId) override; + std::shared_ptr createViewManager(double nitroId) override; private: friend HybridBase; diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.cpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.cpp index 67767480..72760303 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.cpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.cpp @@ -16,7 +16,6 @@ namespace margelo::nitro::video { enum class ResizeMode; } #include "HybridVideoPlayerSpec.hpp" #include #include "JHybridVideoPlayerSpec.hpp" -#include #include "ResizeMode.hpp" #include "JResizeMode.hpp" #include @@ -46,12 +45,12 @@ namespace margelo::nitro::video { } // Properties - std::optional> JHybridVideoViewViewManagerSpec::getPlayer() { + std::optional> JHybridVideoViewViewManagerSpec::getPlayer() { static const auto method = javaClassStatic()->getMethod()>("getPlayer"); auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(JNISharedPtr::make_shared_from_jni(jni::make_global(__result))) : std::nullopt; + return __result != nullptr ? std::make_optional(__result->cthis()->shared_cast()) : std::nullopt; } - void JHybridVideoViewViewManagerSpec::setPlayer(const std::optional>& player) { + void JHybridVideoViewViewManagerSpec::setPlayer(const std::optional>& player) { static const auto method = javaClassStatic()->getMethod /* player */)>("setPlayer"); method(_javaPart, player.has_value() ? std::dynamic_pointer_cast(player.value())->getJavaPart() : nullptr); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.hpp index 646e7a71..2265d9e3 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.hpp @@ -29,6 +29,7 @@ namespace margelo::nitro::video { // C++ constructor (called from Java via `initHybrid()`) explicit JHybridVideoViewViewManagerSpec(jni::alias_ref jThis) : HybridObject(HybridVideoViewViewManagerSpec::TAG), + HybridBase(jThis), _javaPart(jni::make_global(jThis)) {} public: @@ -48,8 +49,8 @@ namespace margelo::nitro::video { public: // Properties - std::optional> getPlayer() override; - void setPlayer(const std::optional>& player) override; + std::optional> getPlayer() override; + void setPlayer(const std::optional>& player) override; bool getControls() override; void setControls(bool controls) override; bool getPictureInPicture() override; diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JIgnoreSilentSwitchMode.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JIgnoreSilentSwitchMode.hpp index fa76999e..72afa7fb 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JIgnoreSilentSwitchMode.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JIgnoreSilentSwitchMode.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] IgnoreSilentSwitchMode toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JMixAudioMode.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JMixAudioMode.hpp index 022c9036..ef2aac4a 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JMixAudioMode.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JMixAudioMode.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] MixAudioMode toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JNativeDrmParams.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JNativeDrmParams.hpp new file mode 100644 index 00000000..e227cd24 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/c++/JNativeDrmParams.hpp @@ -0,0 +1,108 @@ +/// +/// JNativeDrmParams.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include "NativeDrmParams.hpp" + +#include "JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp" +#include "JOnGetLicensePayload.hpp" +#include "OnGetLicensePayload.hpp" +#include +#include +#include +#include +#include +#include + +namespace margelo::nitro::video { + + using namespace facebook; + + /** + * The C++ JNI bridge between the C++ struct "NativeDrmParams" and the the Kotlin data class "NativeDrmParams". + */ + struct JNativeDrmParams final: public jni::JavaClass { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/NativeDrmParams;"; + + public: + /** + * Convert this Java/Kotlin-based struct to the C++ struct NativeDrmParams by copying all values to C++. + */ + [[maybe_unused]] + [[nodiscard]] + NativeDrmParams toCpp() const { + static const auto clazz = javaClassStatic(); + static const auto fieldType = clazz->getField("type"); + jni::local_ref type = this->getFieldValue(fieldType); + static const auto fieldLicenseUrl = clazz->getField("licenseUrl"); + jni::local_ref licenseUrl = this->getFieldValue(fieldLicenseUrl); + static const auto fieldCertificateUrl = clazz->getField("certificateUrl"); + jni::local_ref certificateUrl = this->getFieldValue(fieldCertificateUrl); + static const auto fieldContentId = clazz->getField("contentId"); + jni::local_ref contentId = this->getFieldValue(fieldContentId); + static const auto fieldLicenseHeaders = clazz->getField>("licenseHeaders"); + jni::local_ref> licenseHeaders = this->getFieldValue(fieldLicenseHeaders); + static const auto fieldMultiSession = clazz->getField("multiSession"); + jni::local_ref multiSession = this->getFieldValue(fieldMultiSession); + static const auto fieldGetLicense = clazz->getField("getLicense"); + jni::local_ref getLicense = this->getFieldValue(fieldGetLicense); + return NativeDrmParams( + type != nullptr ? std::make_optional(type->toStdString()) : std::nullopt, + licenseUrl != nullptr ? std::make_optional(licenseUrl->toStdString()) : std::nullopt, + certificateUrl != nullptr ? std::make_optional(certificateUrl->toStdString()) : std::nullopt, + contentId != nullptr ? std::make_optional(contentId->toStdString()) : std::nullopt, + licenseHeaders != nullptr ? std::make_optional([&]() { + std::unordered_map __map; + __map.reserve(licenseHeaders->size()); + for (const auto& __entry : *licenseHeaders) { + __map.emplace(__entry.first->toStdString(), __entry.second->toStdString()); + } + return __map; + }()) : std::nullopt, + multiSession != nullptr ? std::make_optional(static_cast(multiSession->value())) : std::nullopt, + getLicense != nullptr ? std::make_optional([&]() -> std::function>>>(const OnGetLicensePayload& /* payload */)> { + if (getLicense->isInstanceOf(JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx::javaClassStatic())) [[likely]] { + auto downcast = jni::static_ref_cast(getLicense); + return downcast->cthis()->getFunction(); + } else { + auto getLicenseRef = jni::make_global(getLicense); + return [getLicenseRef](OnGetLicensePayload payload) -> std::shared_ptr>>> { + return getLicenseRef->invoke(payload); + }; + } + }()) : std::nullopt + ); + } + + public: + /** + * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. + */ + [[maybe_unused]] + static jni::local_ref fromCpp(const NativeDrmParams& value) { + return newInstance( + value.type.has_value() ? jni::make_jstring(value.type.value()) : nullptr, + value.licenseUrl.has_value() ? jni::make_jstring(value.licenseUrl.value()) : nullptr, + value.certificateUrl.has_value() ? jni::make_jstring(value.certificateUrl.value()) : nullptr, + value.contentId.has_value() ? jni::make_jstring(value.contentId.value()) : nullptr, + value.licenseHeaders.has_value() ? [&]() -> jni::local_ref> { + auto __map = jni::JHashMap::create(value.licenseHeaders.value().size()); + for (const auto& __entry : value.licenseHeaders.value()) { + __map->put(jni::make_jstring(__entry.first), jni::make_jstring(__entry.second)); + } + return __map; + }() : nullptr, + value.multiSession.has_value() ? jni::JBoolean::valueOf(value.multiSession.value()) : nullptr, + value.getLicense.has_value() ? JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx::fromCpp(value.getLicense.value()) : nullptr + ); + } + }; + +} // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JNativeVideoConfig.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JNativeVideoConfig.hpp index 585544ac..f5b7a3b1 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JNativeVideoConfig.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JNativeVideoConfig.hpp @@ -10,10 +10,18 @@ #include #include "NativeVideoConfig.hpp" +#include "JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp" +#include "JNativeDrmParams.hpp" #include "JNativeExternalSubtitle.hpp" +#include "JOnGetLicensePayload.hpp" #include "JSubtitleType.hpp" +#include "NativeDrmParams.hpp" #include "NativeExternalSubtitle.hpp" +#include "OnGetLicensePayload.hpp" #include "SubtitleType.hpp" +#include +#include +#include #include #include #include @@ -42,6 +50,8 @@ namespace margelo::nitro::video { jni::local_ref uri = this->getFieldValue(fieldUri); static const auto fieldExternalSubtitles = clazz->getField>("externalSubtitles"); jni::local_ref> externalSubtitles = this->getFieldValue(fieldExternalSubtitles); + static const auto fieldDrm = clazz->getField("drm"); + jni::local_ref drm = this->getFieldValue(fieldDrm); static const auto fieldHeaders = clazz->getField>("headers"); jni::local_ref> headers = this->getFieldValue(fieldHeaders); return NativeVideoConfig( @@ -56,6 +66,7 @@ namespace margelo::nitro::video { } return __vector; }()) : std::nullopt, + drm != nullptr ? std::make_optional(drm->toCpp()) : std::nullopt, headers != nullptr ? std::make_optional([&]() { std::unordered_map __map; __map.reserve(headers->size()); @@ -84,6 +95,7 @@ namespace margelo::nitro::video { } return __array; }() : nullptr, + value.drm.has_value() ? JNativeDrmParams::fromCpp(value.drm.value()) : nullptr, value.headers.has_value() ? [&]() -> jni::local_ref> { auto __map = jni::JHashMap::create(value.headers.value().size()); for (const auto& __entry : value.headers.value()) { diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JOnGetLicensePayload.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JOnGetLicensePayload.hpp new file mode 100644 index 00000000..feb0c859 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/c++/JOnGetLicensePayload.hpp @@ -0,0 +1,65 @@ +/// +/// JOnGetLicensePayload.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include "OnGetLicensePayload.hpp" + +#include + +namespace margelo::nitro::video { + + using namespace facebook; + + /** + * The C++ JNI bridge between the C++ struct "OnGetLicensePayload" and the the Kotlin data class "OnGetLicensePayload". + */ + struct JOnGetLicensePayload final: public jni::JavaClass { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/OnGetLicensePayload;"; + + public: + /** + * Convert this Java/Kotlin-based struct to the C++ struct OnGetLicensePayload by copying all values to C++. + */ + [[maybe_unused]] + [[nodiscard]] + OnGetLicensePayload toCpp() const { + static const auto clazz = javaClassStatic(); + static const auto fieldContentId = clazz->getField("contentId"); + jni::local_ref contentId = this->getFieldValue(fieldContentId); + static const auto fieldLicenseUrl = clazz->getField("licenseUrl"); + jni::local_ref licenseUrl = this->getFieldValue(fieldLicenseUrl); + static const auto fieldKeyUrl = clazz->getField("keyUrl"); + jni::local_ref keyUrl = this->getFieldValue(fieldKeyUrl); + static const auto fieldSpc = clazz->getField("spc"); + jni::local_ref spc = this->getFieldValue(fieldSpc); + return OnGetLicensePayload( + contentId->toStdString(), + licenseUrl->toStdString(), + keyUrl->toStdString(), + spc->toStdString() + ); + } + + public: + /** + * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. + */ + [[maybe_unused]] + static jni::local_ref fromCpp(const OnGetLicensePayload& value) { + return newInstance( + jni::make_jstring(value.contentId), + jni::make_jstring(value.licenseUrl), + jni::make_jstring(value.keyUrl), + jni::make_jstring(value.spc) + ); + } + }; + +} // namespace margelo::nitro::video diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JResizeMode.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JResizeMode.hpp index 6eb0857e..18139b92 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JResizeMode.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JResizeMode.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] ResizeMode toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JSourceType.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JSourceType.hpp index 0a8bb228..d79ea1f6 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JSourceType.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JSourceType.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] SourceType toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JSubtitleType.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JSubtitleType.hpp index 8f82f1c0..ed345295 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JSubtitleType.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JSubtitleType.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] SubtitleType toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JVideoOrientation.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JVideoOrientation.hpp index 2d23b1ed..118a1470 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JVideoOrientation.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JVideoOrientation.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] VideoOrientation toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JVideoPlayerStatus.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JVideoPlayerStatus.hpp index f68a6d8c..efbd9cf0 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JVideoPlayerStatus.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JVideoPlayerStatus.hpp @@ -29,7 +29,7 @@ namespace margelo::nitro::video { [[nodiscard]] VideoPlayerStatus toCpp() const { static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("_ordinal"); + static const auto fieldOrdinal = clazz->getField("value"); int ordinal = this->getFieldValue(fieldOrdinal); return static_cast(ordinal); } diff --git a/packages/react-native-video/nitrogen/generated/android/c++/JonLoadStartData.hpp b/packages/react-native-video/nitrogen/generated/android/c++/JonLoadStartData.hpp index c3dae850..ee1297fe 100644 --- a/packages/react-native-video/nitrogen/generated/android/c++/JonLoadStartData.hpp +++ b/packages/react-native-video/nitrogen/generated/android/c++/JonLoadStartData.hpp @@ -14,7 +14,6 @@ #include "JHybridVideoPlayerSourceSpec.hpp" #include "JSourceType.hpp" #include "SourceType.hpp" -#include #include namespace margelo::nitro::video { @@ -42,7 +41,7 @@ namespace margelo::nitro::video { jni::local_ref source = this->getFieldValue(fieldSource); return onLoadStartData( sourceType->toCpp(), - JNISharedPtr::make_shared_from_jni(jni::make_global(source)) + source->cthis()->shared_cast() ); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/BandwidthData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/BandwidthData.kt index 17f38fb9..62618bd0 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/BandwidthData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/BandwidthData.kt @@ -21,8 +21,14 @@ data class BandwidthData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val bitrate: Double, + @DoNotStrip + @Keep val width: Double?, + @DoNotStrip + @Keep val height: Double? ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.kt new file mode 100644 index 00000000..e0cf724b --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.kt @@ -0,0 +1,81 @@ +/// +/// Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.video + +import androidx.annotation.Keep +import com.facebook.jni.HybridData +import com.facebook.proguard.annotations.DoNotStrip +import com.margelo.nitro.core.* +import dalvik.annotation.optimization.FastNative + + +/** + * Represents the JavaScript callback `(payload: struct) => std::shared_ptr>>>`. + * This can be either implemented in C++ (in which case it might be a callback coming from JS), + * or in Kotlin/Java (in which case it is a native callback). + */ +@DoNotStrip +@Keep +@Suppress("ClassName", "RedundantUnitReturnType") +fun interface Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload: (OnGetLicensePayload) -> Promise> { + /** + * Call the given JS callback. + * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. + */ + @DoNotStrip + @Keep + override fun invoke(payload: OnGetLicensePayload): Promise> +} + +/** + * Represents the JavaScript callback `(payload: struct) => std::shared_ptr>>>`. + * This is implemented in C++, via a `std::function<...>`. + * The callback might be coming from JS. + */ +@DoNotStrip +@Keep +@Suppress( + "KotlinJniMissingFunction", "unused", + "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", + "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", +) +class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_cxx: Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload { + @DoNotStrip + @Keep + private val mHybridData: HybridData + + @DoNotStrip + @Keep + private constructor(hybridData: HybridData) { + mHybridData = hybridData + } + + @DoNotStrip + @Keep + override fun invoke(payload: OnGetLicensePayload): Promise> + = invoke_cxx(payload) + + @FastNative + private external fun invoke_cxx(payload: OnGetLicensePayload): Promise> +} + +/** + * Represents the JavaScript callback `(payload: struct) => std::shared_ptr>>>`. + * This is implemented in Java/Kotlin, via a `(OnGetLicensePayload) -> Promise>`. + * The callback is always coming from native. + */ +@DoNotStrip +@Keep +@Suppress("ClassName", "RedundantUnitReturnType", "unused") +class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_java(private val function: (OnGetLicensePayload) -> Promise>): Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload { + @DoNotStrip + @Keep + override fun invoke(payload: OnGetLicensePayload): Promise> { + return this.function(payload) + } +} diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_bool.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_bool.kt index eef7cc2c..941330d2 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_bool.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_bool.kt @@ -15,7 +15,7 @@ import dalvik.annotation.optimization.FastNative /** - * Represents the JavaScript callback `(fullscreen: boolean) => void`. + * Represents the JavaScript callback `(isInPictureInPicture: boolean) => void`. * This can be either implemented in C++ (in which case it might be a callback coming from JS), * or in Kotlin/Java (in which case it is a native callback). */ @@ -29,11 +29,11 @@ fun interface Func_void_bool: (Boolean) -> Unit { */ @DoNotStrip @Keep - override fun invoke(fullscreen: Boolean): Unit + override fun invoke(isInPictureInPicture: Boolean): Unit } /** - * Represents the JavaScript callback `(fullscreen: boolean) => void`. + * Represents the JavaScript callback `(isInPictureInPicture: boolean) => void`. * This is implemented in C++, via a `std::function<...>`. * The callback might be coming from JS. */ @@ -57,15 +57,15 @@ class Func_void_bool_cxx: Func_void_bool { @DoNotStrip @Keep - override fun invoke(fullscreen: Boolean): Unit - = invoke_cxx(fullscreen) + override fun invoke(isInPictureInPicture: Boolean): Unit + = invoke_cxx(isInPictureInPicture) @FastNative - private external fun invoke_cxx(fullscreen: Boolean): Unit + private external fun invoke_cxx(isInPictureInPicture: Boolean): Unit } /** - * Represents the JavaScript callback `(fullscreen: boolean) => void`. + * Represents the JavaScript callback `(isInPictureInPicture: boolean) => void`. * This is implemented in Java/Kotlin, via a `(Boolean) -> Unit`. * The callback is always coming from native. */ @@ -75,7 +75,7 @@ class Func_void_bool_cxx: Func_void_bool { class Func_void_bool_java(private val function: (Boolean) -> Unit): Func_void_bool { @DoNotStrip @Keep - override fun invoke(fullscreen: Boolean): Unit { - return this.function(fullscreen) + override fun invoke(isInPictureInPicture: Boolean): Unit { + return this.function(isInPictureInPicture) } } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_double.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_double.kt index 6cefd1e7..743f10bc 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_double.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/Func_void_double.kt @@ -15,7 +15,7 @@ import dalvik.annotation.optimization.FastNative /** - * Represents the JavaScript callback `(seekTime: number) => void`. + * Represents the JavaScript callback `(rate: number) => void`. * This can be either implemented in C++ (in which case it might be a callback coming from JS), * or in Kotlin/Java (in which case it is a native callback). */ @@ -29,11 +29,11 @@ fun interface Func_void_double: (Double) -> Unit { */ @DoNotStrip @Keep - override fun invoke(seekTime: Double): Unit + override fun invoke(rate: Double): Unit } /** - * Represents the JavaScript callback `(seekTime: number) => void`. + * Represents the JavaScript callback `(rate: number) => void`. * This is implemented in C++, via a `std::function<...>`. * The callback might be coming from JS. */ @@ -57,15 +57,15 @@ class Func_void_double_cxx: Func_void_double { @DoNotStrip @Keep - override fun invoke(seekTime: Double): Unit - = invoke_cxx(seekTime) + override fun invoke(rate: Double): Unit + = invoke_cxx(rate) @FastNative - private external fun invoke_cxx(seekTime: Double): Unit + private external fun invoke_cxx(rate: Double): Unit } /** - * Represents the JavaScript callback `(seekTime: number) => void`. + * Represents the JavaScript callback `(rate: number) => void`. * This is implemented in Java/Kotlin, via a `(Double) -> Unit`. * The callback is always coming from native. */ @@ -75,7 +75,7 @@ class Func_void_double_cxx: Func_void_double { class Func_void_double_java(private val function: (Double) -> Unit): Func_void_double { @DoNotStrip @Keep - override fun invoke(seekTime: Double): Unit { - return this.function(seekTime) + override fun invoke(rate: Double): Unit { + return this.function(rate) } } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/IgnoreSilentSwitchMode.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/IgnoreSilentSwitchMode.kt index 36f7fcf8..e5c70f94 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/IgnoreSilentSwitchMode.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/IgnoreSilentSwitchMode.kt @@ -15,12 +15,8 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class IgnoreSilentSwitchMode { - AUTO, - IGNORE, - OBEY; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class IgnoreSilentSwitchMode(@DoNotStrip @Keep val value: Int) { + AUTO(0), + IGNORE(1), + OBEY(2); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/MixAudioMode.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/MixAudioMode.kt index 7717f767..74c5cd99 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/MixAudioMode.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/MixAudioMode.kt @@ -15,13 +15,9 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class MixAudioMode { - MIXWITHOTHERS, - DONOTMIX, - DUCKOTHERS, - AUTO; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class MixAudioMode(@DoNotStrip @Keep val value: Int) { + MIXWITHOTHERS(0), + DONOTMIX(1), + DUCKOTHERS(2), + AUTO(3); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeDrmParams.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeDrmParams.kt new file mode 100644 index 00000000..6c885813 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeDrmParams.kt @@ -0,0 +1,51 @@ +/// +/// NativeDrmParams.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.video + +import androidx.annotation.Keep +import com.facebook.proguard.annotations.DoNotStrip +import com.margelo.nitro.core.* + + +/** + * Represents the JavaScript object/struct "NativeDrmParams". + */ +@DoNotStrip +@Keep +data class NativeDrmParams + @DoNotStrip + @Keep + constructor( + @DoNotStrip + @Keep + val type: String?, + @DoNotStrip + @Keep + val licenseUrl: String?, + @DoNotStrip + @Keep + val certificateUrl: String?, + @DoNotStrip + @Keep + val contentId: String?, + @DoNotStrip + @Keep + val licenseHeaders: Map?, + @DoNotStrip + @Keep + val multiSession: Boolean?, + @DoNotStrip + @Keep + val getLicense: Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload? + ) { + /** + * Initialize a new instance of `NativeDrmParams` from Kotlin. + */ + constructor(type: String?, licenseUrl: String?, certificateUrl: String?, contentId: String?, licenseHeaders: Map?, multiSession: Boolean?, getLicense: ((payload: OnGetLicensePayload) -> Promise>)?) + : this(type, licenseUrl, certificateUrl, contentId, licenseHeaders, multiSession, getLicense?.let { Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_java(it) }) +} diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeExternalSubtitle.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeExternalSubtitle.kt index c8cef163..75ff9133 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeExternalSubtitle.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeExternalSubtitle.kt @@ -21,9 +21,17 @@ data class NativeExternalSubtitle @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val uri: String, + @DoNotStrip + @Keep val label: String, + @DoNotStrip + @Keep val type: SubtitleType, + @DoNotStrip + @Keep val language: String ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeVideoConfig.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeVideoConfig.kt index 2f956fc3..68ae1c2c 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeVideoConfig.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/NativeVideoConfig.kt @@ -21,8 +21,17 @@ data class NativeVideoConfig @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val uri: String, + @DoNotStrip + @Keep val externalSubtitles: Array?, + @DoNotStrip + @Keep + val drm: NativeDrmParams?, + @DoNotStrip + @Keep val headers: Map? ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/OnGetLicensePayload.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/OnGetLicensePayload.kt new file mode 100644 index 00000000..a22512d7 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/OnGetLicensePayload.kt @@ -0,0 +1,38 @@ +/// +/// OnGetLicensePayload.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.video + +import androidx.annotation.Keep +import com.facebook.proguard.annotations.DoNotStrip +import com.margelo.nitro.core.* + + +/** + * Represents the JavaScript object/struct "OnGetLicensePayload". + */ +@DoNotStrip +@Keep +data class OnGetLicensePayload + @DoNotStrip + @Keep + constructor( + @DoNotStrip + @Keep + val contentId: String, + @DoNotStrip + @Keep + val licenseUrl: String, + @DoNotStrip + @Keep + val keyUrl: String, + @DoNotStrip + @Keep + val spc: String + ) { + /* main constructor */ +} diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/ResizeMode.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/ResizeMode.kt index 95d43740..1d712918 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/ResizeMode.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/ResizeMode.kt @@ -15,13 +15,9 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class ResizeMode { - CONTAIN, - COVER, - STRETCH, - NONE; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class ResizeMode(@DoNotStrip @Keep val value: Int) { + CONTAIN(0), + COVER(1), + STRETCH(2), + NONE(3); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SourceType.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SourceType.kt index b0be9aac..eea4e3f3 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SourceType.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SourceType.kt @@ -15,11 +15,7 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class SourceType { - LOCAL, - NETWORK; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class SourceType(@DoNotStrip @Keep val value: Int) { + LOCAL(0), + NETWORK(1); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SubtitleType.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SubtitleType.kt index b7dc625a..486ddcda 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SubtitleType.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/SubtitleType.kt @@ -15,14 +15,10 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class SubtitleType { - AUTO, - VTT, - SRT, - SSA, - ASS; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class SubtitleType(@DoNotStrip @Keep val value: Int) { + AUTO(0), + VTT(1), + SRT(2), + SSA(3), + ASS(4); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TextTrack.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TextTrack.kt index 5933b6ab..8cc27887 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TextTrack.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TextTrack.kt @@ -21,9 +21,17 @@ data class TextTrack @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val id: String, + @DoNotStrip + @Keep val label: String, + @DoNotStrip + @Keep val language: String?, + @DoNotStrip + @Keep val selected: Boolean ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadata.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadata.kt index 269c9ca8..278f4bd0 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadata.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadata.kt @@ -21,6 +21,8 @@ data class TimedMetadata @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val metadata: Array ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadataObject.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadataObject.kt index 386eb5dc..a4a4a295 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadataObject.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/TimedMetadataObject.kt @@ -21,7 +21,11 @@ data class TimedMetadataObject @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val value: String, + @DoNotStrip + @Keep val identifier: String ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoInformation.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoInformation.kt index 496a2aff..d9b90dd1 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoInformation.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoInformation.kt @@ -21,13 +21,29 @@ data class VideoInformation @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val bitrate: Double, + @DoNotStrip + @Keep val width: Double, + @DoNotStrip + @Keep val height: Double, + @DoNotStrip + @Keep val duration: Long, + @DoNotStrip + @Keep val fileSize: Long, + @DoNotStrip + @Keep val isHDR: Boolean, + @DoNotStrip + @Keep val isLive: Boolean, + @DoNotStrip + @Keep val orientation: VideoOrientation ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoOrientation.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoOrientation.kt index d6c37e6e..aff941ba 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoOrientation.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoOrientation.kt @@ -15,16 +15,12 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class VideoOrientation { - PORTRAIT, - LANDSCAPE, - PORTRAIT_UPSIDE_DOWN, - LANDSCAPE_LEFT, - LANDSCAPE_RIGHT, - SQUARE, - UNKNOWN; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class VideoOrientation(@DoNotStrip @Keep val value: Int) { + PORTRAIT(0), + LANDSCAPE(1), + PORTRAIT_UPSIDE_DOWN(2), + LANDSCAPE_LEFT(3), + LANDSCAPE_RIGHT(4), + SQUARE(5), + UNKNOWN(6); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoPlayerStatus.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoPlayerStatus.kt index e6c4996e..a7a767ba 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoPlayerStatus.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/VideoPlayerStatus.kt @@ -15,13 +15,9 @@ import com.facebook.proguard.annotations.DoNotStrip */ @DoNotStrip @Keep -enum class VideoPlayerStatus { - IDLE, - LOADING, - READYTOPLAY, - ERROR; - - @DoNotStrip - @Keep - private val _ordinal = ordinal +enum class VideoPlayerStatus(@DoNotStrip @Keep val value: Int) { + IDLE(0), + LOADING(1), + READYTOPLAY(2), + ERROR(3); } diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadData.kt index a9dccf9b..c993160e 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadData.kt @@ -21,10 +21,20 @@ data class onLoadData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val currentTime: Double, + @DoNotStrip + @Keep val duration: Double, + @DoNotStrip + @Keep val height: Double, + @DoNotStrip + @Keep val width: Double, + @DoNotStrip + @Keep val orientation: VideoOrientation ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadStartData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadStartData.kt index 105be716..b181951c 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadStartData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onLoadStartData.kt @@ -21,7 +21,11 @@ data class onLoadStartData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val sourceType: SourceType, + @DoNotStrip + @Keep val source: HybridVideoPlayerSourceSpec ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onPlaybackStateChangeData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onPlaybackStateChangeData.kt index be03a4b7..c8b6eb87 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onPlaybackStateChangeData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onPlaybackStateChangeData.kt @@ -21,7 +21,11 @@ data class onPlaybackStateChangeData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val isPlaying: Boolean, + @DoNotStrip + @Keep val isBuffering: Boolean ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onProgressData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onProgressData.kt index 2c16a882..446136c7 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onProgressData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onProgressData.kt @@ -21,7 +21,11 @@ data class onProgressData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val currentTime: Double, + @DoNotStrip + @Keep val bufferDuration: Double ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onVolumeChangeData.kt b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onVolumeChangeData.kt index 92f67e33..24d75134 100644 --- a/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onVolumeChangeData.kt +++ b/packages/react-native-video/nitrogen/generated/android/kotlin/com/margelo/nitro/video/onVolumeChangeData.kt @@ -21,7 +21,11 @@ data class onVolumeChangeData @DoNotStrip @Keep constructor( + @DoNotStrip + @Keep val volume: Double, + @DoNotStrip + @Keep val muted: Boolean ) { /* main constructor */ diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp index 5fe3c34c..efb685af 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp @@ -19,12 +19,12 @@ namespace margelo::nitro::video::bridge::swift { - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -35,12 +35,12 @@ namespace margelo::nitro::video::bridge::swift { return swiftPart.toUnsafe(); } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -67,12 +67,12 @@ namespace margelo::nitro::video::bridge::swift { }; } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoPlayerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -83,12 +83,12 @@ namespace margelo::nitro::video::bridge::swift { return swiftPart.toUnsafe(); } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -195,6 +195,31 @@ namespace margelo::nitro::video::bridge::swift { }; } + // pragma MARK: std::function + Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) { + auto swiftClosure = ReactNativeVideo::Func_void_std__string::fromUnsafe(swiftClosureWrapper); + return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void { + swiftClosure.call(result); + }; + } + + // pragma MARK: std::function>>>(const OnGetLicensePayload& /* payload */)> + Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* _Nonnull swiftClosureWrapper) { + auto swiftClosure = ReactNativeVideo::Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload::fromUnsafe(swiftClosureWrapper); + return [swiftClosure = std::move(swiftClosure)](const OnGetLicensePayload& payload) mutable -> std::shared_ptr>>> { + auto __result = swiftClosure.call(payload); + return __result; + }; + } + + // pragma MARK: std::function>& /* result */)> + Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* _Nonnull swiftClosureWrapper) { + auto swiftClosure = ReactNativeVideo::Func_void_std__shared_ptr_Promise_std__string__::fromUnsafe(swiftClosureWrapper); + return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr>& result) mutable -> void { + swiftClosure.call(result); + }; + } + // pragma MARK: std::function Func_void_VideoInformation create_Func_void_VideoInformation(void* _Nonnull swiftClosureWrapper) { auto swiftClosure = ReactNativeVideo::Func_void_VideoInformation::fromUnsafe(swiftClosureWrapper); @@ -203,12 +228,12 @@ namespace margelo::nitro::video::bridge::swift { }; } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -219,12 +244,12 @@ namespace margelo::nitro::video::bridge::swift { return swiftPart.toUnsafe(); } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -235,12 +260,12 @@ namespace margelo::nitro::video::bridge::swift { return swiftPart.toUnsafe(); } - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer) { + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer) { ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ cppType) { + void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType) { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp index 6eeb1365..6b2ca4f2 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp @@ -24,8 +24,12 @@ namespace margelo::nitro::video { class HybridVideoPlayerSpec; } namespace margelo::nitro::video { class HybridVideoViewViewManagerFactorySpec; } // Forward declaration of `HybridVideoViewViewManagerSpec` to properly resolve imports. namespace margelo::nitro::video { class HybridVideoViewViewManagerSpec; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } // Forward declaration of `NativeExternalSubtitle` to properly resolve imports. namespace margelo::nitro::video { struct NativeExternalSubtitle; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } // Forward declaration of `SourceType` to properly resolve imports. namespace margelo::nitro::video { enum class SourceType; } // Forward declaration of `SubtitleType` to properly resolve imports. @@ -78,7 +82,9 @@ namespace ReactNativeVideo { class HybridVideoViewViewManagerSpec_cxx; } #include "HybridVideoPlayerSpec.hpp" #include "HybridVideoViewViewManagerFactorySpec.hpp" #include "HybridVideoViewViewManagerSpec.hpp" +#include "NativeDrmParams.hpp" #include "NativeExternalSubtitle.hpp" +#include "OnGetLicensePayload.hpp" #include "SourceType.hpp" #include "SubtitleType.hpp" #include "TextTrack.hpp" @@ -109,29 +115,29 @@ namespace ReactNativeVideo { class HybridVideoViewViewManagerSpec_cxx; } */ namespace margelo::nitro::video::bridge::swift { - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ cppType); + using std__shared_ptr_HybridVideoPlayerSourceSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoPlayerSourceSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoPlayerSourceSpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceSpec_(const std::shared_ptr& strong) { return strong; } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ cppType); + using std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ weakify_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(const std::shared_ptr& strong) { return strong; } // pragma MARK: std::shared_ptr> /** @@ -189,13 +195,13 @@ namespace margelo::nitro::video::bridge::swift { return Func_void_std__exception_ptr_Wrapper(std::move(value)); } - // pragma MARK: std::optional> + // pragma MARK: std::optional> /** - * Specialized version of `std::optional>`. + * Specialized version of `std::optional>`. */ - using std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ = std::optional>; - inline std::optional> create_std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { - return std::optional>(value); + using std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__ = std::optional>; + inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { + return std::optional>(value); } // pragma MARK: std::optional @@ -227,17 +233,17 @@ namespace margelo::nitro::video::bridge::swift { return std::optional(value); } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ cppType); + using std__shared_ptr_HybridVideoPlayerSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoPlayerSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoPlayerSpec_ weakify_std__shared_ptr_HybridVideoPlayerSpec_(const std::shared_ptr& strong) { return strong; } // pragma MARK: Result>> using Result_std__shared_ptr_Promise_void___ = Result>>; @@ -266,25 +272,25 @@ namespace margelo::nitro::video::bridge::swift { return Result::withError(error); } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ cppType); + using std__shared_ptr_HybridVideoPlayerFactorySpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoPlayerFactorySpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoPlayerFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerFactorySpec_(const std::shared_ptr& strong) { return strong; } - // pragma MARK: Result> - using Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ = Result>; - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__(const std::shared_ptr& value) { - return Result>::withValue(value); + // pragma MARK: Result> + using Result_std__shared_ptr_HybridVideoPlayerSpec__ = Result>; + inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) { + return Result>::withValue(value); } - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__(const std::exception_ptr& error) { - return Result>::withError(error); + inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::exception_ptr& error) { + return Result>::withError(error); } // pragma MARK: std::function @@ -620,6 +626,9 @@ namespace margelo::nitro::video::bridge::swift { } return keys; } + inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) { + return map.at(key); + } inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) { map.emplace(key, value); } @@ -633,6 +642,124 @@ namespace margelo::nitro::video::bridge::swift { return std::optional>(value); } + // pragma MARK: std::optional + /** + * Specialized version of `std::optional`. + */ + using std__optional_bool_ = std::optional; + inline std::optional create_std__optional_bool_(const bool& value) { + return std::optional(value); + } + + // pragma MARK: std::shared_ptr> + /** + * Specialized version of `std::shared_ptr>`. + */ + using std__shared_ptr_Promise_std__string__ = std::shared_ptr>; + inline std::shared_ptr> create_std__shared_ptr_Promise_std__string__() { + return Promise::create(); + } + inline PromiseHolder wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr> promise) { + return PromiseHolder(std::move(promise)); + } + + // pragma MARK: std::function + /** + * Specialized version of `std::function`. + */ + using Func_void_std__string = std::function; + /** + * Wrapper class for a `std::function`, this can be used from Swift. + */ + class Func_void_std__string_Wrapper final { + public: + explicit Func_void_std__string_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} + inline void call(std::string result) const { + _function->operator()(result); + } + private: + std::unique_ptr> _function; + } SWIFT_NONCOPYABLE; + Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper); + inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) { + return Func_void_std__string_Wrapper(std::move(value)); + } + + // pragma MARK: std::function>>>(const OnGetLicensePayload& /* payload */)> + /** + * Specialized version of `std::function>>>(const OnGetLicensePayload&)>`. + */ + using Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload = std::function>>>(const OnGetLicensePayload& /* payload */)>; + /** + * Wrapper class for a `std::function>>>(const OnGetLicensePayload& / * payload * /)>`, this can be used from Swift. + */ + class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper final { + public: + explicit Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper(std::function>>>(const OnGetLicensePayload& /* payload */)>&& func): _function(std::make_unique>>>(const OnGetLicensePayload& /* payload */)>>(std::move(func))) {} + inline std::shared_ptr>>> call(OnGetLicensePayload payload) const { + auto __result = _function->operator()(payload); + return __result; + } + private: + std::unique_ptr>>>(const OnGetLicensePayload& /* payload */)>> _function; + } SWIFT_NONCOPYABLE; + Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* _Nonnull swiftClosureWrapper); + inline Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper wrap_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload value) { + return Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper(std::move(value)); + } + + // pragma MARK: std::shared_ptr>>> + /** + * Specialized version of `std::shared_ptr>>>`. + */ + using std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____ = std::shared_ptr>>>; + inline std::shared_ptr>>> create_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____() { + return Promise>>::create(); + } + inline PromiseHolder>> wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____(std::shared_ptr>>> promise) { + return PromiseHolder>>(std::move(promise)); + } + + // pragma MARK: std::function>& /* result */)> + /** + * Specialized version of `std::function>&)>`. + */ + using Func_void_std__shared_ptr_Promise_std__string__ = std::function>& /* result */)>; + /** + * Wrapper class for a `std::function>& / * result * /)>`, this can be used from Swift. + */ + class Func_void_std__shared_ptr_Promise_std__string___Wrapper final { + public: + explicit Func_void_std__shared_ptr_Promise_std__string___Wrapper(std::function>& /* result */)>&& func): _function(std::make_unique>& /* result */)>>(std::move(func))) {} + inline void call(std::shared_ptr> result) const { + _function->operator()(result); + } + private: + std::unique_ptr>& /* result */)>> _function; + } SWIFT_NONCOPYABLE; + Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* _Nonnull swiftClosureWrapper); + inline Func_void_std__shared_ptr_Promise_std__string___Wrapper wrap_Func_void_std__shared_ptr_Promise_std__string__(Func_void_std__shared_ptr_Promise_std__string__ value) { + return Func_void_std__shared_ptr_Promise_std__string___Wrapper(std::move(value)); + } + + // pragma MARK: std::optional>>>(const OnGetLicensePayload& /* payload */)>> + /** + * Specialized version of `std::optional>>>(const OnGetLicensePayload& / * payload * /)>>`. + */ + using std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______ = std::optional>>>(const OnGetLicensePayload& /* payload */)>>; + inline std::optional>>>(const OnGetLicensePayload& /* payload */)>> create_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(const std::function>>>(const OnGetLicensePayload& /* payload */)>& value) { + return std::optional>>>(const OnGetLicensePayload& /* payload */)>>(value); + } + + // pragma MARK: std::optional + /** + * Specialized version of `std::optional`. + */ + using std__optional_NativeDrmParams_ = std::optional; + inline std::optional create_std__optional_NativeDrmParams_(const NativeDrmParams& value) { + return std::optional(value); + } + // pragma MARK: std::shared_ptr> /** * Specialized version of `std::shared_ptr>`. @@ -676,34 +803,34 @@ namespace margelo::nitro::video::bridge::swift { return Result>>::withError(error); } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ cppType); + using std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(const std::shared_ptr& strong) { return strong; } - // pragma MARK: Result> - using Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ = Result>; - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { - return Result>::withValue(value); + // pragma MARK: Result> + using Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ = Result>; + inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { + return Result>::withValue(value); } - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(const std::exception_ptr& error) { - return Result>::withError(error); + inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::exception_ptr& error) { + return Result>::withError(error); } - // pragma MARK: std::optional> + // pragma MARK: std::optional> /** - * Specialized version of `std::optional>`. + * Specialized version of `std::optional>`. */ - using std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ = std::optional>; - inline std::optional> create_std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__(const std::shared_ptr& value) { - return std::optional>(value); + using std__optional_std__shared_ptr_HybridVideoPlayerSpec__ = std::optional>; + inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) { + return std::optional>(value); } // pragma MARK: std::optional> @@ -733,17 +860,17 @@ namespace margelo::nitro::video::bridge::swift { return std::optional>(value); } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ cppType); + using std__shared_ptr_HybridVideoViewViewManagerSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoViewViewManagerSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoViewViewManagerSpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerSpec_(const std::shared_ptr& strong) { return strong; } // pragma MARK: Result using Result_bool_ = Result; @@ -754,25 +881,25 @@ namespace margelo::nitro::video::bridge::swift { return Result::withError(error); } - // pragma MARK: std::shared_ptr + // pragma MARK: std::shared_ptr /** - * Specialized version of `std::shared_ptr`. + * Specialized version of `std::shared_ptr`. */ - using std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ cppType); + using std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer); + void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType); - // pragma MARK: std::weak_ptr - using std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ weakify_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(const std::shared_ptr& strong) { return strong; } + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ = std::weak_ptr; + inline std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(const std::shared_ptr& strong) { return strong; } - // pragma MARK: Result> - using Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__ = Result>; - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__(const std::shared_ptr& value) { - return Result>::withValue(value); + // pragma MARK: Result> + using Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ = Result>; + inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::shared_ptr& value) { + return Result>::withValue(value); } - inline Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__(const std::exception_ptr& error) { - return Result>::withError(error); + inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::exception_ptr& error) { + return Result>::withError(error); } } // namespace margelo::nitro::video::bridge::swift diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Umbrella.hpp b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Umbrella.hpp index a447143d..218d0a4e 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Umbrella.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Umbrella.hpp @@ -28,10 +28,14 @@ namespace margelo::nitro::video { class HybridVideoViewViewManagerSpec; } namespace margelo::nitro::video { enum class IgnoreSilentSwitchMode; } // Forward declaration of `MixAudioMode` to properly resolve imports. namespace margelo::nitro::video { enum class MixAudioMode; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } // Forward declaration of `NativeExternalSubtitle` to properly resolve imports. namespace margelo::nitro::video { struct NativeExternalSubtitle; } // Forward declaration of `NativeVideoConfig` to properly resolve imports. namespace margelo::nitro::video { struct NativeVideoConfig; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } // Forward declaration of `ResizeMode` to properly resolve imports. namespace margelo::nitro::video { enum class ResizeMode; } // Forward declaration of `SourceType` to properly resolve imports. @@ -72,8 +76,10 @@ namespace margelo::nitro::video { struct onVolumeChangeData; } #include "HybridVideoViewViewManagerSpec.hpp" #include "IgnoreSilentSwitchMode.hpp" #include "MixAudioMode.hpp" +#include "NativeDrmParams.hpp" #include "NativeExternalSubtitle.hpp" #include "NativeVideoConfig.hpp" +#include "OnGetLicensePayload.hpp" #include "ResizeMode.hpp" #include "SourceType.hpp" #include "SubtitleType.hpp" diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.mm b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.mm index dde6b89e..c4302e17 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.mm +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.mm @@ -26,21 +26,21 @@ HybridObjectRegistry::registerHybridObjectConstructor( "VideoPlayerFactory", []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoPlayerFactory(); + std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoPlayerFactory(); return hybridObject; } ); HybridObjectRegistry::registerHybridObjectConstructor( "VideoPlayerSourceFactory", []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoPlayerSourceFactory(); + std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoPlayerSourceFactory(); return hybridObject; } ); HybridObjectRegistry::registerHybridObjectConstructor( "VideoViewViewManagerFactory", []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoViewViewManagerFactory(); + std::shared_ptr hybridObject = ReactNativeVideo::ReactNativeVideoAutolinking::createVideoViewViewManagerFactory(); return hybridObject; } ); diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.swift b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.swift index 05e505e5..4d2ef780 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.swift +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideoAutolinking.swift @@ -15,9 +15,9 @@ public final class ReactNativeVideoAutolinking { * This is generated by Nitrogen and will initialize the class specified * in the `"autolinking"` property of `nitro.json` (in this case, `HybridVideoPlayerFactory`). */ - public static func createVideoPlayerFactory() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ { + public static func createVideoPlayerFactory() -> bridge.std__shared_ptr_HybridVideoPlayerFactorySpec_ { let hybridObject = HybridVideoPlayerFactory() - return { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ in + return { () -> bridge.std__shared_ptr_HybridVideoPlayerFactorySpec_ in let __cxxWrapped = hybridObject.getCxxWrapper() return __cxxWrapped.getCxxPart() }() @@ -30,9 +30,9 @@ public final class ReactNativeVideoAutolinking { * This is generated by Nitrogen and will initialize the class specified * in the `"autolinking"` property of `nitro.json` (in this case, `HybridVideoPlayerSourceFactory`). */ - public static func createVideoPlayerSourceFactory() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ { + public static func createVideoPlayerSourceFactory() -> bridge.std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ { let hybridObject = HybridVideoPlayerSourceFactory() - return { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ in + return { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ in let __cxxWrapped = hybridObject.getCxxWrapper() return __cxxWrapped.getCxxPart() }() @@ -45,9 +45,9 @@ public final class ReactNativeVideoAutolinking { * This is generated by Nitrogen and will initialize the class specified * in the `"autolinking"` property of `nitro.json` (in this case, `HybridVideoViewViewManagerFactory`). */ - public static func createVideoViewViewManagerFactory() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ { + public static func createVideoViewViewManagerFactory() -> bridge.std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ { let hybridObject = HybridVideoViewViewManagerFactory() - return { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ in + return { () -> bridge.std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ in let __cxxWrapped = hybridObject.getCxxWrapper() return __cxxWrapped.getCxxPart() }() diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.hpp index b0221a71..adfd0b95 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.hpp @@ -62,7 +62,7 @@ namespace margelo::nitro::video { public: // Methods - inline std::shared_ptr createPlayer(const std::shared_ptr& source) override { + inline std::shared_ptr createPlayer(const std::shared_ptr& source) override { auto __result = _swiftPart.createPlayer(source); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp index 393c3c41..02bc218c 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp @@ -20,6 +20,10 @@ namespace margelo::nitro::video { struct NativeVideoConfig; } namespace margelo::nitro::video { struct NativeExternalSubtitle; } // Forward declaration of `SubtitleType` to properly resolve imports. namespace margelo::nitro::video { enum class SubtitleType; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } #include #include "HybridVideoPlayerSourceSpec.hpp" @@ -29,7 +33,11 @@ namespace margelo::nitro::video { enum class SubtitleType; } #include #include #include "SubtitleType.hpp" +#include "NativeDrmParams.hpp" #include +#include +#include "OnGetLicensePayload.hpp" +#include #include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp" @@ -72,7 +80,7 @@ namespace margelo::nitro::video { public: // Methods - inline std::shared_ptr fromUri(const std::string& uri) override { + inline std::shared_ptr fromUri(const std::string& uri) override { auto __result = _swiftPart.fromUri(uri); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); @@ -80,7 +88,7 @@ namespace margelo::nitro::video { auto __value = std::move(__result.value()); return __value; } - inline std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) override { + inline std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) override { auto __result = _swiftPart.fromVideoConfig(config); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp index b9d8fb55..5580c21a 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp @@ -18,6 +18,10 @@ namespace margelo::nitro::video { struct NativeVideoConfig; } namespace margelo::nitro::video { struct NativeExternalSubtitle; } // Forward declaration of `SubtitleType` to properly resolve imports. namespace margelo::nitro::video { enum class SubtitleType; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } // Forward declaration of `VideoInformation` to properly resolve imports. namespace margelo::nitro::video { struct VideoInformation; } // Forward declaration of `VideoOrientation` to properly resolve imports. @@ -29,9 +33,12 @@ namespace margelo::nitro::video { enum class VideoOrientation; } #include #include #include "SubtitleType.hpp" +#include "NativeDrmParams.hpp" #include -#include "VideoInformation.hpp" #include +#include "OnGetLicensePayload.hpp" +#include +#include "VideoInformation.hpp" #include "VideoOrientation.hpp" #include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp" diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.hpp index 2aa557ac..8e285a55 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.hpp @@ -74,11 +74,11 @@ namespace margelo::nitro::video { public: // Properties - inline std::shared_ptr getSource() noexcept override { + inline std::shared_ptr getSource() noexcept override { auto __result = _swiftPart.getSource(); return __result; } - inline std::shared_ptr getEventEmitter() noexcept override { + inline std::shared_ptr getEventEmitter() noexcept override { auto __result = _swiftPart.getEventEmitter(); return __result; } @@ -155,7 +155,7 @@ namespace margelo::nitro::video { public: // Methods - inline std::shared_ptr> replaceSourceAsync(const std::optional>& source) override { + inline std::shared_ptr> replaceSourceAsync(const std::optional>& source) override { auto __result = _swiftPart.replaceSourceAsync(source); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.hpp index 006c69bd..a45fda33 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.hpp @@ -59,7 +59,7 @@ namespace margelo::nitro::video { public: // Methods - inline std::shared_ptr createViewManager(double nitroId) override { + inline std::shared_ptr createViewManager(double nitroId) override { auto __result = _swiftPart.createViewManager(std::forward(nitroId)); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp index 97fa8aee..0ba2fb85 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp @@ -60,11 +60,11 @@ namespace margelo::nitro::video { public: // Properties - inline std::optional> getPlayer() noexcept override { + inline std::optional> getPlayer() noexcept override { auto __result = _swiftPart.getPlayer(); return __result; } - inline void setPlayer(const std::optional>& player) noexcept override { + inline void setPlayer(const std::optional>& player) noexcept override { _swiftPart.setPlayer(player); } inline bool getControls() noexcept override { diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.swift new file mode 100644 index 00000000..eb52fa34 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.swift @@ -0,0 +1,62 @@ +/// +/// Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import NitroModules + + +/** + * Wraps a Swift `(_ payload: OnGetLicensePayload) -> Promise>` as a class. + * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. + */ +public final class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload { + public typealias bridge = margelo.nitro.video.bridge.swift + + private let closure: (_ payload: OnGetLicensePayload) -> Promise> + + public init(_ closure: @escaping (_ payload: OnGetLicensePayload) -> Promise>) { + self.closure = closure + } + + @inline(__always) + public func call(payload: OnGetLicensePayload) -> bridge.std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____ { + let __result: Promise> = self.closure(payload) + return { () -> bridge.std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____ in + let __promise = bridge.create_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____() + let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____(__promise) + __result + .then({ __result in __promiseHolder.resolve({ () -> bridge.std__shared_ptr_Promise_std__string__ in + let __promise = bridge.create_std__shared_ptr_Promise_std__string__() + let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) + __result + .then({ __result in __promiseHolder.resolve(std.string(__result)) }) + .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) + return __promise + }()) }) + .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) + return __promise + }() + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + @inline(__always) + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + @inline(__always) + public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } +} diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_bool.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_bool.swift index a3afa7f4..7ed02cc4 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_bool.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_bool.swift @@ -9,21 +9,21 @@ import NitroModules /** - * Wraps a Swift `(_ fullscreen: Bool) -> Void` as a class. + * Wraps a Swift `(_ isInPictureInPicture: Bool) -> Void` as a class. * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. */ public final class Func_void_bool { public typealias bridge = margelo.nitro.video.bridge.swift - private let closure: (_ fullscreen: Bool) -> Void + private let closure: (_ isInPictureInPicture: Bool) -> Void - public init(_ closure: @escaping (_ fullscreen: Bool) -> Void) { + public init(_ closure: @escaping (_ isInPictureInPicture: Bool) -> Void) { self.closure = closure } @inline(__always) - public func call(fullscreen: Bool) -> Void { - self.closure(fullscreen) + public func call(isInPictureInPicture: Bool) -> Void { + self.closure(isInPictureInPicture) } /** diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_double.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_double.swift index cd1dc433..245198bd 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_double.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_double.swift @@ -9,21 +9,21 @@ import NitroModules /** - * Wraps a Swift `(_ seekTime: Double) -> Void` as a class. + * Wraps a Swift `(_ rate: Double) -> Void` as a class. * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. */ public final class Func_void_double { public typealias bridge = margelo.nitro.video.bridge.swift - private let closure: (_ seekTime: Double) -> Void + private let closure: (_ rate: Double) -> Void - public init(_ closure: @escaping (_ seekTime: Double) -> Void) { + public init(_ closure: @escaping (_ rate: Double) -> Void) { self.closure = closure } @inline(__always) - public func call(seekTime: Double) -> Void { - self.closure(seekTime) + public func call(rate: Double) -> Void { + self.closure(rate) } /** diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_std__string__.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_std__string__.swift new file mode 100644 index 00000000..e793bef9 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_std__string__.swift @@ -0,0 +1,67 @@ +/// +/// Func_void_std__shared_ptr_Promise_std__string__.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import NitroModules + + +/** + * Wraps a Swift `(_ value: Promise) -> Void` as a class. + * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. + */ +public final class Func_void_std__shared_ptr_Promise_std__string__ { + public typealias bridge = margelo.nitro.video.bridge.swift + + private let closure: (_ value: Promise) -> Void + + public init(_ closure: @escaping (_ value: Promise) -> Void) { + self.closure = closure + } + + @inline(__always) + public func call(value: bridge.std__shared_ptr_Promise_std__string__) -> Void { + self.closure({ () -> Promise in + let __promise = Promise() + let __resolver = { (__result: String) in + __promise.resolve(withResult: __result) + } + let __rejecter = { (__error: Error) in + __promise.reject(withError: __error) + } + let __resolverCpp = { () -> bridge.Func_void_std__string in + let __closureWrapper = Func_void_std__string(__resolver) + return bridge.create_Func_void_std__string(__closureWrapper.toUnsafe()) + }() + let __rejecterCpp = { () -> bridge.Func_void_std__exception_ptr in + let __closureWrapper = Func_void_std__exception_ptr(__rejecter) + return bridge.create_Func_void_std__exception_ptr(__closureWrapper.toUnsafe()) + }() + let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(value) + __promiseHolder.addOnResolvedListener(__resolverCpp) + __promiseHolder.addOnRejectedListener(__rejecterCpp) + return __promise + }()) + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + @inline(__always) + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `Func_void_std__shared_ptr_Promise_std__string__`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + @inline(__always) + public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__shared_ptr_Promise_std__string__ { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } +} diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__string.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__string.swift new file mode 100644 index 00000000..155e0826 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__string.swift @@ -0,0 +1,47 @@ +/// +/// Func_void_std__string.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import NitroModules + + +/** + * Wraps a Swift `(_ value: String) -> Void` as a class. + * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. + */ +public final class Func_void_std__string { + public typealias bridge = margelo.nitro.video.bridge.swift + + private let closure: (_ value: String) -> Void + + public init(_ closure: @escaping (_ value: String) -> Void) { + self.closure = closure + } + + @inline(__always) + public func call(value: std.string) -> Void { + self.closure(String(value)) + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + @inline(__always) + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `Func_void_std__string`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + @inline(__always) + public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } +} diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec_cxx.swift index b7b57c32..93d0624e 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoPlayerEventEmitterSpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ /** * Create a new `HybridVideoPlayerEventEmitterSpec_cxx` that wraps the given `HybridVideoPlayerEventEmitterSpec`. @@ -72,15 +72,15 @@ open class HybridVideoPlayerEventEmitterSpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(newCxxPart) return newCxxPart } } diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec_cxx.swift index 8b3b6da2..5a76e01a 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoPlayerFactorySpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoPlayerFactorySpec_ /** * Create a new `HybridVideoPlayerFactorySpec_cxx` that wraps the given `HybridVideoPlayerFactorySpec`. @@ -72,15 +72,15 @@ open class HybridVideoPlayerFactorySpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoPlayerFactorySpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerFactorySpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoPlayerFactorySpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoPlayerFactorySpec_(newCxxPart) return newCxxPart } } @@ -110,21 +110,21 @@ open class HybridVideoPlayerFactorySpec_cxx { // Methods @inline(__always) - public final func createPlayer(source: bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_) -> bridge.Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ { + public final func createPlayer(source: bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_) -> bridge.Result_std__shared_ptr_HybridVideoPlayerSpec__ { do { let __result = try self.__implementation.createPlayer(source: { () -> HybridVideoPlayerSourceSpec in - let __unsafePointer = bridge.get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(source) + let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSourceSpec_(source) let __instance = HybridVideoPlayerSourceSpec_cxx.fromUnsafe(__unsafePointer) return __instance.getHybridVideoPlayerSourceSpec() }()) - let __resultCpp = { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ in + let __resultCpp = { () -> bridge.std__shared_ptr_HybridVideoPlayerSpec_ in let __cxxWrapped = __result.getCxxWrapper() return __cxxWrapped.getCxxPart() }() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__(__resultCpp) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSpec__(__resultCpp) } catch (let __error) { let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__(__exceptionPtr) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSpec__(__exceptionPtr) } } } diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec_cxx.swift index 2e075da4..a6978fc0 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoPlayerSourceFactorySpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ /** * Create a new `HybridVideoPlayerSourceFactorySpec_cxx` that wraps the given `HybridVideoPlayerSourceFactorySpec`. @@ -72,15 +72,15 @@ open class HybridVideoPlayerSourceFactorySpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceFactorySpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(newCxxPart) return newCxxPart } } @@ -110,32 +110,32 @@ open class HybridVideoPlayerSourceFactorySpec_cxx { // Methods @inline(__always) - public final func fromUri(uri: std.string) -> bridge.Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ { + public final func fromUri(uri: std.string) -> bridge.Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ { do { let __result = try self.__implementation.fromUri(uri: String(uri)) - let __resultCpp = { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ in + let __resultCpp = { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ in let __cxxWrapped = __result.getCxxWrapper() return __cxxWrapped.getCxxPart() }() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(__resultCpp) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(__resultCpp) } catch (let __error) { let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(__exceptionPtr) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(__exceptionPtr) } } @inline(__always) - public final func fromVideoConfig(config: NativeVideoConfig) -> bridge.Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__ { + public final func fromVideoConfig(config: NativeVideoConfig) -> bridge.Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ { do { let __result = try self.__implementation.fromVideoConfig(config: config) - let __resultCpp = { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ in + let __resultCpp = { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ in let __cxxWrapped = __result.getCxxWrapper() return __cxxWrapped.getCxxPart() }() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(__resultCpp) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(__resultCpp) } catch (let __error) { let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__(__exceptionPtr) + return bridge.create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(__exceptionPtr) } } } diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec_cxx.swift index f302d6e6..810c8253 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoPlayerSourceSpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoPlayerSourceSpec_ /** * Create a new `HybridVideoPlayerSourceSpec_cxx` that wraps the given `HybridVideoPlayerSourceSpec`. @@ -72,15 +72,15 @@ open class HybridVideoPlayerSourceSpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoPlayerSourceSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoPlayerSourceSpec_(newCxxPart) return newCxxPart } } diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift index a2610e2b..ede32db0 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoPlayerSpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoPlayerSpec_ /** * Create a new `HybridVideoPlayerSpec_cxx` that wraps the given `HybridVideoPlayerSpec`. @@ -72,15 +72,15 @@ open class HybridVideoPlayerSpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoPlayerSpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoPlayerSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoPlayerSpec_(newCxxPart) return newCxxPart } } @@ -106,20 +106,20 @@ open class HybridVideoPlayerSpec_cxx { } // Properties - public final var source: bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ { + public final var source: bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ { @inline(__always) get { - return { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ in + return { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ in let __cxxWrapped = self.__implementation.source.getCxxWrapper() return __cxxWrapped.getCxxPart() }() } } - public final var eventEmitter: bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ { + public final var eventEmitter: bridge.std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ { @inline(__always) get { - return { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerEventEmitterSpec_ in + return { () -> bridge.std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ in let __cxxWrapped = self.__implementation.eventEmitter.getCxxWrapper() return __cxxWrapped.getCxxPart() }() @@ -261,12 +261,12 @@ open class HybridVideoPlayerSpec_cxx { // Methods @inline(__always) - public final func replaceSourceAsync(source: bridge.std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec__) -> bridge.Result_std__shared_ptr_Promise_void___ { + public final func replaceSourceAsync(source: bridge.std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__) -> bridge.Result_std__shared_ptr_Promise_void___ { do { let __result = try self.__implementation.replaceSourceAsync(source: { () -> (any HybridVideoPlayerSourceSpec)? in if let __unwrapped = source.value { return { () -> HybridVideoPlayerSourceSpec in - let __unsafePointer = bridge.get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(__unwrapped) + let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSourceSpec_(__unwrapped) let __instance = HybridVideoPlayerSourceSpec_cxx.fromUnsafe(__unsafePointer) return __instance.getHybridVideoPlayerSourceSpec() }() diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec_cxx.swift index e4c9a1d5..112b5698 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoViewViewManagerFactorySpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ /** * Create a new `HybridVideoViewViewManagerFactorySpec_cxx` that wraps the given `HybridVideoViewViewManagerFactorySpec`. @@ -72,15 +72,15 @@ open class HybridVideoViewViewManagerFactorySpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerFactorySpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(newCxxPart) return newCxxPart } } @@ -110,17 +110,17 @@ open class HybridVideoViewViewManagerFactorySpec_cxx { // Methods @inline(__always) - public final func createViewManager(nitroId: Double) -> bridge.Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__ { + public final func createViewManager(nitroId: Double) -> bridge.Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ { do { let __result = try self.__implementation.createViewManager(nitroId: nitroId) - let __resultCpp = { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ in + let __resultCpp = { () -> bridge.std__shared_ptr_HybridVideoViewViewManagerSpec_ in let __cxxWrapped = __result.getCxxWrapper() return __cxxWrapped.getCxxPart() }() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__(__resultCpp) + return bridge.create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(__resultCpp) } catch (let __error) { let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec__(__exceptionPtr) + return bridge.create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(__exceptionPtr) } } } diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift index a93ab097..e200c106 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift @@ -33,7 +33,7 @@ open class HybridVideoViewViewManagerSpec_cxx { /** * Holds a weak pointer to the C++ class that wraps the Swift class. */ - private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ + private var __cxxPart: bridge.std__weak_ptr_HybridVideoViewViewManagerSpec_ /** * Create a new `HybridVideoViewViewManagerSpec_cxx` that wraps the given `HybridVideoViewViewManagerSpec`. @@ -72,15 +72,15 @@ open class HybridVideoViewViewManagerSpec_cxx { /** * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. + * The C++ part is a `std::shared_ptr`. */ - public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_ { + public func getCxxPart() -> bridge.std__shared_ptr_HybridVideoViewViewManagerSpec_ { let cachedCxxPart = self.__cxxPart.lock() if cachedCxxPart.__convertToBool() { return cachedCxxPart } else { - let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__video__HybridVideoViewViewManagerSpec_(newCxxPart) + let newCxxPart = bridge.create_std__shared_ptr_HybridVideoViewViewManagerSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridVideoViewViewManagerSpec_(newCxxPart) return newCxxPart } } @@ -106,12 +106,12 @@ open class HybridVideoViewViewManagerSpec_cxx { } // Properties - public final var player: bridge.std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ { + public final var player: bridge.std__optional_std__shared_ptr_HybridVideoPlayerSpec__ { @inline(__always) get { - return { () -> bridge.std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__ in + return { () -> bridge.std__optional_std__shared_ptr_HybridVideoPlayerSpec__ in if let __unwrappedValue = self.__implementation.player { - return bridge.create_std__optional_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec__({ () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_ in + return bridge.create_std__optional_std__shared_ptr_HybridVideoPlayerSpec__({ () -> bridge.std__shared_ptr_HybridVideoPlayerSpec_ in let __cxxWrapped = __unwrappedValue.getCxxWrapper() return __cxxWrapped.getCxxPart() }()) @@ -125,7 +125,7 @@ open class HybridVideoViewViewManagerSpec_cxx { self.__implementation.player = { () -> (any HybridVideoPlayerSpec)? in if let __unwrapped = newValue.value { return { () -> HybridVideoPlayerSpec in - let __unsafePointer = bridge.get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSpec_(__unwrapped) + let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSpec_(__unwrapped) let __instance = HybridVideoPlayerSpec_cxx.fromUnsafe(__unsafePointer) return __instance.getHybridVideoPlayerSpec() }() diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift b/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift new file mode 100644 index 00000000..c1c1a8a4 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift @@ -0,0 +1,273 @@ +/// +/// NativeDrmParams.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import NitroModules + +/** + * Represents an instance of `NativeDrmParams`, backed by a C++ struct. + */ +public typealias NativeDrmParams = margelo.nitro.video.NativeDrmParams + +public extension NativeDrmParams { + private typealias bridge = margelo.nitro.video.bridge.swift + + /** + * Create a new instance of `NativeDrmParams`. + */ + init(type: String?, licenseUrl: String?, certificateUrl: String?, contentId: String?, licenseHeaders: Dictionary?, multiSession: Bool?, getLicense: ((_ payload: OnGetLicensePayload) -> Promise>)?) { + self.init({ () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = type { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }(), { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = licenseUrl { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }(), { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = certificateUrl { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }(), { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = contentId { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }(), { () -> bridge.std__optional_std__unordered_map_std__string__std__string__ in + if let __unwrappedValue = licenseHeaders { + return bridge.create_std__optional_std__unordered_map_std__string__std__string__({ () -> bridge.std__unordered_map_std__string__std__string_ in + var __map = bridge.create_std__unordered_map_std__string__std__string_(__unwrappedValue.count) + for (__k, __v) in __unwrappedValue { + bridge.emplace_std__unordered_map_std__string__std__string_(&__map, std.string(__k), std.string(__v)) + } + return __map + }()) + } else { + return .init() + } + }(), { () -> bridge.std__optional_bool_ in + if let __unwrappedValue = multiSession { + return bridge.create_std__optional_bool_(__unwrappedValue) + } else { + return .init() + } + }(), { () -> bridge.std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______ in + if let __unwrappedValue = getLicense { + return bridge.create_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______({ () -> bridge.Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload in + let __closureWrapper = Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__unwrappedValue) + return bridge.create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__closureWrapper.toUnsafe()) + }()) + } else { + return .init() + } + }()) + } + + var type: String? { + @inline(__always) + get { + return { () -> String? in + if let __unwrapped = self.__type.value { + return String(__unwrapped) + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__type = { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }() + } + } + + var licenseUrl: String? { + @inline(__always) + get { + return { () -> String? in + if let __unwrapped = self.__licenseUrl.value { + return String(__unwrapped) + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__licenseUrl = { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }() + } + } + + var certificateUrl: String? { + @inline(__always) + get { + return { () -> String? in + if let __unwrapped = self.__certificateUrl.value { + return String(__unwrapped) + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__certificateUrl = { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }() + } + } + + var contentId: String? { + @inline(__always) + get { + return { () -> String? in + if let __unwrapped = self.__contentId.value { + return String(__unwrapped) + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__contentId = { () -> bridge.std__optional_std__string_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) + } else { + return .init() + } + }() + } + } + + var licenseHeaders: Dictionary? { + @inline(__always) + get { + return { () -> Dictionary? in + if let __unwrapped = self.__licenseHeaders.value { + return { () -> Dictionary in + var __dictionary = Dictionary(minimumCapacity: __unwrapped.size()) + let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(__unwrapped) + for __key in __keys { + let __value = bridge.get_std__unordered_map_std__string__std__string__value(__unwrapped, __key) + __dictionary[String(__key)] = String(__value) + } + return __dictionary + }() + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__licenseHeaders = { () -> bridge.std__optional_std__unordered_map_std__string__std__string__ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__unordered_map_std__string__std__string__({ () -> bridge.std__unordered_map_std__string__std__string_ in + var __map = bridge.create_std__unordered_map_std__string__std__string_(__unwrappedValue.count) + for (__k, __v) in __unwrappedValue { + bridge.emplace_std__unordered_map_std__string__std__string_(&__map, std.string(__k), std.string(__v)) + } + return __map + }()) + } else { + return .init() + } + }() + } + } + + var multiSession: Bool? { + @inline(__always) + get { + return self.__multiSession.value + } + @inline(__always) + set { + self.__multiSession = { () -> bridge.std__optional_bool_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_bool_(__unwrappedValue) + } else { + return .init() + } + }() + } + } + + var getLicense: ((_ payload: OnGetLicensePayload) -> Promise>)? { + @inline(__always) + get { + return { () -> ((_ payload: OnGetLicensePayload) -> Promise>)? in + if let __unwrapped = self.__getLicense.value { + return { () -> (OnGetLicensePayload) -> Promise> in + let __wrappedFunction = bridge.wrap_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__unwrapped) + return { (__payload: OnGetLicensePayload) -> Promise> in + let __result = __wrappedFunction.call(__payload) + return { () -> Promise> in + let __promise = Promise>() + let __resolver = { (__result: Promise) in + __promise.resolve(withResult: __result) + } + let __rejecter = { (__error: Error) in + __promise.reject(withError: __error) + } + let __resolverCpp = { () -> bridge.Func_void_std__shared_ptr_Promise_std__string__ in + let __closureWrapper = Func_void_std__shared_ptr_Promise_std__string__(__resolver) + return bridge.create_Func_void_std__shared_ptr_Promise_std__string__(__closureWrapper.toUnsafe()) + }() + let __rejecterCpp = { () -> bridge.Func_void_std__exception_ptr in + let __closureWrapper = Func_void_std__exception_ptr(__rejecter) + return bridge.create_Func_void_std__exception_ptr(__closureWrapper.toUnsafe()) + }() + let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____(__result) + __promiseHolder.addOnResolvedListener(__resolverCpp) + __promiseHolder.addOnRejectedListener(__rejecterCpp) + return __promise + }() + } + }() + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__getLicense = { () -> bridge.std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______({ () -> bridge.Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload in + let __closureWrapper = Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__unwrappedValue) + return bridge.create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__closureWrapper.toUnsafe()) + }()) + } else { + return .init() + } + }() + } + } +} diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift b/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift index 27e17a17..c68511bf 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift @@ -18,7 +18,7 @@ public extension NativeVideoConfig { /** * Create a new instance of `NativeVideoConfig`. */ - init(uri: String, externalSubtitles: [NativeExternalSubtitle]?, headers: Dictionary?) { + init(uri: String, externalSubtitles: [NativeExternalSubtitle]?, drm: NativeDrmParams?, headers: Dictionary?) { self.init(std.string(uri), { () -> bridge.std__optional_std__vector_NativeExternalSubtitle__ in if let __unwrappedValue = externalSubtitles { return bridge.create_std__optional_std__vector_NativeExternalSubtitle__({ () -> bridge.std__vector_NativeExternalSubtitle_ in @@ -31,6 +31,12 @@ public extension NativeVideoConfig { } else { return .init() } + }(), { () -> bridge.std__optional_NativeDrmParams_ in + if let __unwrappedValue = drm { + return bridge.create_std__optional_NativeDrmParams_(__unwrappedValue) + } else { + return .init() + } }(), { () -> bridge.std__optional_std__unordered_map_std__string__std__string__ in if let __unwrappedValue = headers { return bridge.create_std__optional_std__unordered_map_std__string__std__string__({ () -> bridge.std__unordered_map_std__string__std__string_ in @@ -86,6 +92,29 @@ public extension NativeVideoConfig { } } + var drm: NativeDrmParams? { + @inline(__always) + get { + return { () -> NativeDrmParams? in + if let __unwrapped = self.__drm.value { + return __unwrapped + } else { + return nil + } + }() + } + @inline(__always) + set { + self.__drm = { () -> bridge.std__optional_NativeDrmParams_ in + if let __unwrappedValue = newValue { + return bridge.create_std__optional_NativeDrmParams_(__unwrappedValue) + } else { + return .init() + } + }() + } + } + var headers: Dictionary? { @inline(__always) get { @@ -95,7 +124,7 @@ public extension NativeVideoConfig { var __dictionary = Dictionary(minimumCapacity: __unwrapped.size()) let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(__unwrapped) for __key in __keys { - let __value = __unwrapped[__key]! + let __value = bridge.get_std__unordered_map_std__string__std__string__value(__unwrapped, __key) __dictionary[String(__key)] = String(__value) } return __dictionary diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/OnGetLicensePayload.swift b/packages/react-native-video/nitrogen/generated/ios/swift/OnGetLicensePayload.swift new file mode 100644 index 00000000..f7a8e345 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/ios/swift/OnGetLicensePayload.swift @@ -0,0 +1,68 @@ +/// +/// OnGetLicensePayload.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +import NitroModules + +/** + * Represents an instance of `OnGetLicensePayload`, backed by a C++ struct. + */ +public typealias OnGetLicensePayload = margelo.nitro.video.OnGetLicensePayload + +public extension OnGetLicensePayload { + private typealias bridge = margelo.nitro.video.bridge.swift + + /** + * Create a new instance of `OnGetLicensePayload`. + */ + init(contentId: String, licenseUrl: String, keyUrl: String, spc: String) { + self.init(std.string(contentId), std.string(licenseUrl), std.string(keyUrl), std.string(spc)) + } + + var contentId: String { + @inline(__always) + get { + return String(self.__contentId) + } + @inline(__always) + set { + self.__contentId = std.string(newValue) + } + } + + var licenseUrl: String { + @inline(__always) + get { + return String(self.__licenseUrl) + } + @inline(__always) + set { + self.__licenseUrl = std.string(newValue) + } + } + + var keyUrl: String { + @inline(__always) + get { + return String(self.__keyUrl) + } + @inline(__always) + set { + self.__keyUrl = std.string(newValue) + } + } + + var spc: String { + @inline(__always) + get { + return String(self.__spc) + } + @inline(__always) + set { + self.__spc = std.string(newValue) + } + } +} diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/onLoadStartData.swift b/packages/react-native-video/nitrogen/generated/ios/swift/onLoadStartData.swift index 759d0604..e5a63cfc 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/onLoadStartData.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/onLoadStartData.swift @@ -19,7 +19,7 @@ public extension onLoadStartData { * Create a new instance of `onLoadStartData`. */ init(sourceType: SourceType, source: (any HybridVideoPlayerSourceSpec)) { - self.init(sourceType, { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ in + self.init(sourceType, { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ in let __cxxWrapped = source.getCxxWrapper() return __cxxWrapped.getCxxPart() }()) @@ -40,14 +40,14 @@ public extension onLoadStartData { @inline(__always) get { return { () -> HybridVideoPlayerSourceSpec in - let __unsafePointer = bridge.get_std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_(self.__source) + let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSourceSpec_(self.__source) let __instance = HybridVideoPlayerSourceSpec_cxx.fromUnsafe(__unsafePointer) return __instance.getHybridVideoPlayerSourceSpec() }() } @inline(__always) set { - self.__source = { () -> bridge.std__shared_ptr_margelo__nitro__video__HybridVideoPlayerSourceSpec_ in + self.__source = { () -> bridge.std__shared_ptr_HybridVideoPlayerSourceSpec_ in let __cxxWrapped = newValue.getCxxWrapper() return __cxxWrapped.getCxxPart() }() diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/BandwidthData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/BandwidthData.hpp index bb8ca01a..db1057d5 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/BandwidthData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/BandwidthData.hpp @@ -42,20 +42,18 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ BandwidthData <> JS BandwidthData (object) template <> - struct JSIConverter final { - static inline BandwidthData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::BandwidthData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return BandwidthData( + return margelo::nitro::video::BandwidthData( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bitrate")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "width")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "height")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const BandwidthData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::BandwidthData& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "bitrate", JSIConverter::toJSI(runtime, arg.bitrate)); obj.setProperty(runtime, "width", JSIConverter>::toJSI(runtime, arg.width)); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.hpp index 305d56e3..ef3506b4 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.hpp @@ -53,7 +53,7 @@ namespace margelo::nitro::video { public: // Methods - virtual std::shared_ptr createPlayer(const std::shared_ptr& source) = 0; + virtual std::shared_ptr createPlayer(const std::shared_ptr& source) = 0; protected: // Hybrid Setup diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.hpp index c7e7d305..67b5c262 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.hpp @@ -54,8 +54,8 @@ namespace margelo::nitro::video { public: // Methods - virtual std::shared_ptr fromUri(const std::string& uri) = 0; - virtual std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) = 0; + virtual std::shared_ptr fromUri(const std::string& uri) = 0; + virtual std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) = 0; protected: // Hybrid Setup diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.hpp index 5f78908c..43f04724 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.hpp @@ -64,8 +64,8 @@ namespace margelo::nitro::video { public: // Properties - virtual std::shared_ptr getSource() = 0; - virtual std::shared_ptr getEventEmitter() = 0; + virtual std::shared_ptr getSource() = 0; + virtual std::shared_ptr getEventEmitter() = 0; virtual VideoPlayerStatus getStatus() = 0; virtual double getDuration() = 0; virtual double getVolume() = 0; @@ -91,7 +91,7 @@ namespace margelo::nitro::video { public: // Methods - virtual std::shared_ptr> replaceSourceAsync(const std::optional>& source) = 0; + virtual std::shared_ptr> replaceSourceAsync(const std::optional>& source) = 0; virtual std::vector getAvailableTextTracks() = 0; virtual void selectTextTrack(const std::optional& textTrack) = 0; virtual std::shared_ptr> preload() = 0; diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.hpp index cb73666c..a2a2f84c 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.hpp @@ -50,7 +50,7 @@ namespace margelo::nitro::video { public: // Methods - virtual std::shared_ptr createViewManager(double nitroId) = 0; + virtual std::shared_ptr createViewManager(double nitroId) = 0; protected: // Hybrid Setup diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.hpp index 524c4a92..86776e6c 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.hpp @@ -51,8 +51,8 @@ namespace margelo::nitro::video { public: // Properties - virtual std::optional> getPlayer() = 0; - virtual void setPlayer(const std::optional>& player) = 0; + virtual std::optional> getPlayer() = 0; + virtual void setPlayer(const std::optional>& player) = 0; virtual bool getControls() = 0; virtual void setControls(bool controls) = 0; virtual bool getPictureInPicture() = 0; diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/IgnoreSilentSwitchMode.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/IgnoreSilentSwitchMode.hpp index aeca6e13..50651bea 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/IgnoreSilentSwitchMode.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/IgnoreSilentSwitchMode.hpp @@ -38,26 +38,24 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ IgnoreSilentSwitchMode <> JS IgnoreSilentSwitchMode (union) template <> - struct JSIConverter final { - static inline IgnoreSilentSwitchMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::IgnoreSilentSwitchMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("auto"): return IgnoreSilentSwitchMode::AUTO; - case hashString("ignore"): return IgnoreSilentSwitchMode::IGNORE; - case hashString("obey"): return IgnoreSilentSwitchMode::OBEY; + case hashString("auto"): return margelo::nitro::video::IgnoreSilentSwitchMode::AUTO; + case hashString("ignore"): return margelo::nitro::video::IgnoreSilentSwitchMode::IGNORE; + case hashString("obey"): return margelo::nitro::video::IgnoreSilentSwitchMode::OBEY; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum IgnoreSilentSwitchMode - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, IgnoreSilentSwitchMode arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::IgnoreSilentSwitchMode arg) { switch (arg) { - case IgnoreSilentSwitchMode::AUTO: return JSIConverter::toJSI(runtime, "auto"); - case IgnoreSilentSwitchMode::IGNORE: return JSIConverter::toJSI(runtime, "ignore"); - case IgnoreSilentSwitchMode::OBEY: return JSIConverter::toJSI(runtime, "obey"); + case margelo::nitro::video::IgnoreSilentSwitchMode::AUTO: return JSIConverter::toJSI(runtime, "auto"); + case margelo::nitro::video::IgnoreSilentSwitchMode::IGNORE: return JSIConverter::toJSI(runtime, "ignore"); + case margelo::nitro::video::IgnoreSilentSwitchMode::OBEY: return JSIConverter::toJSI(runtime, "obey"); default: [[unlikely]] throw std::invalid_argument("Cannot convert IgnoreSilentSwitchMode to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/MixAudioMode.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/MixAudioMode.hpp index 859c996a..2b36d2d0 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/MixAudioMode.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/MixAudioMode.hpp @@ -39,28 +39,26 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ MixAudioMode <> JS MixAudioMode (union) template <> - struct JSIConverter final { - static inline MixAudioMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::MixAudioMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("mixWithOthers"): return MixAudioMode::MIXWITHOTHERS; - case hashString("doNotMix"): return MixAudioMode::DONOTMIX; - case hashString("duckOthers"): return MixAudioMode::DUCKOTHERS; - case hashString("auto"): return MixAudioMode::AUTO; + case hashString("mixWithOthers"): return margelo::nitro::video::MixAudioMode::MIXWITHOTHERS; + case hashString("doNotMix"): return margelo::nitro::video::MixAudioMode::DONOTMIX; + case hashString("duckOthers"): return margelo::nitro::video::MixAudioMode::DUCKOTHERS; + case hashString("auto"): return margelo::nitro::video::MixAudioMode::AUTO; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MixAudioMode - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, MixAudioMode arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::MixAudioMode arg) { switch (arg) { - case MixAudioMode::MIXWITHOTHERS: return JSIConverter::toJSI(runtime, "mixWithOthers"); - case MixAudioMode::DONOTMIX: return JSIConverter::toJSI(runtime, "doNotMix"); - case MixAudioMode::DUCKOTHERS: return JSIConverter::toJSI(runtime, "duckOthers"); - case MixAudioMode::AUTO: return JSIConverter::toJSI(runtime, "auto"); + case margelo::nitro::video::MixAudioMode::MIXWITHOTHERS: return JSIConverter::toJSI(runtime, "mixWithOthers"); + case margelo::nitro::video::MixAudioMode::DONOTMIX: return JSIConverter::toJSI(runtime, "doNotMix"); + case margelo::nitro::video::MixAudioMode::DUCKOTHERS: return JSIConverter::toJSI(runtime, "duckOthers"); + case margelo::nitro::video::MixAudioMode::AUTO: return JSIConverter::toJSI(runtime, "auto"); default: [[unlikely]] throw std::invalid_argument("Cannot convert MixAudioMode to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/NativeDrmParams.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/NativeDrmParams.hpp new file mode 100644 index 00000000..a4f2941e --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/shared/c++/NativeDrmParams.hpp @@ -0,0 +1,97 @@ +/// +/// NativeDrmParams.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + +// Forward declaration of `OnGetLicensePayload` to properly resolve imports. +namespace margelo::nitro::video { struct OnGetLicensePayload; } + +#include +#include +#include +#include +#include "OnGetLicensePayload.hpp" +#include + +namespace margelo::nitro::video { + + /** + * A struct which can be represented as a JavaScript object (NativeDrmParams). + */ + struct NativeDrmParams { + public: + std::optional type SWIFT_PRIVATE; + std::optional licenseUrl SWIFT_PRIVATE; + std::optional certificateUrl SWIFT_PRIVATE; + std::optional contentId SWIFT_PRIVATE; + std::optional> licenseHeaders SWIFT_PRIVATE; + std::optional multiSession SWIFT_PRIVATE; + std::optional>>>(const OnGetLicensePayload& /* payload */)>> getLicense SWIFT_PRIVATE; + + public: + NativeDrmParams() = default; + explicit NativeDrmParams(std::optional type, std::optional licenseUrl, std::optional certificateUrl, std::optional contentId, std::optional> licenseHeaders, std::optional multiSession, std::optional>>>(const OnGetLicensePayload& /* payload */)>> getLicense): type(type), licenseUrl(licenseUrl), certificateUrl(certificateUrl), contentId(contentId), licenseHeaders(licenseHeaders), multiSession(multiSession), getLicense(getLicense) {} + }; + +} // namespace margelo::nitro::video + +namespace margelo::nitro { + + // C++ NativeDrmParams <> JS NativeDrmParams (object) + template <> + struct JSIConverter final { + static inline margelo::nitro::video::NativeDrmParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + jsi::Object obj = arg.asObject(runtime); + return margelo::nitro::video::NativeDrmParams( + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "type")), + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "licenseUrl")), + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "certificateUrl")), + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "contentId")), + JSIConverter>>::fromJSI(runtime, obj.getProperty(runtime, "licenseHeaders")), + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "multiSession")), + JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::fromJSI(runtime, obj.getProperty(runtime, "getLicense")) + ); + } + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::NativeDrmParams& arg) { + jsi::Object obj(runtime); + obj.setProperty(runtime, "type", JSIConverter>::toJSI(runtime, arg.type)); + obj.setProperty(runtime, "licenseUrl", JSIConverter>::toJSI(runtime, arg.licenseUrl)); + obj.setProperty(runtime, "certificateUrl", JSIConverter>::toJSI(runtime, arg.certificateUrl)); + obj.setProperty(runtime, "contentId", JSIConverter>::toJSI(runtime, arg.contentId)); + obj.setProperty(runtime, "licenseHeaders", JSIConverter>>::toJSI(runtime, arg.licenseHeaders)); + obj.setProperty(runtime, "multiSession", JSIConverter>::toJSI(runtime, arg.multiSession)); + obj.setProperty(runtime, "getLicense", JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::toJSI(runtime, arg.getLicense)); + return obj; + } + static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { + if (!value.isObject()) { + return false; + } + jsi::Object obj = value.getObject(runtime); + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "licenseUrl"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "certificateUrl"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "contentId"))) return false; + if (!JSIConverter>>::canConvert(runtime, obj.getProperty(runtime, "licenseHeaders"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "multiSession"))) return false; + if (!JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::canConvert(runtime, obj.getProperty(runtime, "getLicense"))) return false; + return true; + } + }; + +} // namespace margelo::nitro diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/NativeExternalSubtitle.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/NativeExternalSubtitle.hpp index b02682df..593186bf 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/NativeExternalSubtitle.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/NativeExternalSubtitle.hpp @@ -45,25 +45,23 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ NativeExternalSubtitle <> JS NativeExternalSubtitle (object) template <> - struct JSIConverter final { - static inline NativeExternalSubtitle fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::NativeExternalSubtitle fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return NativeExternalSubtitle( + return margelo::nitro::video::NativeExternalSubtitle( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "uri")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "label")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "type")), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "type")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "language")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const NativeExternalSubtitle& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::NativeExternalSubtitle& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "uri", JSIConverter::toJSI(runtime, arg.uri)); obj.setProperty(runtime, "label", JSIConverter::toJSI(runtime, arg.label)); - obj.setProperty(runtime, "type", JSIConverter::toJSI(runtime, arg.type)); + obj.setProperty(runtime, "type", JSIConverter::toJSI(runtime, arg.type)); obj.setProperty(runtime, "language", JSIConverter::toJSI(runtime, arg.language)); return obj; } @@ -74,7 +72,7 @@ namespace margelo::nitro { jsi::Object obj = value.getObject(runtime); if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "uri"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "label"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "language"))) return false; return true; } diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/NativeVideoConfig.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/NativeVideoConfig.hpp index 29fc2040..70964113 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/NativeVideoConfig.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/NativeVideoConfig.hpp @@ -20,11 +20,14 @@ // Forward declaration of `NativeExternalSubtitle` to properly resolve imports. namespace margelo::nitro::video { struct NativeExternalSubtitle; } +// Forward declaration of `NativeDrmParams` to properly resolve imports. +namespace margelo::nitro::video { struct NativeDrmParams; } #include #include "NativeExternalSubtitle.hpp" #include #include +#include "NativeDrmParams.hpp" #include namespace margelo::nitro::video { @@ -36,34 +39,35 @@ namespace margelo::nitro::video { public: std::string uri SWIFT_PRIVATE; std::optional> externalSubtitles SWIFT_PRIVATE; + std::optional drm SWIFT_PRIVATE; std::optional> headers SWIFT_PRIVATE; public: NativeVideoConfig() = default; - explicit NativeVideoConfig(std::string uri, std::optional> externalSubtitles, std::optional> headers): uri(uri), externalSubtitles(externalSubtitles), headers(headers) {} + explicit NativeVideoConfig(std::string uri, std::optional> externalSubtitles, std::optional drm, std::optional> headers): uri(uri), externalSubtitles(externalSubtitles), drm(drm), headers(headers) {} }; } // namespace margelo::nitro::video namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ NativeVideoConfig <> JS NativeVideoConfig (object) template <> - struct JSIConverter final { - static inline NativeVideoConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::NativeVideoConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return NativeVideoConfig( + return margelo::nitro::video::NativeVideoConfig( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "uri")), - JSIConverter>>::fromJSI(runtime, obj.getProperty(runtime, "externalSubtitles")), + JSIConverter>>::fromJSI(runtime, obj.getProperty(runtime, "externalSubtitles")), + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "drm")), JSIConverter>>::fromJSI(runtime, obj.getProperty(runtime, "headers")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const NativeVideoConfig& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::NativeVideoConfig& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "uri", JSIConverter::toJSI(runtime, arg.uri)); - obj.setProperty(runtime, "externalSubtitles", JSIConverter>>::toJSI(runtime, arg.externalSubtitles)); + obj.setProperty(runtime, "externalSubtitles", JSIConverter>>::toJSI(runtime, arg.externalSubtitles)); + obj.setProperty(runtime, "drm", JSIConverter>::toJSI(runtime, arg.drm)); obj.setProperty(runtime, "headers", JSIConverter>>::toJSI(runtime, arg.headers)); return obj; } @@ -73,7 +77,8 @@ namespace margelo::nitro { } jsi::Object obj = value.getObject(runtime); if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "uri"))) return false; - if (!JSIConverter>>::canConvert(runtime, obj.getProperty(runtime, "externalSubtitles"))) return false; + if (!JSIConverter>>::canConvert(runtime, obj.getProperty(runtime, "externalSubtitles"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "drm"))) return false; if (!JSIConverter>>::canConvert(runtime, obj.getProperty(runtime, "headers"))) return false; return true; } diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/OnGetLicensePayload.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/OnGetLicensePayload.hpp new file mode 100644 index 00000000..3ed04ab7 --- /dev/null +++ b/packages/react-native-video/nitrogen/generated/shared/c++/OnGetLicensePayload.hpp @@ -0,0 +1,79 @@ +/// +/// OnGetLicensePayload.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2025 Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + + + +#include + +namespace margelo::nitro::video { + + /** + * A struct which can be represented as a JavaScript object (OnGetLicensePayload). + */ + struct OnGetLicensePayload { + public: + std::string contentId SWIFT_PRIVATE; + std::string licenseUrl SWIFT_PRIVATE; + std::string keyUrl SWIFT_PRIVATE; + std::string spc SWIFT_PRIVATE; + + public: + OnGetLicensePayload() = default; + explicit OnGetLicensePayload(std::string contentId, std::string licenseUrl, std::string keyUrl, std::string spc): contentId(contentId), licenseUrl(licenseUrl), keyUrl(keyUrl), spc(spc) {} + }; + +} // namespace margelo::nitro::video + +namespace margelo::nitro { + + // C++ OnGetLicensePayload <> JS OnGetLicensePayload (object) + template <> + struct JSIConverter final { + static inline margelo::nitro::video::OnGetLicensePayload fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + jsi::Object obj = arg.asObject(runtime); + return margelo::nitro::video::OnGetLicensePayload( + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "contentId")), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "licenseUrl")), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "keyUrl")), + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "spc")) + ); + } + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::OnGetLicensePayload& arg) { + jsi::Object obj(runtime); + obj.setProperty(runtime, "contentId", JSIConverter::toJSI(runtime, arg.contentId)); + obj.setProperty(runtime, "licenseUrl", JSIConverter::toJSI(runtime, arg.licenseUrl)); + obj.setProperty(runtime, "keyUrl", JSIConverter::toJSI(runtime, arg.keyUrl)); + obj.setProperty(runtime, "spc", JSIConverter::toJSI(runtime, arg.spc)); + return obj; + } + static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { + if (!value.isObject()) { + return false; + } + jsi::Object obj = value.getObject(runtime); + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "contentId"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "licenseUrl"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "keyUrl"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "spc"))) return false; + return true; + } + }; + +} // namespace margelo::nitro diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/ResizeMode.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/ResizeMode.hpp index 5eb82b60..c1db4467 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/ResizeMode.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/ResizeMode.hpp @@ -39,28 +39,26 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ ResizeMode <> JS ResizeMode (union) template <> - struct JSIConverter final { - static inline ResizeMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::ResizeMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("contain"): return ResizeMode::CONTAIN; - case hashString("cover"): return ResizeMode::COVER; - case hashString("stretch"): return ResizeMode::STRETCH; - case hashString("none"): return ResizeMode::NONE; + case hashString("contain"): return margelo::nitro::video::ResizeMode::CONTAIN; + case hashString("cover"): return margelo::nitro::video::ResizeMode::COVER; + case hashString("stretch"): return margelo::nitro::video::ResizeMode::STRETCH; + case hashString("none"): return margelo::nitro::video::ResizeMode::NONE; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ResizeMode - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, ResizeMode arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::ResizeMode arg) { switch (arg) { - case ResizeMode::CONTAIN: return JSIConverter::toJSI(runtime, "contain"); - case ResizeMode::COVER: return JSIConverter::toJSI(runtime, "cover"); - case ResizeMode::STRETCH: return JSIConverter::toJSI(runtime, "stretch"); - case ResizeMode::NONE: return JSIConverter::toJSI(runtime, "none"); + case margelo::nitro::video::ResizeMode::CONTAIN: return JSIConverter::toJSI(runtime, "contain"); + case margelo::nitro::video::ResizeMode::COVER: return JSIConverter::toJSI(runtime, "cover"); + case margelo::nitro::video::ResizeMode::STRETCH: return JSIConverter::toJSI(runtime, "stretch"); + case margelo::nitro::video::ResizeMode::NONE: return JSIConverter::toJSI(runtime, "none"); default: [[unlikely]] throw std::invalid_argument("Cannot convert ResizeMode to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/SourceType.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/SourceType.hpp index 0035f544..31ea01d2 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/SourceType.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/SourceType.hpp @@ -37,24 +37,22 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ SourceType <> JS SourceType (union) template <> - struct JSIConverter final { - static inline SourceType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::SourceType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("local"): return SourceType::LOCAL; - case hashString("network"): return SourceType::NETWORK; + case hashString("local"): return margelo::nitro::video::SourceType::LOCAL; + case hashString("network"): return margelo::nitro::video::SourceType::NETWORK; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum SourceType - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, SourceType arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::SourceType arg) { switch (arg) { - case SourceType::LOCAL: return JSIConverter::toJSI(runtime, "local"); - case SourceType::NETWORK: return JSIConverter::toJSI(runtime, "network"); + case margelo::nitro::video::SourceType::LOCAL: return JSIConverter::toJSI(runtime, "local"); + case margelo::nitro::video::SourceType::NETWORK: return JSIConverter::toJSI(runtime, "network"); default: [[unlikely]] throw std::invalid_argument("Cannot convert SourceType to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/SubtitleType.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/SubtitleType.hpp index c75a4ce1..f76312a3 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/SubtitleType.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/SubtitleType.hpp @@ -40,30 +40,28 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ SubtitleType <> JS SubtitleType (union) template <> - struct JSIConverter final { - static inline SubtitleType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::SubtitleType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("auto"): return SubtitleType::AUTO; - case hashString("vtt"): return SubtitleType::VTT; - case hashString("srt"): return SubtitleType::SRT; - case hashString("ssa"): return SubtitleType::SSA; - case hashString("ass"): return SubtitleType::ASS; + case hashString("auto"): return margelo::nitro::video::SubtitleType::AUTO; + case hashString("vtt"): return margelo::nitro::video::SubtitleType::VTT; + case hashString("srt"): return margelo::nitro::video::SubtitleType::SRT; + case hashString("ssa"): return margelo::nitro::video::SubtitleType::SSA; + case hashString("ass"): return margelo::nitro::video::SubtitleType::ASS; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum SubtitleType - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, SubtitleType arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::SubtitleType arg) { switch (arg) { - case SubtitleType::AUTO: return JSIConverter::toJSI(runtime, "auto"); - case SubtitleType::VTT: return JSIConverter::toJSI(runtime, "vtt"); - case SubtitleType::SRT: return JSIConverter::toJSI(runtime, "srt"); - case SubtitleType::SSA: return JSIConverter::toJSI(runtime, "ssa"); - case SubtitleType::ASS: return JSIConverter::toJSI(runtime, "ass"); + case margelo::nitro::video::SubtitleType::AUTO: return JSIConverter::toJSI(runtime, "auto"); + case margelo::nitro::video::SubtitleType::VTT: return JSIConverter::toJSI(runtime, "vtt"); + case margelo::nitro::video::SubtitleType::SRT: return JSIConverter::toJSI(runtime, "srt"); + case margelo::nitro::video::SubtitleType::SSA: return JSIConverter::toJSI(runtime, "ssa"); + case margelo::nitro::video::SubtitleType::ASS: return JSIConverter::toJSI(runtime, "ass"); default: [[unlikely]] throw std::invalid_argument("Cannot convert SubtitleType to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/TextTrack.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/TextTrack.hpp index 8124a61c..94b15f79 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/TextTrack.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/TextTrack.hpp @@ -44,21 +44,19 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ TextTrack <> JS TextTrack (object) template <> - struct JSIConverter final { - static inline TextTrack fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::TextTrack fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return TextTrack( + return margelo::nitro::video::TextTrack( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "id")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "label")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "language")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "selected")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const TextTrack& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::TextTrack& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "id", JSIConverter::toJSI(runtime, arg.id)); obj.setProperty(runtime, "label", JSIConverter::toJSI(runtime, arg.label)); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadata.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadata.hpp index 8d3c9ddb..6fe6b661 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadata.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadata.hpp @@ -42,20 +42,18 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ TimedMetadata <> JS TimedMetadata (object) template <> - struct JSIConverter final { - static inline TimedMetadata fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::TimedMetadata fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return TimedMetadata( - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "metadata")) + return margelo::nitro::video::TimedMetadata( + JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "metadata")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const TimedMetadata& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::TimedMetadata& arg) { jsi::Object obj(runtime); - obj.setProperty(runtime, "metadata", JSIConverter>::toJSI(runtime, arg.metadata)); + obj.setProperty(runtime, "metadata", JSIConverter>::toJSI(runtime, arg.metadata)); return obj; } static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { @@ -63,7 +61,7 @@ namespace margelo::nitro { return false; } jsi::Object obj = value.getObject(runtime); - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false; + if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "metadata"))) return false; return true; } }; diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadataObject.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadataObject.hpp index a49ebd17..a9760760 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadataObject.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/TimedMetadataObject.hpp @@ -41,19 +41,17 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ TimedMetadataObject <> JS TimedMetadataObject (object) template <> - struct JSIConverter final { - static inline TimedMetadataObject fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::TimedMetadataObject fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return TimedMetadataObject( + return margelo::nitro::video::TimedMetadataObject( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "value")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "identifier")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const TimedMetadataObject& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::TimedMetadataObject& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "value", JSIConverter::toJSI(runtime, arg.value)); obj.setProperty(runtime, "identifier", JSIConverter::toJSI(runtime, arg.identifier)); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/VideoInformation.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/VideoInformation.hpp index d6ce428b..fea666f2 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/VideoInformation.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/VideoInformation.hpp @@ -48,14 +48,12 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ VideoInformation <> JS VideoInformation (object) template <> - struct JSIConverter final { - static inline VideoInformation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::VideoInformation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return VideoInformation( + return margelo::nitro::video::VideoInformation( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bitrate")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "width")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "height")), @@ -63,10 +61,10 @@ namespace margelo::nitro { JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "fileSize")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "isHDR")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "isLive")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "orientation")) + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "orientation")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const VideoInformation& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::VideoInformation& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "bitrate", JSIConverter::toJSI(runtime, arg.bitrate)); obj.setProperty(runtime, "width", JSIConverter::toJSI(runtime, arg.width)); @@ -75,7 +73,7 @@ namespace margelo::nitro { obj.setProperty(runtime, "fileSize", JSIConverter::toJSI(runtime, arg.fileSize)); obj.setProperty(runtime, "isHDR", JSIConverter::toJSI(runtime, arg.isHDR)); obj.setProperty(runtime, "isLive", JSIConverter::toJSI(runtime, arg.isLive)); - obj.setProperty(runtime, "orientation", JSIConverter::toJSI(runtime, arg.orientation)); + obj.setProperty(runtime, "orientation", JSIConverter::toJSI(runtime, arg.orientation)); return obj; } static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { @@ -90,7 +88,7 @@ namespace margelo::nitro { if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "fileSize"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "isHDR"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "isLive"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "orientation"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "orientation"))) return false; return true; } }; diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/VideoOrientation.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/VideoOrientation.hpp index 475f039e..2d9444ce 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/VideoOrientation.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/VideoOrientation.hpp @@ -42,34 +42,32 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ VideoOrientation <> JS VideoOrientation (union) template <> - struct JSIConverter final { - static inline VideoOrientation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::VideoOrientation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("portrait"): return VideoOrientation::PORTRAIT; - case hashString("landscape"): return VideoOrientation::LANDSCAPE; - case hashString("portrait-upside-down"): return VideoOrientation::PORTRAIT_UPSIDE_DOWN; - case hashString("landscape-left"): return VideoOrientation::LANDSCAPE_LEFT; - case hashString("landscape-right"): return VideoOrientation::LANDSCAPE_RIGHT; - case hashString("square"): return VideoOrientation::SQUARE; - case hashString("unknown"): return VideoOrientation::UNKNOWN; + case hashString("portrait"): return margelo::nitro::video::VideoOrientation::PORTRAIT; + case hashString("landscape"): return margelo::nitro::video::VideoOrientation::LANDSCAPE; + case hashString("portrait-upside-down"): return margelo::nitro::video::VideoOrientation::PORTRAIT_UPSIDE_DOWN; + case hashString("landscape-left"): return margelo::nitro::video::VideoOrientation::LANDSCAPE_LEFT; + case hashString("landscape-right"): return margelo::nitro::video::VideoOrientation::LANDSCAPE_RIGHT; + case hashString("square"): return margelo::nitro::video::VideoOrientation::SQUARE; + case hashString("unknown"): return margelo::nitro::video::VideoOrientation::UNKNOWN; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum VideoOrientation - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, VideoOrientation arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::VideoOrientation arg) { switch (arg) { - case VideoOrientation::PORTRAIT: return JSIConverter::toJSI(runtime, "portrait"); - case VideoOrientation::LANDSCAPE: return JSIConverter::toJSI(runtime, "landscape"); - case VideoOrientation::PORTRAIT_UPSIDE_DOWN: return JSIConverter::toJSI(runtime, "portrait-upside-down"); - case VideoOrientation::LANDSCAPE_LEFT: return JSIConverter::toJSI(runtime, "landscape-left"); - case VideoOrientation::LANDSCAPE_RIGHT: return JSIConverter::toJSI(runtime, "landscape-right"); - case VideoOrientation::SQUARE: return JSIConverter::toJSI(runtime, "square"); - case VideoOrientation::UNKNOWN: return JSIConverter::toJSI(runtime, "unknown"); + case margelo::nitro::video::VideoOrientation::PORTRAIT: return JSIConverter::toJSI(runtime, "portrait"); + case margelo::nitro::video::VideoOrientation::LANDSCAPE: return JSIConverter::toJSI(runtime, "landscape"); + case margelo::nitro::video::VideoOrientation::PORTRAIT_UPSIDE_DOWN: return JSIConverter::toJSI(runtime, "portrait-upside-down"); + case margelo::nitro::video::VideoOrientation::LANDSCAPE_LEFT: return JSIConverter::toJSI(runtime, "landscape-left"); + case margelo::nitro::video::VideoOrientation::LANDSCAPE_RIGHT: return JSIConverter::toJSI(runtime, "landscape-right"); + case margelo::nitro::video::VideoOrientation::SQUARE: return JSIConverter::toJSI(runtime, "square"); + case margelo::nitro::video::VideoOrientation::UNKNOWN: return JSIConverter::toJSI(runtime, "unknown"); default: [[unlikely]] throw std::invalid_argument("Cannot convert VideoOrientation to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/VideoPlayerStatus.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/VideoPlayerStatus.hpp index 33ed515d..aeb15403 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/VideoPlayerStatus.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/VideoPlayerStatus.hpp @@ -39,28 +39,26 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ VideoPlayerStatus <> JS VideoPlayerStatus (union) template <> - struct JSIConverter final { - static inline VideoPlayerStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::VideoPlayerStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { std::string unionValue = JSIConverter::fromJSI(runtime, arg); switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("idle"): return VideoPlayerStatus::IDLE; - case hashString("loading"): return VideoPlayerStatus::LOADING; - case hashString("readyToPlay"): return VideoPlayerStatus::READYTOPLAY; - case hashString("error"): return VideoPlayerStatus::ERROR; + case hashString("idle"): return margelo::nitro::video::VideoPlayerStatus::IDLE; + case hashString("loading"): return margelo::nitro::video::VideoPlayerStatus::LOADING; + case hashString("readyToPlay"): return margelo::nitro::video::VideoPlayerStatus::READYTOPLAY; + case hashString("error"): return margelo::nitro::video::VideoPlayerStatus::ERROR; default: [[unlikely]] throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum VideoPlayerStatus - invalid value!"); } } - static inline jsi::Value toJSI(jsi::Runtime& runtime, VideoPlayerStatus arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::video::VideoPlayerStatus arg) { switch (arg) { - case VideoPlayerStatus::IDLE: return JSIConverter::toJSI(runtime, "idle"); - case VideoPlayerStatus::LOADING: return JSIConverter::toJSI(runtime, "loading"); - case VideoPlayerStatus::READYTOPLAY: return JSIConverter::toJSI(runtime, "readyToPlay"); - case VideoPlayerStatus::ERROR: return JSIConverter::toJSI(runtime, "error"); + case margelo::nitro::video::VideoPlayerStatus::IDLE: return JSIConverter::toJSI(runtime, "idle"); + case margelo::nitro::video::VideoPlayerStatus::LOADING: return JSIConverter::toJSI(runtime, "loading"); + case margelo::nitro::video::VideoPlayerStatus::READYTOPLAY: return JSIConverter::toJSI(runtime, "readyToPlay"); + case margelo::nitro::video::VideoPlayerStatus::ERROR: return JSIConverter::toJSI(runtime, "error"); default: [[unlikely]] throw std::invalid_argument("Cannot convert VideoPlayerStatus to JS - invalid value: " + std::to_string(static_cast(arg)) + "!"); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/onLoadData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/onLoadData.hpp index b9059cf2..6cd3bc6e 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/onLoadData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/onLoadData.hpp @@ -45,28 +45,26 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ onLoadData <> JS onLoadData (object) template <> - struct JSIConverter final { - static inline onLoadData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::onLoadData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return onLoadData( + return margelo::nitro::video::onLoadData( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "currentTime")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "duration")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "height")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "width")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "orientation")) + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "orientation")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const onLoadData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::onLoadData& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "currentTime", JSIConverter::toJSI(runtime, arg.currentTime)); obj.setProperty(runtime, "duration", JSIConverter::toJSI(runtime, arg.duration)); obj.setProperty(runtime, "height", JSIConverter::toJSI(runtime, arg.height)); obj.setProperty(runtime, "width", JSIConverter::toJSI(runtime, arg.width)); - obj.setProperty(runtime, "orientation", JSIConverter::toJSI(runtime, arg.orientation)); + obj.setProperty(runtime, "orientation", JSIConverter::toJSI(runtime, arg.orientation)); return obj; } static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { @@ -78,7 +76,7 @@ namespace margelo::nitro { if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "height"))) return false; if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "width"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "orientation"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "orientation"))) return false; return true; } }; diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/onLoadStartData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/onLoadStartData.hpp index 41bb5b0d..a0eb6500 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/onLoadStartData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/onLoadStartData.hpp @@ -35,32 +35,30 @@ namespace margelo::nitro::video { struct onLoadStartData { public: SourceType sourceType SWIFT_PRIVATE; - std::shared_ptr source SWIFT_PRIVATE; + std::shared_ptr source SWIFT_PRIVATE; public: onLoadStartData() = default; - explicit onLoadStartData(SourceType sourceType, std::shared_ptr source): sourceType(sourceType), source(source) {} + explicit onLoadStartData(SourceType sourceType, std::shared_ptr source): sourceType(sourceType), source(source) {} }; } // namespace margelo::nitro::video namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ onLoadStartData <> JS onLoadStartData (object) template <> - struct JSIConverter final { - static inline onLoadStartData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::onLoadStartData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return onLoadStartData( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sourceType")), + return margelo::nitro::video::onLoadStartData( + JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sourceType")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "source")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const onLoadStartData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::onLoadStartData& arg) { jsi::Object obj(runtime); - obj.setProperty(runtime, "sourceType", JSIConverter::toJSI(runtime, arg.sourceType)); + obj.setProperty(runtime, "sourceType", JSIConverter::toJSI(runtime, arg.sourceType)); obj.setProperty(runtime, "source", JSIConverter>::toJSI(runtime, arg.source)); return obj; } @@ -69,7 +67,7 @@ namespace margelo::nitro { return false; } jsi::Object obj = value.getObject(runtime); - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sourceType"))) return false; + if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sourceType"))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "source"))) return false; return true; } diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/onPlaybackStateChangeData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/onPlaybackStateChangeData.hpp index fdeef636..cd1cdbaa 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/onPlaybackStateChangeData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/onPlaybackStateChangeData.hpp @@ -41,19 +41,17 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ onPlaybackStateChangeData <> JS onPlaybackStateChangeData (object) template <> - struct JSIConverter final { - static inline onPlaybackStateChangeData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::onPlaybackStateChangeData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return onPlaybackStateChangeData( + return margelo::nitro::video::onPlaybackStateChangeData( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "isPlaying")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "isBuffering")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const onPlaybackStateChangeData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::onPlaybackStateChangeData& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "isPlaying", JSIConverter::toJSI(runtime, arg.isPlaying)); obj.setProperty(runtime, "isBuffering", JSIConverter::toJSI(runtime, arg.isBuffering)); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/onProgressData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/onProgressData.hpp index 65426fea..c641f623 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/onProgressData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/onProgressData.hpp @@ -41,19 +41,17 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ onProgressData <> JS onProgressData (object) template <> - struct JSIConverter final { - static inline onProgressData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::onProgressData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return onProgressData( + return margelo::nitro::video::onProgressData( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "currentTime")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bufferDuration")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const onProgressData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::onProgressData& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "currentTime", JSIConverter::toJSI(runtime, arg.currentTime)); obj.setProperty(runtime, "bufferDuration", JSIConverter::toJSI(runtime, arg.bufferDuration)); diff --git a/packages/react-native-video/nitrogen/generated/shared/c++/onVolumeChangeData.hpp b/packages/react-native-video/nitrogen/generated/shared/c++/onVolumeChangeData.hpp index 45222876..9fb9fd1b 100644 --- a/packages/react-native-video/nitrogen/generated/shared/c++/onVolumeChangeData.hpp +++ b/packages/react-native-video/nitrogen/generated/shared/c++/onVolumeChangeData.hpp @@ -41,19 +41,17 @@ namespace margelo::nitro::video { namespace margelo::nitro { - using namespace margelo::nitro::video; - // C++ onVolumeChangeData <> JS onVolumeChangeData (object) template <> - struct JSIConverter final { - static inline onVolumeChangeData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + struct JSIConverter final { + static inline margelo::nitro::video::onVolumeChangeData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); - return onVolumeChangeData( + return margelo::nitro::video::onVolumeChangeData( JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "volume")), JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "muted")) ); } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const onVolumeChangeData& arg) { + static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::onVolumeChangeData& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "volume", JSIConverter::toJSI(runtime, arg.volume)); obj.setProperty(runtime, "muted", JSIConverter::toJSI(runtime, arg.muted)); diff --git a/packages/react-native-video/package.json b/packages/react-native-video/package.json index e83322dd..a372c17c 100644 --- a/packages/react-native-video/package.json +++ b/packages/react-native-video/package.json @@ -28,6 +28,7 @@ "ios", "cpp", "nitrogen", + "nitro.json", "*.podspec", "react-native.config.js", "app.plugin.js", @@ -51,7 +52,7 @@ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", "prepare": "bun run build", "build": "bob build", - "nitrogen": "nitro-codegen", + "specs": "nitro-codegen", "release": "release-it --preRelease alpha --npm.tag=next" }, "keywords": [ @@ -79,18 +80,15 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.27.0", + "nitro-codegen": "^0.28.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "@react-native/eslint-config": "^0.77.0", "react-native-builder-bob": "^0.40.0", - "react-native-nitro-modules": "^0.27.0", + "react-native-nitro-modules": "^0.28.0", "typescript": "^5.2.2" }, - "resolutions": { - "@types/react": "^18.2.44" - }, "peerDependencies": { "react": "*", "react-native": "*", diff --git a/packages/react-native-video/src/core/types/DrmParams.ts b/packages/react-native-video/src/core/types/DrmParams.ts new file mode 100644 index 00000000..456b8be0 --- /dev/null +++ b/packages/react-native-video/src/core/types/DrmParams.ts @@ -0,0 +1,65 @@ +/** + * Headers type specifically for DRM license requests + */ + +export interface DrmParams { + /** + * The license URL for the DRM license request. + * @platform iOS, visionOS + */ + licenseUrl?: string; + /** + * The certificate URL for the DRM license request. + * @platform iOS, visionOS + */ + certificateUrl?: string; + /** + * The content ID for the DRM license request. + * @platform iOS, visionOS + */ + contentId?: string; + /** + * The type of DRM to use. + * @platform Android, iOS, visionOS + */ + type?: DRMType; + /** + * The headers to send with the DRM license request. + * @platform Android, iOS, visionOS + */ + licenseHeaders?: Record; + /** + * Whether to allow multiple sessions for the DRM license request. + * @platform Android + */ + multiSession?: boolean; + /** + * A function to get the license for the DRM license request. + * @platform iOS + */ + getLicense?: (payload: OnGetLicensePayload) => Promise; +} + +interface OnGetLicensePayload { + /** + * The content ID for the DRM license request. + * This is typically a unique identifier for the content being played. + */ + contentId: string; + /** + * The license URL for the DRM license request. + */ + licenseUrl: string; + /** + * The key URL for the DRM license request. + * Typically starts with starting with skd:// or clearkey:// + */ + keyUrl: string; + /** + * The secure playback context (SPC) for the DRM license request. + * This is typically a base64-encoded string that contains information about the playback environment. + */ + spc: string; +} + +type DRMType = 'widevine' | 'fairplay' | (string & {}); diff --git a/packages/react-native-video/src/core/types/VideoConfig.ts b/packages/react-native-video/src/core/types/VideoConfig.ts index b716a587..14647e34 100644 --- a/packages/react-native-video/src/core/types/VideoConfig.ts +++ b/packages/react-native-video/src/core/types/VideoConfig.ts @@ -1,3 +1,5 @@ +import type { DrmParams } from './DrmParams'; + export type VideoSource = number | string; export type VideoConfig = { @@ -15,6 +17,10 @@ export type VideoConfig = { * The headers to be sent with the request. */ headers?: Record; + /** + * The DRM parameters to be used. + */ + drm?: DrmParams; /** * The external subtitles to be used. * @note on iOS, only WebVTT (.vtt) subtitles are supported (for HLS streams and MP4 files). @@ -45,6 +51,7 @@ export interface NativeVideoConfig extends VideoConfig { // The uri should be resolved to string before creating the source uri: string; externalSubtitles?: NativeExternalSubtitle[]; + drm?: NativeDrmParams; } /** @@ -112,3 +119,7 @@ interface NativeExternalSubtitle { type: SubtitleType; language: string; } + +interface NativeDrmParams extends DrmParams { + type?: string; +} diff --git a/packages/react-native-video/src/core/utils/sourceFactory.ts b/packages/react-native-video/src/core/utils/sourceFactory.ts index 6c531dce..0d83c6e7 100644 --- a/packages/react-native-video/src/core/utils/sourceFactory.ts +++ b/packages/react-native-video/src/core/utils/sourceFactory.ts @@ -1,4 +1,4 @@ -import { Image } from 'react-native'; +import { Image, Platform } from 'react-native'; import { NitroModules } from 'react-native-nitro-modules'; import type { VideoPlayerSource, @@ -56,6 +56,22 @@ export const createSourceFromVideoConfig = ( config.externalSubtitles = parseExternalSubtitles(config.externalSubtitles); } + // Ensure platform-based default for DRM type if DRM is provided without a type + if (config.drm && config.drm.type === undefined) { + const defaultDrmType = Platform.select({ + android: 'widevine', + ios: 'fairplay', + default: undefined, + }); + + if (defaultDrmType) { + config.drm = { + ...config.drm, + type: defaultDrmType, + }; + } + } + try { return VideoPlayerSourceFactory.fromVideoConfig( config as NativeVideoConfig diff --git a/scripts/release.sh b/scripts/release.sh index 6f68c5f5..61a689be 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -16,6 +16,11 @@ cd packages/react-native-video bun run release $@ cd ../.. +echo "[DRM Plugin] Publishing drm plugin" +cd packages/drm-plugin +bun run release $@ +cd ../.. + echo "[React Native Video] Making Github Release" bun run release:github $@