Skip to main content
Code Review

Return to Question

UpdAte wording
Source Link

I have an app that uses HTML5 video and our customer still needs to support IE8. - Gross.

Anyway, I came up with this directive in Angular toAngularJS for embedding a SWF object for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't ifthen it falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troublestrouble using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: https://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: https://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

I have an app that uses HTML5 video and our customer still needs to support IE8 - Gross.

Anyway, I came up with this directive in AngularJS for embedding a SWF object for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't then it falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having trouble using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: https://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: http://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects https://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: http://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: https://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

added 531 characters in body
Source Link
Ronnie
  • 151
  • 4

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: http://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

I have an app that uses HTML5 video and our customer still needs to support IE8. Gross.

Anyway, I came up with this directive in Angular to for embedding a SWF for when I need to fallback to Flash. It works fine so far, but I would like to see if there is anything I can do to improve it. Can anyone see a case where this would fail? I am using Modernizr to detect if the browser supports video (Modernizr.video). If it doesn't if falls back and I load this directive.

The directive:

'use strict';
angular.module('flash-embed', []).directive('flashEmbed', [function()
{
 return {
 restrict: 'A',
 replace: true,
 template: ['',
 '<object data="{{src}}" type="application/x-shockwave-flash">',
 '<param name="allowscriptaccess" value="always" />',
 '<param name="allowfullscreen" value="true" />',
 '<param name="wmode" value="transparent" />',
 '</object>'
 ].join(''),
 scope: {
 width: '@',
 height: '@',
 src: '@'
 },
 compile: function(elem, attrs, transcludeFn)
 {
 return function link (scope, element, attrs)
 {
 scope.$watch('src', function(src)
 {
 element.append('<param name="movie" value="' + src + '" />');
 });
 };
 }
 };
}]);

Its usage:

<div flash-embed src="testpreso/flash/preloader.swf" width="966" height="600"></div>

EDIT 5/8/2015 update

I am having troubles using this in IE8. A client of mine needs IE8 support, booo. The error I am getting in IE8 is:

[Object Error] description: "Invalid argument." message: "Invalid argument." name: "Error" number: -2147024809

It has to do with the object tag I believe. I found this thread that may shed some light on the issue: http://stackoverflow.com/questions/9150938/invalid-argument-in-ie-8-on-jquery-prepend-on-flash-objects

I will update if I figure this out

Tweeted twitter.com/#!/StackCodeReview/status/583220081188036609
deleted 5 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
Source Link
Ronnie
  • 151
  • 4
Loading
default

AltStyle によって変換されたページ (->オリジナル) /