CreateJS - Issue loading sounds in IE11 - createjs

I've run across a weird issue with sound file loading in IE11. I have a manifest of about a dozen images and then about 8 sound files. What's happening is versions of IE11 that have even the slightest modifications in the security settings are hanging up when trying to load the sound files. No errors, it just hangs. Any ideas?
Code below. Working fine in Chrome, Safari, FireFox and most IEs. Just some instances it loading everything up until the sounds and then it just stops.
var imagePath = "Game/images/";
var audioPath = "Game/sounds/";
manifest = [
{ src: imagePath + "BG.png", id: "bgImg" },
{ src: imagePath + "Game-Sign.png", id: "gameSign" },
{ src: imagePath + "Start-Title.png", id: "startTitle" },
{ src: imagePath + "Start-Button-Sprite.png", id: "btnStart" },
{ src: imagePath + "Continue-Button-Sprite.png", id: "btnContinue" },
{ src: audioPath + "clunk01.mp3", id: "sndClunk01" },
{ src: audioPath + "clunk02.mp3", id: "sndClunk02" },
{ src: audioPath + "clunk03.mp3", id: "sndClunk03" }
];
var queue;
queue = new createjs.LoadQueue(true);
queue.installPlugin(createjs.Sound);
createjs.Sound.alternateExtensions = ["ogg"];
queue.addEventListener("complete", handleComplete);
queue.loadManifest(manifest);

The code looks fine. There were some bugs in handle errors in the 0.6.0 versions, can you try SoundJS-Next with PreloadJS-Next and let me know if that fixes the hanging issue.
Hope that helps.

Related

Attempting to convert a prefix command to a slash command - getting "This interaction failed."

Basically, I'm converting one of my regular commands into a slash command. It's just an embedded response, but the issue is that it says "This interaction failed". I read on deferReply(), but deferReply doesn't work for me at all, it's supposed to say "bot is thinking.." but doesn't. It does the 3 second "Sending command..." then fails.
Code:
const { SlashCommandBuilder, EmbedBuilder } = require('#discordjs/builders');
const wait = require('node:timers/promises').setTimeout;
let questions = [
{
title: "some array you got there!",
},
]
let suggest = ["some array you got there!",]
let q = questions[Math.floor(Math.random()*(questions.length))];
let s = suggest[Math.floor(Math.random()*(suggest.length))];
module.exports = {
data: new SlashCommandBuilder()
.setName('topic')
.setDescription('gives topics'),
async execute(interaction, message) {
interaction.deferReply()
const user = message.mentions.users.first() || message.author;
const embed = {
title: `**${q.title}**`,
author: {
name: 'chat topic:',
icon_url: user.avatarURL(),
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
},
footer: {
text: `topic requested by: ${message.author.username} ${s}`,
icon_url: '',
},
color: 0x7732a8,
}
interaction.editReply({ embeds: [embed] });
}}
There's no issues in console, I tried to log, still nothing. Just "This interaction failed."

Alfresco Share Aikau PathTree to show documents not just folders

