I wanted to know if it is possible to work with a Http: // request locally in my application and not on a local server, if at all possible how do I do this? (does not necessarily have to be with the file: // protocol).
//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});
};
}]);
I'm currently experiencing this error:
clappr.js: 30025 XMLHttpRequest can not 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