Skip to content

Commit

Permalink
Merge pull request #7 from groupon/channel-url-update
Browse files Browse the repository at this point in the history
update chromecast content on channel url change
  • Loading branch information
chrisjpowers committed Aug 22, 2014
2 parents 6dca287 + 1287643 commit 4a90320
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion public/js/gscreen.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/client/controllers/screen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.###

angular.module("GScreen").controller "Screen", ($scope, $sce, $location, Channel) ->
angular.module("GScreen").controller "Screen", ($scope, $sce, $location, Channel, sockets) ->
id = $location.url().match(/\/channels\/([^\/\?]+)/)[1]

$scope.channel = Channel.get id
$scope.channel.$promise.then (channel) ->
setTimeout rotateMainContentUrl, 0

sockets.on "channel-updated", (channel) ->
if channel.id == $scope.channel.id
$scope.channel = channel
setTimeout rotateMainContentUrl, 0

mainContentUrlCounter = 0
lastTimeoutId = null
rotateMainContentUrl = ->
Expand Down

0 comments on commit 4a90320

Please sign in to comment.