File tree Expand file tree Collapse file tree
packages/google-cloud-videointelligence Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
106106 // const showcaseClient = new showcaseClient({ projectId, customConfig });
107107 opts . clientConfig = opts . clientConfig || { } ;
108108
109- const isBrowser = typeof window !== 'undefined' ;
110- if ( isBrowser ) {
111- opts . fallback = true ;
112- }
113- // If we are in browser, we are already using fallback because of the
114- // "browser" field in package.json.
115- // But if we were explicitly requested to use fallback, let's do it now.
116- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
109+ // If we're running in browser, it's OK to omit `fallback` since
110+ // google-gax has `browser` field in its `package.json`.
111+ // For Electron (which does not respect `browser` field),
112+ // pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
113+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
117114
118115 // Create a `gaxGrpc` object, with any grpc-specific options
119116 // sent to the client.
Original file line number Diff line number Diff line change @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
106106 // const showcaseClient = new showcaseClient({ projectId, customConfig });
107107 opts . clientConfig = opts . clientConfig || { } ;
108108
109- const isBrowser = typeof window !== 'undefined' ;
110- if ( isBrowser ) {
111- opts . fallback = true ;
112- }
113- // If we are in browser, we are already using fallback because of the
114- // "browser" field in package.json.
115- // But if we were explicitly requested to use fallback, let's do it now.
116- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
109+ // If we're running in browser, it's OK to omit `fallback` since
110+ // google-gax has `browser` field in its `package.json`.
111+ // For Electron (which does not respect `browser` field),
112+ // pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
113+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
117114
118115 // Create a `gaxGrpc` object, with any grpc-specific options
119116 // sent to the client.
Original file line number Diff line number Diff line change @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
106106 // const showcaseClient = new showcaseClient({ projectId, customConfig });
107107 opts . clientConfig = opts . clientConfig || { } ;
108108
109- const isBrowser = typeof window !== 'undefined' ;
110- if ( isBrowser ) {
111- opts . fallback = true ;
112- }
113- // If we are in browser, we are already using fallback because of the
114- // "browser" field in package.json.
115- // But if we were explicitly requested to use fallback, let's do it now.
116- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
109+ // If we're running in browser, it's OK to omit `fallback` since
110+ // google-gax has `browser` field in its `package.json`.
111+ // For Electron (which does not respect `browser` field),
112+ // pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
113+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
117114
118115 // Create a `gaxGrpc` object, with any grpc-specific options
119116 // sent to the client.
Original file line number Diff line number Diff line change @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
106106 // const showcaseClient = new showcaseClient({ projectId, customConfig });
107107 opts . clientConfig = opts . clientConfig || { } ;
108108
109- const isBrowser = typeof window !== 'undefined' ;
110- if ( isBrowser ) {
111- opts . fallback = true ;
112- }
113- // If we are in browser, we are already using fallback because of the
114- // "browser" field in package.json.
115- // But if we were explicitly requested to use fallback, let's do it now.
116- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
109+ // If we're running in browser, it's OK to omit `fallback` since
110+ // google-gax has `browser` field in its `package.json`.
111+ // For Electron (which does not respect `browser` field),
112+ // pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
113+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
117114
118115 // Create a `gaxGrpc` object, with any grpc-specific options
119116 // sent to the client.
Original file line number Diff line number Diff line change @@ -99,14 +99,11 @@ export class StreamingVideoIntelligenceServiceClient {
9999 // const showcaseClient = new showcaseClient({ projectId, customConfig });
100100 opts . clientConfig = opts . clientConfig || { } ;
101101
102- const isBrowser = typeof window !== 'undefined' ;
103- if ( isBrowser ) {
104- opts . fallback = true ;
105- }
106- // If we are in browser, we are already using fallback because of the
107- // "browser" field in package.json.
108- // But if we were explicitly requested to use fallback, let's do it now.
109- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
102+ // If we're running in browser, it's OK to omit `fallback` since
103+ // google-gax has `browser` field in its `package.json`.
104+ // For Electron (which does not respect `browser` field),
105+ // pass `{fallback: true}` to the StreamingVideoIntelligenceServiceClient constructor.
106+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
110107
111108 // Create a `gaxGrpc` object, with any grpc-specific options
112109 // sent to the client.
Original file line number Diff line number Diff line change @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
106106 // const showcaseClient = new showcaseClient({ projectId, customConfig });
107107 opts . clientConfig = opts . clientConfig || { } ;
108108
109- const isBrowser = typeof window !== 'undefined' ;
110- if ( isBrowser ) {
111- opts . fallback = true ;
112- }
113- // If we are in browser, we are already using fallback because of the
114- // "browser" field in package.json.
115- // But if we were explicitly requested to use fallback, let's do it now.
116- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
109+ // If we're running in browser, it's OK to omit `fallback` since
110+ // google-gax has `browser` field in its `package.json`.
111+ // For Electron (which does not respect `browser` field),
112+ // pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
113+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
117114
118115 // Create a `gaxGrpc` object, with any grpc-specific options
119116 // sent to the client.
Original file line number Diff line number Diff line change 44 "git": {
55 "name": ".",
66 "remote": "https://github.com/googleapis/nodejs-video-intelligence.git",
7- "sha": "79f411801358ee081969f18db4c96308bd4b1eea "
7+ "sha": "eaee22cabed4bb31842196e0bcb2610daafc6f1c "
88 }
99 },
1010 {
1919 "git": {
2020 "name": "synthtool",
2121 "remote": "https://github.com/googleapis/synthtool.git",
22- "sha": "1c92077459db3dc50741e878f98b08c6261181e0 "
22+ "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469 "
2323 }
2424 }
2525 ],
You can’t perform that action at this time.
0 commit comments