Skip to content

Instantly share code, notes, and snippets.

.controller('StreamController', function() {
var isPlaying = false;
var stream;
var vm = angular.extend(this, {
togglePlay: togglePlay,
isPlaying: isPlaying
});
// ********************************************************************
.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
.controller('StreamController', function($interval, streamService) {
var isPlaying = false;
var stream;
var timer;
var vm = angular.extend(this, {
togglePlay: togglePlay,
isPlaying: isPlaying,
info: null
});
/*
* Stream
*/
.stream-background {
background: url('http://lorempixel.com/1024/768/') center center;
background-size: cover;
}
.play-button-icon.icon:before {
<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>
function play() {
// Display loader
if (window.Stream) {
stream = new window.Stream(audioStream);
// Play audio
stream.play();
}
// Hide loader after XXX sec
getStreamInfo();
<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>
{
"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",
(function() {
'use strict';
angular
.module('supermodular.movies')
.controller('MoviesController', MoviesController);
MoviesController.$inject = ['moviesService', '$http', '$scope'];
/* @ngInject */
(function() {
'use strict';
angular
.module('supermodular.movies')
.factory('moviesService', moviesService);
moviesService.$inject = [];
function moviesService() {