I am working on an Aikau Share Page where I a side bar that is using the Alfresco Share document library tree picker. The picker allows me to publish the nodeRef to another widget which will display information. I would like to use the tree view but i'm having trouble showing the documents and it is only showing the containers/folders. Anyone have any idea on what I need to do in order to solve this?
Here is the Aikua code i am using:
{
align: "sidebar",
name: "alfresco/layout/Twister",
config: {
label: "twister.library.label",
additionalCssClasses: "no-borders",
widgets: [
{
name: "alfresco/navigation/PathTree",
config: {
showRoot: true,
rootLabel: "Repository",
rootNode: "/app:company_home",
publishTopic: "ALF_ITEM_SELECTED"
}
}
]
}
}
I am wondering if I need to write an extension to the CoreXhr or what the steps would be in order to make this work.
Any help would be appreciated
I was able to figure this out. The problem comes from the repository script in the alfresco explorer side "treenode.get.js". The solution was to do the following
Create a new webscript in alfresco explorer and copy treenode.get.js code into the new webscript. I ended up calling mine customtreenode.get.js.
Remove the logic check for IsContainer in the newly created webscript
Create new Aikau file that extends PathTree. Here is the code below
define(["dojo/_base/declare",
"alfresco/navigation/PathTree",
"alfresco/documentlibrary/_AlfDocumentListTopicMixin",
"service/constants/Default",
"dojo/_base/lang",
"dojo/_base/array",
"dojo/dom-class",
"dojo/query",
"dojo/NodeList-dom"],
function(declare, PathTree, _AlfDocumentListTopicMixin, AlfConstants, lang, array, domClass, query) {
return declare([PathTree, _AlfDocumentListTopicMixin], {
useHash: true,
getTargetUrl: function alfresco_navigation_Tree__getTargetUrl() {
var url = null;
if (this.siteId && this.containerId)
{
url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/site/" + this.siteId + "/documentlibrary";
}
else if (this.rootNode)
{
url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/node/alfresco/company/home";
}
else if (!this.childRequestPublishTopic)
{
this.alfLog("error", "Cannot create a tree without 'siteId' and 'containerId' or 'rootNode' attributes", this);
}
return url;
}
});
});
Change your code to use the new CustomPathTree
{
align: "sidebar",
name: "alfresco/layout/Twister",
config: {
label: "twister.library.label",
additionalCssClasses: "no-borders",
widgets: [
{
name: "CustomWidgets/widgets/CustomTreeNode",
config: {
showRoot: true,
rootLabel: "Repository",
rootNode: "/app:company_home",
publishTopic: "ALF_ITEM_SELECTED"
}
}
]
}
}
It works after that. I still need to change the icons from folders to documents.

Dictaphone BB10 in QML

