是否可以在减速机本身发送动作?我有一个进度条和一个音频元素.目标是在音频元素中更新时间时更新进度条.但是我不知道将ontimeupdate事件处理程序放在何处,或者如何在ontimeupdate的回调中调度一个动作来更新进度条.这是我的代码:
//reducer
const initialState = {
audioElement: new AudioElement('test.mp3'),
progress: 0.0
}
initialState.audioElement.audio.ontimeupdate = () => {
console.log('progress', initialState.audioElement.currentTime/initialState.audioElement.duration);
//how to dispatch 'SET_PROGRESS_VALUE' now?
};
const audio = (state=initialState, action) => {
switch(action.type){
case 'SET_PROGRESS_VALUE':
return Object.assign({}, state, {progress: action.progress});
default: return state;
}
}
export default audio;
Run Code Online (Sandbox Code Playgroud) 我只是想在我的Sails-Project中的视图中添加图像
我的视图文件有位置
views/album/albums.ejs
Run Code Online (Sandbox Code Playgroud)
并且图像位于
assets/images/placeholder.png
Run Code Online (Sandbox Code Playgroud)
如果我添加这样的图像
<img src="../../assets/images/placeholder.png">
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
GET http://localhost:1337/assets/images/placeholder.png 404 (Not Found)
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
您好我有一个奇怪的错误,当我想触发Galaxy Nexus(4.0.4)上的方向更改时,它根本不会跳转到该onConfigurationChanged(Configuration)功能.在HTC Desire(4.0.4)上,它可以在没有相同代码的任何问题的情况下工作.甚至在720p的模拟器上它也可以工作.我尝试更新到Android 4.1,但我仍然遇到同样的问题.
有没有人有同样的问题或任何解决方案?
您有没有办法访问风帆的基本http服务器上下文?我想在我的应用程序中使用binaryJS,在gettig入门指南中,他们谈论的是自己创建服务器,你有一个现有的快递应用程序,其中包含以下行:
var server = http.createServer(app).listen(9000);
Run Code Online (Sandbox Code Playgroud)
我可以使用以下binaryJS命令:
// Create a BinaryServer attached to our existing server
var binaryserver = new BinaryServer({server: server, path: '/binary-endpoint'});
Run Code Online (Sandbox Code Playgroud)
谢谢
sails.js ×2
android ×1
ejs ×1
galaxy-nexus ×1
html ×1
node.js ×1
orientation ×1
reactjs ×1
reducers ×1
redux ×1