小编Zl3*_*l3n的帖子

无法阻止AVPlayer

我目前正在使用Swift测试AVPlayer与音频流网址的使用.有play()pause()方法,但问题是,仅暂停,流仍然缓存在设备中.

这是我的测试代码:

import UIKit
import AVFoundation

class ViewController: UIViewController {

    let player = AVPlayer(URL: NSURL(string: "http://streaming.radio.rtl.fr/rtl-1-48-192")!)

    @IBOutlet weak var btnPlay: UIButton!

    override func viewDidLoad() {
        super.viewDidLoad()            
    }

    @IBAction func btnPress(sender: AnyObject) {
        if (btnPlay.titleLabel?.text == "Play") {
            initPlayer()
            btnPlay.setTitle("Stop", forState: UIControlState.Normal)
        } else {
            stopPlayer()
            btnPlay.setTitle("Play", forState: UIControlState.Normal)
        }
    }

    func initPlayer()  {
        player.play()
    }

    func stopPlayer() {
        // player.currentItem = nil // Last thing I tried, but generate an error
        player.pause()
    }
} …
Run Code Online (Sandbox Code Playgroud)

ios avplayer swift

23
推荐指数
3
解决办法
2万
查看次数

JQuery墙板,带有声音通知和闪烁的div/table单元格

我在桌面上有一个带有SQL查询的页面,可以在大屏幕上显示结果.

然后我浏览到index.php,其中包含以下代码:

// <![CDATA[
$(document).ready(function() {

    // This part addresses an IE bug. without it, IE will only load the first number and will never refresh
    $.ajaxSetup({ cache: false });    
    setInterval(function() {
        $('.container').load('data.php');
    }, 2000); // the "2000" here refers to the time to refresh the div. it is in milliseconds.
});
// ]]>
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="container"><h3>Loading Data...</h3></div>
Run Code Online (Sandbox Code Playgroud)

所以它不断加载这个页面.

我想做的就是拥有它,如果任何查询包含需要对其执行操作的数据,表格单元格将闪烁2种颜色,并且每隔5分钟将播放一次声音.

什么是最好的方法来保持页面不断加载?

php jquery

8
推荐指数
1
解决办法
316
查看次数

无法安装最新版本的Gitlab

这个问题不是代码,而是Gitlab的安装.

我现在试图安装Gitlab几天没有成功.
事实上,很久以前,他们提出的方法wget非常有效,但由于我们必须使用这种方法Curl,因此不可能比下载更进一步.

在Ubuntu 14.04机器上,以下命令有效:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
Run Code Online (Sandbox Code Playgroud)

但是使用下一个命令,它会显示[0%待定]并且没有任何反复发生.

sudo apt-get install gitlab-ce
Run Code Online (Sandbox Code Playgroud)

自从7.10.4版本的Gitlab以来你有没有遇到过这个问题,或者你知道解决这个问题的方法吗?从源头安装对我来说非常难以实现.

这是完整的错误:

Err packages.gitlab.com/gitlab/gitlab-ce/ubuntu trusty/main gitlab-ce amd64 7.10.4~omnibus.1-1 Operation too slow.
Less than 10 bytes/sec transferred the last 120 seconds
E: Impossible de récupérer packages.gitlab.com/gitlab/gitlab-ce/ubuntu/pool/trusty/main/g/…
Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
Run Code Online (Sandbox Code Playgroud)

当我这样做时cat /etc/apt/sources.list.d/gitlab_gitlab-ce.list,我有这个结果:

deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main
Run Code Online (Sandbox Code Playgroud)

这个页面不存在.这是问题吗?

git bash curl gitlab

6
推荐指数
1
解决办法
3798
查看次数

重定向到Lumen(Laravel)上的公用文件夹

我有一个大问题.我使用Lumen框架在localhost中处理应用程序.我的工作环境是在Wamp(Windows)上.

Lumen要求root位于public文件夹中.

为此,我有一个像这样的配置文件:

