473,395 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

'flashvideoplayer' is null or not an object

I have this page that works great in every browser I've tried except IE. It uses javascript to pass variables to a .swf and whenever I look at it in IE it give me this error:

'flashvideoplayer' is null or not an object.


This is the page that I'm working on:
http://www.hightechhigh.org/video/index2.php

The function that is giving me problems is this:

Expand|Select|Wrap|Line Numbers
  1. function initialize() {
  2. flashvideoplayer = window.videoplayer;
  3. }
  4.  
[HTML]<body onLoad="initialize();" >[/HTML]


.... which refers to my .swf file here:

[HTML]<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="450" height="338" name="videoplayer" />
<param name="allowScriptAccess" value="always" >
<param name="movie" value="video.swf" />
<embed src="video.swf" quality="high" bgcolor="#ffffff" width="450" height="338" name="videoplayer" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="videoplayer" >
</object>
[/HTML]
Unfortunately I only know enough javascript to be dangerous so
any help or suggestions would be greatly appreciated.
Nov 8 '07 #1
15 3337
acoder
16,027 Expert Mod 8TB
You have an error in Firefox too:

flashvideoplayer.playVideo is not a function.
Nov 9 '07 #2
You have an error in Firefox too:

flashvideoplayer.playVideo is not a function.
Thanks.

I fixed the cause of the error but found that it did not effect the problem that I'm having with IE.
Nov 9 '07 #3
acoder
16,027 Expert Mod 8TB
Since you've given the OBJECT tag an id of "videoplayer", use document.getElementById("videoplayer") to refer to it.
Nov 9 '07 #4
Since you've given the OBJECT tag an id of "videoplayer", use document.getElementById("videoplayer") to refer to it.
Thank you very much for taking time to reply to my post.

I changed how the variable "flashvideoplayer" was defined from:
Expand|Select|Wrap|Line Numbers
  1. flashvideoplayer = window.videoplayer;
to:
Expand|Select|Wrap|Line Numbers
  1. flashvideoplayer = document.getElementById('videoplayer');
My original error went away but was replaced with this new one:

'videoplayer' is undefined

Any ideas??
Nov 13 '07 #5
acoder
16,027 Expert Mod 8TB
Which line does this occur on?

It should be a line using "videoplayer" - perhaps that should be changed to flashvideoplayer?
Nov 13 '07 #6
Which line does this occur on?

It should be a line using "videoplayer" - perhaps that should be changed to flashvideoplayer?
http://www.hightechhigh.org/video/index2.php
IE is telling me that the error is on Line: 1 Char:1

I changed all instances of "videoplayer" to "flashvideoplayer" and saved it to:
http://www.hightechhigh.org/video/index3.php
This variation also works fine on other browsers but gives me the following error in IE:
Line: 48
Char: 3
Error: Object expected
This variation does not seem like a step in the right direction. Line 48 is within the following function that is only called from a link to "start video":
42. function initFlashPlayVideo() {
43.
44. var video = "";
45. updateStatus("____" + video + "____");
46. flashvideoplayer.playVideo(video);
47. document.pauseButton.src = pauseButton.src ;
48. var play_V = document.getElementById('PLAY');
48.
50. //update page elements
51. play_V.innerHTML = "";
52. }
Nov 14 '07 #7
acoder
16,027 Expert Mod 8TB
You have two elements with the same "flashvideoplayer" ID: the object and embed tag. IDs must be unique. On top of that, the name of the embed tag is also flashvideoplayer and IE is easily confused between name and ID.

I'm not sure if this will solve it, but it may help.
Nov 14 '07 #8
You have two elements with the same "flashvideoplayer" ID: the object and embed tag. IDs must be unique. On top of that, the name of the embed tag is also flashvideoplayer and IE is easily confused between name and ID.

I'm not sure if this will solve it, but it may help.
I think it helped, I no longer have an error when the page loads in IE.

