2
I was wondering if it is possible to work with an Http:// request locally in my application and not on a local server, if 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});
};
}]);
Currently I have this mistake :
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
Good answering the question directly, yes but it is interesting that you put more language information and the like so we can answer in a more accurate way.
– Otto
I have an angular application, which works with stream hls, there is a way to make these requests locally ?
– Lucas Inacio
I don’t know if I understand the question so I won’t publish it as an answer... but I think what you want is to access a local site by browser, right?
http://localhost/
andhttp://127.0.0.1/
meet almost every case (if not answer is because the local address of your computer has been reconfigured).– Oralista de Sistemas
On-premises or cloud application ?
– Otto
@Renan I’m thinking, correct me if I’m wrong, that the application is in the cloud but he wants to use some local requests
– Otto
@Otto I don’t understand the question and I don’t know if that’s it. I think your first comment was the best, this question can be closed because it is not clear enough if more details are not included.
– Oralista de Sistemas
the application would be nothing more than a music stream similar to Spotify, so I want to make him make this request for the songs that are on the server locally;
– Lucas Inacio
Yes yes I am also waiting for an answer so we have plausible information to answer
– Otto
Look hasn’t helped as much, but yes it has of course, you running a local http server like "xampp" something so you will have clear access.
– Otto
@Lucasinacio when putting codes, make an edit on your ask and add it
– Otto
now I think it looks better
– Lucas Inacio
I noticed that used the android tag, you are then using webView?
– Guilherme Nascimento