This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.controller('StreamController', function() { | |
var isPlaying = false; | |
var stream; | |
var vm = angular.extend(this, { | |
togglePlay: togglePlay, | |
isPlaying: isPlaying | |
}); | |
// ******************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.factory('streamService', function($http, $q){ | |
var streamUrl = 'http://198.100.125.242:80/'; | |
var metadataUrl = streamUrl + '7.html'; | |
var contentRegex = /<body>(.*)<\/body>/; | |
var itunesSearchUrl = 'https://itunes.apple.com/search?term='; | |
var resolutionRegex = /100x100/; | |
var service = { | |
getStreamInfo: getStreamInfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.controller('StreamController', function($interval, streamService) { | |
var isPlaying = false; | |
var stream; | |
var timer; | |
var vm = angular.extend(this, { | |
togglePlay: togglePlay, | |
isPlaying: isPlaying, | |
info: null | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Stream | |
*/ | |
.stream-background { | |
background: url('http://lorempixel.com/1024/768/') center center; | |
background-size: cover; | |
} | |
.play-button-icon.icon:before { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-view view-title="Live radio"> | |
<ion-content class="stream-background center"> | |
<a class="button button-icon icon play-button-icon {{ vm.isPlaying ? 'ion-ios-pause' : 'ion-ios-play' }}" | |
ng-click="vm.togglePlay()"></a> | |
</ion-content> | |
</ion-view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function play() { | |
// Display loader | |
if (window.Stream) { | |
stream = new window.Stream(audioStream); | |
// Play audio | |
stream.play(); | |
} | |
// Hide loader after XXX sec | |
getStreamInfo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-view view-title="Movies"> | |
<ion-content> | |
<div ng-repeat="movie in movies"> | |
<div class="card"> | |
<div class="item item-text-wrap item-thumbnail-left"> | |
<img ng-src="{{movie.thumb}}"> | |
<h2>{{movie.title}}</h2> | |
<p>{{movie.body}}</p> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"movies": [ | |
{ | |
"id": 1, | |
"thumb": "http://skounis-dev.s3.amazonaws.com/mobile-apps/supermodular/batman-v-superman.jpg", | |
"title": "Batman v Superman: Dawn of Justice", | |
"body": "Fearing that the actions of Superman are left unchecked, Batman takes on the Man of Steel, while the world wrestles with what kind of a hero it really needs." | |
}, { | |
"id": 2, | |
"thumb": "http://skounis-dev.s3.amazonaws.com/mobile-apps/supermodular/civil-war.jpg", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
angular | |
.module('supermodular.movies') | |
.controller('MoviesController', MoviesController); | |
MoviesController.$inject = ['moviesService', '$http', '$scope']; | |
/* @ngInject */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
angular | |
.module('supermodular.movies') | |
.factory('moviesService', moviesService); | |
moviesService.$inject = []; | |
function moviesService() { |
OlderNewer