Now when I make a selection from the pull down list I am getting the following error from IE:
Line: 33
Char: 1
Error: 'flashvideoplayer' is null or not an object
Line 33 is this line within in the following function:
flashvideoplayer.playVideo("" + video);
Expand|Select|Wrap|Line Numbers
  1. /* When the user selects a movie from the pull down list on the the form, update the videoStatus text area, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
  2. function callFlashPlayVideo() {
  3. var comboBox = document.forms['videoForm'].videos;
  4. var video = comboBox.options[comboBox.selectedIndex].value;
  5. updateStatus("____" + video + "____");
  6. flashvideoplayer.playVideo("" + video);
  7. var play_V = document.getElementById('PLAY');
  8.  
  9. //update page elements
  10. get_movie_info('getInfo.php?flv='+ video +'&return=all','film_title','video_info-title','video_info-desc','<img src="gifs/loading_animation.gif"  width="30" alt="loading.."border="0">');
  11. play_V.innerHTML = "";
  12.  
  13. }
Nov 15 '07 #9
acoder
16,027 Expert Mod 8TB
I'm not sure, but this link might help in your struggles with the embed tag, i.e. try using object only.
Nov 16 '07 #10
I'm not sure, but this link might help in your struggles with the embed tag, i.e. try using object only.
Yes it was helpful. I simplified some of the Object tags and it changed my IE error message once again.

Now when I make a selection from the pull down list I am getting the following error from IE:

Line: 33
Char: 1
Error: Object doesn't support this property or method.

Line 33 is this line within in the following function:
flashvideoplayer.playVideo("" + video);
Expand|Select|Wrap|Line Numbers
  1. /* When the user selects a movie from the pull down list on the the form, update the videoStatus text area, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
  2. function callFlashPlayVideo() {
  3. var comboBox = document.forms['videoForm'].videos;
  4. var video = comboBox.options[comboBox.selectedIndex].value;
  5. updateStatus("____" + video + "____");
  6. flashvideoplayer.playVideo("" + video);
  7. var play_V = document.getElementById('PLAY');
  8.  
  9. //update page elements
  10. get_movie_info('getInfo.php?flv='+ video +'&return=all','film_title','video_info-title','video_info-desc','<img src="gifs/loading_animation.gif"  width="30" alt="loading.."border="0">');
  11. play_V.innerHTML = "";
  12.  
  13. }
Nov 16 '07 #11
acoder
16,027 Expert Mod 8TB
So at least it's now recognising "flashvideoplayer" as an object.

What does your object tag look like now? There's no other elements with a name or id of "flashvideoplayer" now, is there?
Nov 17 '07 #12
Hi,

i have also same problem like you.... can you give me what was your solution to avoid this problem.....

i have used same like you:

var isIE = navigator.appName.indexOf("Microsoft") != -1;
flashvideoplayer = (isIE) ? window['videoPlayer'] : document['videoPlayer'];

but still it is giving error in IE....

videoPlayer is undefined....

and let me know is there any possibility of js error in .swf file..... for creating object

plase give me replay as soon as possible.....

Thanks,
Nilesh
Nov 21 '07 #13
acoder
16,027 Expert Mod 8TB
Hi

Maybe this might help you.
Nov 21 '07 #14
Hi,

my flash embeded is like following:

[HTML]<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="740" height="420" id="FileUpload" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="FileUpload.swf?cookies=<?= $cookieString ?>&contentId=<?= $contentId ?>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#e1e2ff" />
<embed src="FileUpload.swf?cookies=<?= $cookieString ?>&contentId=<?= $contentId ?>" quality="high" bgcolor="#e1e2ff" width="740" height="420" name="FileUpload" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
[/HTML]
in that object tag have id="FileUpload" while embed tag have name="FileUpload" ...

is it causing any problem in IE?

when my page is loading at that time only it is giving me error in IE
"FileUpload" is undefined

i donot have much idea on flash.. so, can you tell me is it possible any javascript programming in .swf file? and may be it is casing the problem to creating object of "FileUpload"

is any wrong parameter is passed or we need more parameters in object or embe tag in IE?

Thanks,
Nov 21 '07 #15
acoder
16,027 Expert Mod 8TB
in that object tag have id="FileUpload" while embed tag have name="FileUpload" ...

is it causing any problem in IE?
Yes, that is a problem in IE. IE is confused between id and name. Keep names and ids unique (to avoid IE's bug).
Nov 21 '07 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: RMD | last post by:
I need to be able to keep a list of object references, and null them out one by one at a later point in time. I realize this can be dangerous, but I have my reasons. I can't figure out, however,...
99
by: Mikhail Teterin | last post by:
Hello! Consider the following simple accessor function: typedef struct { int i; char name; } MY_TYPE; const char *
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
64
by: yossi.kreinin | last post by:
Hi! There is a system where 0x0 is a valid address, but 0xffffffff isn't. How can null pointers be treated by a compiler (besides the typical "solution" of still using 0x0 for "null")? -...
3
by: toton | last post by:
Hi, In some cases when my function returns, I need to return a object of null state. This is when I return object by value. (Just like for by pointer, I can return a null pointer ). It has to be...
46
by: lovecreatesbea... | last post by:
Do you prefer malloc or calloc? p = malloc(size); Which of the following two is right to get same storage same as the above call? p = calloc(1, size); p = calloc(size, 1);
11
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When...
1
by: grbgooglefan | last post by:
I am in a perculiar situation. I want to use PyRun_SimpleString for creating Python functions in embedded Python in C++. But there could be cases when Python function code compilation could fail &...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.