I need make small app on BB10 using QML, which record and play some voice. I have all needed permision (microphone and store file) and this code:
import bb.cascades 1.0
import bb.multimedia 1.0
Page {
property string dataUrl;
Container {
background: Color.create("#001100")
layout: StackLayout {
}
attachedObjects: [
MediaPlayer {
id: audioPlayer
sourceUrl: dataUrl + "/recording.mp4"
},
AudioRecorder {
id: recorder
outputUrl: dataUrl + "/recording.mp4"
}
]
Button {
id: btnRecord
text: "Record"
onClicked: {
recorder.record();
}
}
Button {
id: btnStop
text: "Stop Record"
onClicked: {
recorder.reset();
}
}
Button {
text: "Play Audio"
onClicked: {
audioPlayer.play()
}
}
Button {
text: "Stop Audio"
onClicked: {audioPlayer.stop()
}
}
}
}
After running I can see all buttons, but recording and/or playing is not work. I dont know what is wrong. I cant see any errors.
You're almost there. The problem is your sourceUrl is wrong. The best place to store your recording is in your app's data directory but your QML has no idea where that is.
To solve this you need to expose your app's data path to your QML using C++. You can do this using a property (more info here).
Add the following C++ code under where you create your AbstractPane object (in my case called root). This is normally done in applicationui.cpp.
root->setProperty("dataUrl", "file://" + QDir::currentPath() + "/data");
Now add the dataUrl property to your QML and use it for your sourceUrl:
Page {
property string dataUrl;
Container {
background: Color.create("#001100")
layout: StackLayout {
}
attachedObjects: [
MediaPlayer {
id: audioPlayer
sourceUrl: dataUrl + "/recording.m4a"
},
AudioRecorder {
id: recorder
outputUrl: dataUrl + "/recording.m4a"
}
]
....
}
Edit: Make sure you call audioPlayer.reset() after you've finished recording, this forces the player to reload the recorded audio. If you don't do this your audio playback may be truncated.

(New in Sencha 2.2) Data store loading data for large data set freezes app

There is a data store in my app that, on a specific user action, gets loaded with a rather large set of data via a local txt file (100kb total). Prior to my upgrade to Sencha 2.2, loading that data set went rather quickly and there was 0 impact on the app performance.
Now that I've upgraded to Sencha 2.2, loading that data freezes the app completely. Even if I'm running the app on my computer, it takes around 5 minutes for the app to unfreeze.
I've tried two approaches: setData() and loading via a proxy (code below). Both approaches have the same result. I've sifted through the Sencha 2.2 changelog and haven't been able to find any relevant changes to data stores. I'm pretty well at a loss here. Any help would be awesome.
Local proxy approach:
Ext.define("addable_exercises", {
extend: "Ext.data.Model",
config: {
idProperty: 'id',
fields: [
{ name: 'ex_id'},
{ name: 'ex_name'},
{ name: 'ex_alias'},
{ name: 'ex_type'},
{ name: 'prot_type'}
]
}
});
var all_exercises = Ext.create('Ext.data.Store', {
storeId: 'all_exercises',
model: 'addable_exercises',
proxy: {
type: 'ajax',
url: 'resources/textfiles/datastores/all_exercises.txt'
}
});
Ext.getStore('all_exercises').load()
setData() approach:
Ext.define("addable_exercises", {
extend: "Ext.data.Model",
config: {
idProperty: 'id',
fields: [
{ name: 'ex_id' },
{ name: 'ex_name'},
{ name: 'ex_alias'},
{ name: 'ex_type'},
{ name: 'prot_type'}
]
}
});
var all_exercises = Ext.create('Ext.data.Store', {
storeId: 'all_exercises',
model: 'addable_exercises'
});
Ext.Ajax.request({
url: 'resources/textfiles/datastores/all_exercises.txt',
success: function(response, opts) {
var exercise_list = response.responseText;
var all_exercises_store = Ext.getStore('all_exercises');
all_exercises_store.setData(exercise_list);
}
});
Turns out the problem wasn't the actual data store, it was what my code does immediately after loading that store: associating that massive store with a dataview list. In Sencha 2.2, lists are no longer set as infinite by default (which I assume was a performance consideration for short lists), so - as a non-infinite list - it was parsing every list item before displaying anything. With infinite enabled, it lets the items load in the background.
var list = new Ext.dataview.List({
id: 'search_list',
height: 500,
width: 500,
infinite: true,
loadingText:'loading...',
store: 'all_exercises',
itemTpl: [
'<tpl for=".">',
'<div class="feed_item">',
'<div class="avatar">{ex_name}</div>',
'</div>',
'</div>',
'</tpl>'
]
});

Sencha Touch 2 Get Current Location on Button Click

I have a toolbar button which when clicked should update my map to my current location. I am unable to find a working example of this functionality and hoping someone can advise me. Please see below for sample code - thanks for your help
Map:
Ext.define('MyApp.view.Myap', {
extend: 'Ext.Map',
alias: 'widget.mymap',
config: {
useCurrentLocation: false,
mapOptions:{
zoom: 9,
center: new google.maps.LatLng(42.2, -72.5),
mapTypeId: google.maps.MapTypeId.ROADMAP
},
listeners: {
maprender : function(comp, map){
google.maps.event.addListenerOnce(map, "idle", function () {
var host = window.location.origin ? window.location.origin : window.location.protocol + "/" + window.location.host;
var kmlOptions = {preserveViewport: false}
var now = +new Date();
var layer = new google.maps.KmlLayer(host + '/path/to.kml?timestamp=' + now, kmlOptions);
layer.setMap(map);
return layer;
});
},
}
},
})
Toolbar Button:
Ext.define('MyApp.view.btnLocateMe', {
extend: 'Ext.Button',
alias: 'widget.btnlocateme',
config: {
ui: 'normal',
iconCls: 'locate',
iconMask: true,
text: 'Locate Me',
listeners: [
{
fn: 'onButtonTap',
event: 'tap'
}
]
},
onButtonTap: function(button, e, options) {
//Produces error: cannot call method of undefined
currentLocation: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude());
MyApp.view.MyMap.map.setCenter(currentLocation);
}
});
my two cents contribution, try this
1) in MyApp.view.Myap substitute
useCurrentLocation: false,
by
useCurrentLocation : {
autoUpdate : false
},
Also you should declare currentLocation as a variable (I presume)
var currentLocation = ...
This should works. I've use a similar logic as yours in onButtonTap but inside a controller with no problems
Best regards
I have one suggestion.
Try changing current location to
new google.maps.LatLng( this.geo.getLatitude(),this.geo.getLongitude() ) ;
I think you can gather more info from this question in here.
The simplest way - switch to the another map view with option useCurrentLocation: true set in the config