在我的应用程序中,我必须播放存储在Web服务器上的音频文件.我正在使用AVPlayer它.我有所有播放/暂停控件和所有代表和观察员在那里工作得非常好.在播放小音频文件时,一切都很棒.
播放长音频文件时,它也会开始正常播放,但几秒后AVPlayer暂停播放(最可能是缓冲它).问题是它不能再自行恢复.它保持暂停状态,如果我再次手动按下播放按钮,它将再次流畅播放.
我想知道为什么AVPlayer不自动恢复,如何在没有用户再次按下播放按钮的情况下再次恢复音频?谢谢.
我很难理解人物阅读在空白中是如何运作的.我能够运行Hello World程序.但现在我尝试从用户只读一个字符,然后在标准输出上打印它.我没有错误,一切编译得很好,但字符不会出现在输出上.我试图稍微调试它,但它在空白中真的很难,我相信它不会打印任何东西,因为我从用户读取的值是0(或null).
这是我如何阅读角色(我相信它是正确的方式)
start
end
Run Code Online (Sandbox Code Playgroud)
在这里打印的SSCCE(这应该工作,因为它几乎与Hello World项目中的相同.
start
end
Run Code Online (Sandbox Code Playgroud)
我使用的是Whitespace 0.3和Haskell Compiler 5.02版
我已经使用快递js和passport-Facebook在我的网站上实现了Facebook-LogIn.它运作良好(我获得现场简介),但问题是我没有收到电子邮件.我收到一个错误:
email : profile.emails[0].value,
Run Code Online (Sandbox Code Playgroud)
TypeError:无法读取未定义的属性"0"
我的代码:
passport.use('facebook',new FacebookStrategy({
clientID : config.facebook.id,
clientSecret : config.facebook.secret,
callbackURL : '/auth/facebook/callback',
profileFields : ['id', 'displayName', 'emails','photos']
}, function(accessToken, refreshToken, profile, done) {
User.findOne({provider_id: profile.id}, function(err, user) {
if(err) throw(err);
if(!err && user!= null) return done(null, user);
var user = new User({
provider_id : profile.id,
name : profile.displayName,
email : profile.emails[0].value,
photo : profile.photos[0].value,
});
user.save(function(err) {
if(err) throw err;
return done(null, user);
});
});
}));
Run Code Online (Sandbox Code Playgroud)
如果有人可以帮我解决我的问题,那将会很棒:)
我遇到了问题,因为我正在测试我的应用程序的某些设备没有收到通知,也没有引发异常.
通知来自FCM,我正在使用自定义服务来显示它们.
MyFirebaseMessaginService.java
static int count = 0;
@Override
public void onMessageReceived(final RemoteMessage remoteMessage) {
Log.i("remoteMessage",remoteMessage.toString());
switch(remoteMessage.getData().get("tipo")){
case "normal":
notificacionNormal(remoteMessage);
break;
case "imagen":
notificacionImagen(remoteMessage);
break;
case "imagen+url":
notificacionImagenUrl(remoteMessage);
break;
}
count++;
//Log.d("prueba",remoteMessage.getData().get("imagen"));
}
private void notificacionImagenUrl(RemoteMessage remoteMessage) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(remoteMessage.getData().get("url")));
PendingIntent pendingIntent = PendingIntent.getActivity(this, 100, i, PendingIntent.FLAG_ONE_SHOT);
NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = new Notification.Builder(this)
.setContentIntent(pendingIntent)
.setContentTitle(remoteMessage.getNotification().getTitle())
.setContentText(remoteMessage.getNotification().getBody())
.setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.setStyle(new Notification.BigPictureStyle().bigPicture(getImagae(remoteMessage.getData().get("imagen"))))
.build();
notif.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(count, notif);
}
Run Code Online (Sandbox Code Playgroud)
目前它只发生在一个带有android 6.0.1的root设备中希望你可以帮助我:)
编辑:我发送的通知HTTP请求:
"to": …Run Code Online (Sandbox Code Playgroud) android firebase firebase-cloud-messaging firebase-notifications
我在使用ACTION_GET_CONTENT从Downloads目录中选择文件时遇到问题.
如果我删除了我的本地存储中的ES资源管理器或文件管理器中的任何文件,那么在我的应用程序中打开时,这些已删除的文件不会在下载目录中删除.
下载中的任何更改都不会反映在选择器中.
要选择我正在使用以下库的文件
https://github.com/iPaulPro/aFileChooser.
在这里我附上我的截图请看看:
我是java的新手.我想做一个游戏.经过大量的研究,我无法理解bufferstrategy如何工作..我知道基础知识..它创建了一个屏幕外的图像,你可以在以后放入你的windows对象..我得到了这个
public class Marco extends JFrame {
private static final long serialVersionUID = 1L;
BufferStrategy bs; //create an strategy for multi-buffering.
public Marco() {
basicFunctions(); //just the clasics setSize,setVisible,etc
createBufferStrategy(2);//jframe extends windows so i can call this method
bs = this.getBufferStrategy();//returns the buffer strategy used by this component
}
@Override
public void paint(Graphics g){
g.drawString("My game",20,40);//some string that I don't know why it does not show
//guess is 'couse g2 overwrittes all the frame..
Graphics2D g2=null;//create a child object of …Run Code Online (Sandbox Code Playgroud) 题:
如何防止类似HTML模板中的代码复制?
描述
我有相同的视图/指令的几个不同的模板,我想根据环境改变.模板大部分相同,但包含一些需要根据环境进行更改的部分.
例:
输入userdata的视图对于管理员可能如下所示:
<p> Username: </p>
<input ng-model="ctrl.username"></input>
<p> Firstname: </p>
<input ng-model="ctrl.firstname"></input>
<p> Lastname: </p>
<input ng-model="ctrl.lastname"></input>
<p> Authorization-level: </p>
<input ng-model="ctrl.authlevel"></input>
Run Code Online (Sandbox Code Playgroud)
但是,我需要向用户显示基本相同的视图,而不允许他更改其授权级别:
<p> Username: </p>
<input ng-model="ctrl.username"></input>
<p> Firstname: </p>
<input ng-model="ctrl.firstname"></input>
<p> Lastname: </p>
<input ng-model="ctrl.lastname"></input>
<p> Authorization-level: </p>
{{ctrl.authlevel}}
Run Code Online (Sandbox Code Playgroud)
我想防止重复两个模板的代码.
可能的解决方案:
NG-如果
显然,我可以ng-if根据条件在模板中交换html块.但是,这不能很好地扩展.上面的例子很简单,但想象一下我有5-10个不同版本的模板.使用此模板的版本数量,代码变得越来越难以阅读.另外,我希望阻止将admin-view的代码发送给用户,如果它包含在同一个html文件中,我就不能这样做.
自定义指令
我可以将每个需要在其自己的指令中替换的HTML节点包装起来.这将保持主模板清洁,我可以根据环境交换指令的HTML模板.但是,所有这些附加指令都会导致大量的样板代码.
(这似乎最接近Angular2的组件)
第三方库角度块
我发现角度块似乎正在解决我想要解决的问题.但是,它看起来并不是很受欢迎,并且在查看实现时我担心这可能会导致大型应用程序出现性能问题(由于多个嵌套$compile调用).
我有什么选择吗?你知道任何最佳实践或风格指南吗?
我在github上的自述文件中执行此命令来复制文件,但我不明白如何在终端中输入它有这个反斜杠并且终端正在吐出我没有正确使用复制命令
cp -r rails_tutorial_sublime_text/* \
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/
Run Code Online (Sandbox Code Playgroud)
在这个例子中我实际上输入了什么?
我有一个问题,我不知道如何解决......你能帮帮我吗?
当我在Heroku上启动我的应用程序时,我收到错误消息:
应用程序中发生错误,无法提供您的页面.请稍后重试.
如果您是应用程序所有者,请检查日志以获取详细信息.
我的日志说:
2013-11-12T11:57:32.339883+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes=
2013-11-12T11:57:32.960681+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes=
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么办..你能帮帮我吗?
这是整个日志:
MacBook-de-Raphael:pinterest raphaelbendenoun$ heroku logs 2013-11-12T15:53:06.935203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `each' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/config.ru:in `' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' …
我想知道如何使用其代码更改标签的颜色,例如:
dim r as color
r = color.red
Run Code Online (Sandbox Code Playgroud)
如何从按钮使用或将代码分配给标签......?就像我的表单按钮和标签一样..当点击按钮时,标签会改变它的颜色..我怎么在vb.net中这样做?
这是我的按钮
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim r As Color
r = Color.Red
End Sub
End Class
Run Code Online (Sandbox Code Playgroud)
??
android ×2
angularjs ×1
audio ×1
avfoundation ×1
avplayer ×1
express ×1
filepicker ×1
firebase ×1
graphics2d ×1
haskell ×1
heroku ×1
html ×1
input ×1
ios ×1
java ×1
javascript ×1
node.js ×1
templates ×1
terminal ×1
vb.net ×1