This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Embeding a video with a dynamic "src"

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to embed a video in the jsp page. The "src" of the object tag is dynamic. Here is my coding.



I have several links in a data grid. In the onclick event of those links I am calling a javascript function with the file name (like 123.mpg) and it will be feeded to the "val" variable above. According to that I am setting the innerHTML property. So once I click the link it will popup a video with dynamic content.

The problem is this does not work on Firefox. This works fine in IE. Is there any possibility of failing this in Firefox.

For Your Information

/Test/ShowImage?contentImageName="+val+"' will execute a servlet which will write the video file in to the servlet output stream. And if its an image instead of a video this works fine. And the MPG files i tested are larger than 5MB and less than 10 MB.

Need your help.

Thank you.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has your FF installed with Windows Media plugin ?
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes its installed. I did a sample code for this and it worked perfectly. Have a look at this.



Only difference is the src is generated dynamically in my code. Here its a hard coded one just to check whether the div refresh works. Here is the coding for get the serveltout putstream for the video.

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you alert the innerHTML, does the code look correct?

Eric
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it looks fine the path is displayed. Also I pasted the src url into the browser address bar and it displays the message box for mpg file. The same coding works for image type once I change the content type. But when it comes to video this occurs. Firefox doesnt render that servlet output stream as I observed.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic