How to use the SDK without the dependency on a main video - google-ima

I am trying to put an ad without the need to put a video,
I tried to remove the video in the function and in the html view, but I get this error:
TypeError: Cannot read properties of undefined (reading 'init')
Code
adsManager.init(640, 360, google.ima.ViewMode.NORMAL);

Related

Odoo v15 LiveChat App will not load properly

I have a website built on Odoo v15 Enterprise Edition (SaaS, hosted by Odoo) and I would like to activate the LiveChat feature of the website. I created a sandbox to work in so I do not affect the live website.
I followed the instructions from the Odoo Documentation and did the following:
Opened the LiveChat channel (LiveChat App > Channels) and added myself as an Operator.
Copied the code snippet from the "Widget" tab (inside the LiveChat channel) and pasted it into the <head> of my website.
Clicked on the "Go To Website" button in the top right corner of the LiveChat Channel, and then clicked on the "Unpublished" button at the top right of the screen (which changed to "Published".)
Went into the "Settings" (Settings > Website > Features > Live Chat) and chose the channel from the dropdown.
When I go to the homepage of my website I do not see a chat button and when I open the Console in Developer Tools (Chrome browser) I see these error messages:
Plain Text:
web.assets_common_minimal.min.js:85 warning: Some modules could not be started
web.assets_common_minimal.min.js:85 Missing dependencies: (3) ['web.Session', 'root.widget', 'im_livechat.legacy.im_livechat.im_livechat']
web.assets_common_minimal.min.js:90 Non loaded modules: (2) ['web.session', 'im_livechat.livesupport']
web.assets_common_minimal.min.js:91 Debug: {web.session: {…}, im_livechat.livesupport: {…}}
web.assets_common_minimal.min.js:78 Uncaught Error: Service web.session already defined
at odoo.define (web.assets_common_minimal.min.js:78:29)
at web.assets_frontend_lazy.min.js:1594:6
It looks like web.session has already been defined. When I located the .xml file that contained the code for this (im_livechat.loader), I found it contained the following:
<t t-if="web_session_required">
odoo.define('web.session', function (require) {
var Session = require('web.Session');
var modules = odoo._modules;
return new Session(undefined, "<t t-esc="info['server_url']"/>", {modules:modules, use_cors: true});
});
</t>
Just to see what would happen, I commented out this section of the im_livechat.loader file and reloaded the homepage. The button was now visible, but was clearly not showing up the way it should be:
I also saw an error pop up (URL has been removed):
UncaughtPromiseError > TypeError
Uncaught Promise > Cannot read properties of undefined (reading 'bus_service')
TypeError: Cannot read properties of undefined (reading 'bus_service')
at ComponentAdapter._trigger_up (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:1565:32)
at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
at Class.trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:280)
at Class.call (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4781:372)
at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2264:6)
at prototype.<computed> (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4581:488)
at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2346:77)
at Class.start (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4584:371)
at https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4929:52
When I check the Console in Developer Tools I see this error:
Plain Text:
web.assets_frontend_lazy.min.js:1565 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bus_service')
at ComponentAdapter._trigger_up (web.assets_frontend_lazy.min.js:1565:32)
at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
at Class.trigger_up (web.assets_common_lazy.min.js:4728:280)
at Class.call (web.assets_common_lazy.min.js:4781:372)
at Class.start (web.assets_frontend_lazy.min.js:2264:6)
at prototype.<computed> (web.assets_common_lazy.min.js:4581:488)
at Class.start (web.assets_frontend_lazy.min.js:2346:77)
at Class.start (web.assets_common_lazy.min.js:4584:371)
at web.assets_common_lazy.min.js:4929:52
Can anyone point me in the right direction? Any help would be greatly appreciated.
Thank you!
We did end up solving this issue.
Apparently there was an older view (named "Livechat: include loader on Website") which was deactivated, but still causing issues with the way the code for the chat button was being loaded. We think it was an older view from a previous version of Odoo (we are currently running v15.)
After deleting the deactivated view the chat window began showing up correctly and everything worked as expected.

Error creating an expo's Audio.Sound from blob

I have a backend that can delivers audio or image files (audio/x-m4a or image/jpeg) so I have to show them on my react-native/expo app. So I have something like this:
In line 19 I'm getting a blob from the backend and on line 21 and getting its URI.
So when I call this component for two images and one audio I get this:
blob:7E5FD45B-B10F-447B-B37C-D429DBA72871?offset=0&size=96665
blob:0A1BD6A2-C5B0-40C4-BB77-9A5F4A0E52B7?offset=0&size=281234
blob:6E7EB36F-FBC0-4F34-ADAC-864F0F5B75DF?offset=0&size=816812
I'm not sure how URI works on mobile but these URI are pretty weird for me...
Them in line 25 I'm trying to load an expo's Audio.Sound but I get this error:
[Unhandled promise rejection: Error: The AVPlayerItem instance has failed with the error code -1002 and domain "NSURLErrorDomain".]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:50 in promiseMethodWrapper
at node_modules/expo-modules-core/build/NativeModulesProxy.native.js:27:27 in moduleName.methodInfo.name
at http://192.168.1.33:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:307121:50 in <unknown>
at node_modules/expo-av/build/Audio/Sound.js:136:34 in loadAsync
However I'm able to successfully show the image with line 38.
Any suggestion for the audio sound?

VideoJs formatTime is undefined

I'm using videojs and want to use the function as per docs formatTime, but I get as result undefined
I don't use npm package of videojs, instead, I have referenced the minified version 7.6.5 direct in my code.
Is there any extra file I should reference in this case?
It's a method on videojs, not the player instance:
videojs.formatTime(100);
> "1:40"

Can't display an alert using MessageBox in Sencha Touch 2

In a handler in one of my controllers, I'm running into issues displaying a simple alert message. Using Sencha Touch 2.4.1
Ext.Msg.alert('Status', 'test');
--> "Uncaught TypeError: Cannot read property 'alert' of undefined"
As per these instructions, I added the following require statement: Ext.window.MessageBox to my controller.
--> Failed to find any files for /PATH/FILE.js::ClassRequire::Ext.window.MessageBox
Replaced Msg with MessageBox and removed require statement.
Ext.MessageBox.alert('Status', 'test')
--> "Uncaught TypeError: undefined is not a function"
Ran into the same problem when using .confirm.
Here's the docs - looks like it should work.
Anybody know why it doesn't?
I needed to require Ext.MessageBox instead of Ext.window.MessageBox and had to use Ext.Msg.alert... instead of Ext.MessageBox.alert... though I'm not totally clear on why.
Saw this in the docs: "The framework provides a global singleton Ext.Msg for common usage which you should use in most cases."

CasperJS screenshot comes as blank after selecting a link

Using casperJS script, after successful login into application, and clicking on a link, following error is thrown and web page comes as blank:
ERROR: TypeError: 'undefined' is not a function (evaluating
'g.getItem.bind(g)')
TRACE:
-> scripts/dojo/dojo/dojo.js: 20
ERROR: TypeError: 'undefined' is not a function (evaluating
'g.getItem.bind(g)')
The application is build on top of dojo.
You’ve written some code that tries to use Function.prototype.bind. Function.prototype.bind doesn’t exist in PhantomJS. You need to change your code to use dojo/_base/lang.hitch instead.