Queria saber se é possível trabalhar com uma requisição Http:// localmente em minha aplicação e não em um servidor local,se for possível como eu faço isso? (não precisa necessariamente ser com o protocolo file://).
//Cleanup the popover when we're done with it!
$scope.$on('$destroy', function() {
$scope.musicActionspopover.remove();
});
$scope.openMusicActions = function($event, music) {
$scope.audioSelected = music;
$scope.musicActionspopover.show($event);
};
$scope.closeMusicActionsPopover = function() {
$scope.musicActionspopover.hide();
};
$scope.playAudio = function($event, audioSelected) {
// Prevents start the song when it is clicked on the menu
if ($event.srcElement.tagName == 'I') {
$event.preventDefault();
return;
}
var audioSelectedIndex = 0;
var queueMusics = [];
angular.forEach($scope.playlist.audios, function (music, index) {
if (audioSelected.nid == music.nid) {
audioSelectedIndex = index;
};
queueMusics.push({
id: music.nid,
name: music.title,
artist: music.interpeters[0],
audioUrl: "file://audio/0379442681742547b1cc4baacab409c3/320/ts_.m3u8",//music.audio_url,
albumId: music.album.nid,
albumCover: music.album.cover,
albumBlurCover: music.album.blur_cover,
audioType: music.audioType,
collectionSourceID: $scope.playlist.nid,
collectionSourceTitle: $scope.playlist.title,
collectionSourceCategory: "System Playlist"
});
});
$rootScope.$emit("playAudio", {index: audioSelectedIndex, queueName: $scope.playlist.title, audios: queueMusics});
$scope.closeMusicActionsPopover();
};
$scope.playSystemPlaylist = function ($event) {
playlist = $scope.playlist;
var audioSelectedIndex = 0;
var queueMusics = [];
angular.forEach(playlist.audios, function (music, index) {
queueMusics.push({
id: music.nid,
name: music.title,
artist: music.interpeters[0],
audioUrl: music.audio_url,
albumId: music.album.nid,
albumCover: music.album.cover,
albumBlurCover: music.album.blur_cover,
audioType: music.audioType,
collectionSourceID: $scope.playlist.nid,
collectionSourceTitle: $scope.playlist.title,
collectionSourceCategory: "System Playlist"
});
});
$rootScope.$emit("playAudio", {index: audioSelectedIndex, queueName: playlist.title, audios: queueMusics});
};
}]);
Atualmente estou com esse erro :
clappr.js:30025 XMLHttpRequest cannot load file://audio/0379442681742547b1cc4baacab409c3/320/ts_.m3u8. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. loadInternal @ clappr.js:30025 d @ raven.js:1279
http://localhost/
ehttp://127.0.0.1/
atendem quase todos os casos (se não atendem é porque o endereço local do seu computador foi reconfigurado).