NameVirtualHost name.local
<VirtualHost name.local>    
  DocumentRoot C:/wamp/www/name/public
  ServerName name.local  
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

所以,如果我把地址name.local/放在我的浏览器中,我就可以到达索引页面.

现在,我需要将所有工作都放在FTP中.在那里,我有一个异常错误,这是正常的,因为我的根不是public文件夹.

更新:我找到答案,请看下面.

.htaccess laravel lumen

6
推荐指数
1
解决办法
1万
查看次数

Lumen无法打开/../vendor/autoload.php

我在四月份发布后开始使用流明.

从5.0版本开始,我已经遇到了同样的问题并找到了解决方案(参见此处).

有几天我开始在Lumen(5.1)创建一个新项目.但是,通过应用上述方法.htaccess,这次问题并没有解决.

这是完整的错误:

警告:require_once(path_of_the_project/../vendor/autoload.php):无法打开流:第path_of_the_project\bootstrap\app.php3行没有此类文件或目录

致命错误:require_once():在第3行打开所需的' path_of_the_project\bootstrap/../vendor/autoload.php'(include_path ='.; C:\ php\pear')失败path_of_the_project\bootstrap\app.php

怎么解决?

php lumen

6
推荐指数
2
解决办法
1万
查看次数

带有流明的 file_get_contents

我将此代码放入一个函数(php类)中:

$theFile = '/test/test.xml'; // these are in the public folder
dd(file_get_contents($theFile));
Run Code Online (Sandbox Code Playgroud)

如果我去mydomain.local/test/test.xml,我会得到有效的 xml 代码。

但是file_get_contents,我收到此错误:

file_get_contents(/test/test.xml): failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

php file-get-contents laravel lumen

6
推荐指数
1
解决办法
7725
查看次数

bootstrap-table-filter-control扩展在bootstrap-table中不起作用

我使用bootstrap-table并希望使用table-filter-control扩展.在示例中,您可以看到如何使用此扩展.当我想将此扩展名用于更多列时,它不起作用.在我的示例中,过滤器仅适用于一列.

的jsfiddle

HTML

<table ref="mainTable" class="table table-striped table-bordered table-hover" 
       cellSpacing="0" id="mainTable" data-show-toggle="true" 
       data-show-columns="true" data-search="true" data-pagination="true" data-filter-control="true">
    <thead>
        <tr>
            <th data-field="state" data-checkbox="true"></th>
            <th data-field="Customer Name" data-sortable="true" data-filter-control="select">Customer Name</th>
            <th data-field="Location Type" data-sortable="true">Location Type</th>
            <th data-field="Location" data-sortable="true" data-filter-control="select">Location</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td></td>
            <td>Cap Corp</td>
            <td>Main</td>
            <td>Norwalk CT 06851</td>
        </tr>
        <tr>
            <td></td>
            <td>Cap Corp</td>
            <td>Other</td>
            <td>Norwalk CT 06851</td>
        </tr>
        <tr>
            <td></td>
            <td>Tel</td>
            <td>Main</td>
            <td>Slough SL1 4DX</td>
        </tr>
        <tr>
            <td></td>
            <td>Tel</td>
            <td>Other</td>
            <td>London W1B 5HQ</td>
        </tr>
    </tbody> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery twitter-bootstrap twitter-bootstrap-3 bootstrap-table

5
推荐指数
1
解决办法
1万
查看次数

无法将 Laravel / Socialite 与 Lumen 一起使用

我尝试在Lumen (5.1)系统中使用Laravel\Socialite

我在config\services.php文件中添加了这个:

<?php
//Socialite
'facebook' => [
    'client_id'     => '##################',
    'client_secret' => '##################',
    'redirect'      => 'http://local.dev/admin/facebook/callback',
],
Run Code Online (Sandbox Code Playgroud)

bootstrap\app.php文件中:

class_alias(Laravel\Socialite\Facades\Socialite::class, 'Socialite');
$app->register(Laravel\Socialite\SocialiteServiceProvider::class);
Run Code Online (Sandbox Code Playgroud)

然后我为 facebook 身份验证创建了一个控制器:

<?php

namespace App\Http\Controllers\Facebook;

use App\Http\Controllers\Controller;
use Laravel\Socialite\Contracts\Factory as Socialite;

class FacebookController extends Controller
{
  public function redirectToProviderAdmin()
  {
    return Socialite::driver('facebook')->scopes(['manage_pages', 'publish_actions'])->redirect();
  }

  public function handleProviderCallbackAdmin()
  {
    $user = Socialite::driver('facebook')->user();
  }
}
Run Code Online (Sandbox Code Playgroud)

并在routes.php

$app->get('/admin/facebook/login', 'App\Http\Controllers\Facebook\FacebookController@redirectToProviderAdmin');
$app->get('/admin/facebook/callback', 'App\Http\Controllers\Facebook\FacebookController@handleProviderCallbackAdmin');
Run Code Online (Sandbox Code Playgroud)

我只是按照文档进行操作,根据我的需要进行更改。当我转到页面时http://local.dev/admin/facebook/login,出现以下错误:

非静态方法 Laravel\Socialite\Contracts\Factory::driver() 不能静态调用,假设 $this 来自不兼容的上下文

事实上,根据代码,驱动程序函数必须是实例化的。 …

php facebook oauth laravel lumen

5
推荐指数
1
解决办法
6732
查看次数

3个按钮之间的交互

这个问题是下面那个.在页面初始化时,按钮不是"桥接"的,当用户点击带有图标的蓝色按钮时,按钮就会变为"桥接".

条件 :

  1. 如果桥接了2个按钮(单击蓝色按钮时动作),则另一个按钮必须桥接(与周围的数字连接) [ 这个工作 ]

  2. 之后,如果用户点击任何按钮,则3个按钮必须与周围的数字分开

我有这个HTML代码(使用Bootstrap 3):

<div class="col-sm-12 interfacesBridge">
    <h3 class="text-info">Interfaces</h3>

    <div class="col-sm-4">
        <div class="input-group input-group-lg">
            <div class="input-group-btn">
                <button type="button" class="btn btn-default bRLeft" disabled="disabled" style="margin-right: 15px !important;">3</button>
                <button type="button" class="btn btn-info linkInterfaces" data-interfaces="3-4"><i class="fa fa-chain-broken"></i></button>
                <button type="button" class="btn btn-default bRRight" disabled="disabled" style="margin-left: 15px !important;">4</button>
            </div>
        </div>
    </div>

    <div class="col-sm-4">
        <div class="input-group input-group-lg">
            <div class="input-group-btn">
                <button type="button" class="btn btn-default bRLeft" disabled="disabled" style="margin-right: 15px !important;">3</button>
                <button type="button" class="btn btn-info linkInterfaces" data-interfaces="3-5"><i class="fa fa-chain-broken"></i></button>
                <button …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery twitter-bootstrap

3
推荐指数
1
解决办法
87
查看次数

内联块 div 第一行的 jQuery 选择器

我有一些带显示的 div: inline-block; 我必须选择第一行 div 并将它们设置为例如不同的边框颜色,我需要在 javaScript (jQuery) 中进行。

这是我在jsFiddle上的示例

HTML :

<div class="container">
    <div class="item">item 1</div>
    <div class="item">item 2</div>
    <div class="item">item 3</div>
    <div class="item">item 4</div>
    <div class="item">item 5</div>
    <div class="item">item 6</div>
    <div class="item">item 7</div>
    <div class="item">item 8</div>
    <div class="item">item 9</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS :

.container {
    border: 1px solid red;
    padding: 10px;
}

.item {
    display: inline-block;
    border: 1px solid green;
    width: 200px;
    margin: 10px;
}
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

html javascript css jquery

2
推荐指数
1
解决办法
1089
查看次数