From f073cdda22715b0463b7a3ec48b75cd7fa43938a Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Mon, 17 Aug 2015 19:37:06 -0400 Subject: no video error handling (experimental) --- www/js/app.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'www/js') diff --git a/www/js/app.js b/www/js/app.js index eaedae7c..5df0278b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -114,6 +114,7 @@ angular.module('zmApp', [ } imageLoadingDataShare.set(1); loadImage(); + $attributes.$observe('imageSpinnerSrc', function(value){ //console.log ("SOURCE CHANGED"); imageLoadingDataShare.set(1); @@ -121,6 +122,22 @@ angular.module('zmApp', [ //deregistration(); }); + + + // show an image-missing image FIXME: never seems to get called + $element.bind('error',function () { +console.log ("***** IMAGE ELEMENT ERROR CALLED " + w + "x" + h); + var w = $element.width(); + var h = $element.height(); + + // using 20 here because it seems even a missing image will have ~18px width + // after this error function has been called + //if (w <= 20) { w = 100; } + //if (h <= 20) { h = 100; } + var url = 'img/novideo.png'; + $element.prop('src', url); + //$element.css('border', 'double 3px #cccccc'); + }); function loadImage() { $element.bind("load", function (e) { -- cgit v1.2.3