小编tes*_*eau的帖子

获取当前在控制中心iOS上播放的曲目

我希望在iOS上播放当前曲目,无论播放曲目的应用是什么.我的意思是,例如,如果我在手机上使用SoundCloud或Spotify,控制中心的播放器是相同的,所以我认为可以获得当前的曲目名称.

但是我不知道怎么做,也许有人可以帮助我?

谢谢

ios mpnowplayinginfocenter control-center

4
推荐指数
1
解决办法
2188
查看次数

设置范围区域iBeacons

我在使用iBeacons时遇到了一些重大问题.

我根本无法弄清楚如何控制触发某种事件的距离(如通知).我只允许在我进入或退出地区时发送通知但我想在我临近或立即时发送通知/

我在哪里错过了文档中的这些内容?

谢谢 !

location objective-c ios ibeacon

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

无法调用未定义的方法'trustAsResourceUrl'

我正在使用角度来显示Youtube的iframe.为了,我使用$ sce来信任外部URL,但我有一个我无法解决的错误...也许有人可以向我解释

Controller.js

.controller('DetailsCtrl', ['$scope', '$routeParams', '$http',
    function($scope, $routeParams, $http, $sce) {
        $scope.loading = true;
      $scope.url = $sce.trustAsResourceUrl('//www.youtube.com/embed/4wOoLLDXbDY');
        $http.get('projects/' + $routeParams.projectId + '.json').success(function(data) {
          $scope.project = data;
          $scope.loading = false;
        });
    }]);
Run Code Online (Sandbox Code Playgroud)

Details.html

<iframe width="560" height="315" ng-src"{{url}}" frameborder="0" allowfullscreen></iframe>
Run Code Online (Sandbox Code Playgroud)

控制台出错

TypeError: Cannot call method 'trustAsResourceUrl' of undefined
    at new <anonymous> (http://localhost:9000/scripts/controllers/details.js:22:25)
    at invoke (http://localhost:9000/bower_components/angular/angular.js:3869:17)
    at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:3880:23)
    at http://localhost:9000/bower_components/angular/angular.js:7134:28
    at link (http://localhost:9000/bower_components/angular-route/angular-route.js:913:26)
    at nodeLinkFn (http://localhost:9000/bower_components/angular/angular.js:6579:13)
    at compositeLinkFn (http://localhost:9000/bower_components/angular/angular.js:5986:15)
    at publicLinkFn (http://localhost:9000/bower_components/angular/angular.js:5891:30)
    at boundTranscludeFn (http://localhost:9000/bower_components/angular/angular.js:6005:21)
    at controllersBoundTransclude (http://localhost:9000/bower_components/angular/angular.js:6600:18) <div ng-view="" class="ng-scope">     
Run Code Online (Sandbox Code Playgroud)

url directive angularjs

0
推荐指数
1
解决办法
5113
查看次数