Cutting a video short

15 views
Skip to first unread message

bob.woodman

unread,
Nov 30, 2009, 3:12:44 AM11/30/09
to SWFObject
Hi,

On www.kophillclimb.org.uk/_index.html I am using swfobject 2 to
deliver a video on startup. I provide a tab to switch to a new page if
the user wishes to cut it short and view the rest of the web site. On
firefox as soon as the "Video Page" has its display set to none the
video stops. On IE7 the video carries on but is not shown, however the
sound continues.

How can I get IE to stop playing the video?

Any help appreciated.

Bob Woodman

Sam Sherlock

unread,
Nov 30, 2009, 8:17:05 AM11/30/09
to swfo...@googlegroups.com
I would removeSwf when changing from the video tab to any other tab

then when (re-)activating the video tab createSwf


- S

2009/11/30 bob.woodman <bob.w...@btopenworld.com>

--

You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.



Sam Sherlock

unread,
Nov 30, 2009, 11:13:17 AM11/30/09
to swfo...@googlegroups.com
Hi Bob,

A good resource of swfobject examples can be found here

tests for both of the method I mentioned (and everything else too)


your code should remove the swf like so
swfobject.removeSWF("videoframe");

and more here too (examples and instructions)

FYI the video does stop in my version of firefox (version 3.5.5); even so I would still remove and add when navigating back to the tab.  Removing it is a sure fire way to stop it playing + I feel its safer than leaving it there in an inactive tab (browsers can some times crash when lots is going on - removeswf removes the flash from the page).  I have not checked other browsers 

you could check the value of menuname within the change function you have in _khc.js


(I have some code I have tried in firebug to get this to work and may be able to revisit it later)

- S

ps I replied to the list; other may have something to add / suggest


2009/11/30 bob.woodman <bob.w...@btopenworld.com>
Hi Sam,

Thanks for the rapid response. I feel I am a beginner in a man's
world.

I tried onclick="javascript:document.getElementById
('videoframe').removeSWF("kophillintro2.swf"); changemenu
('home_page')";

where "videoframe" is the Id of the object and "kophillintro2" the
name of the video. No effect in Firefox or IE.

The document.getElementById('videoframe').stop(); works in IE but not
in Firefox. This when when in IE is very good (it operates like
"pause" because if you go back to the video you can start it from
where you stopped it.)

Bob Woodman


On Nov 30, 1:17 pm, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> I would removeSwf when changing from the video tab to any other tab
>
> then when (re-)activating the video tab createSwf
>
> http://code.google.com/p/swfobject/wiki/api
>
> - S
>
> 2009/11/30 bob.woodman <bob.wood...@btopenworld.com>
>
> > Hi,
>
> > Onwww.kophillclimb.org.uk/_index.htmlI am using swfobject 2 to

> > deliver a video on startup. I provide a tab to switch to a new page if
> > the user wishes to cut it short and view the rest of the  web site. On
> > firefox as soon as the "Video Page" has its display set to none the
> > video stops. On IE7 the video carries on but is not shown, however the
> > sound continues.
>
> > How can I get IE to stop playing the video?
>
> > Any help appreciated.
>
> > Bob Woodman
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "SWFObject" group.
> > To post to this group, send email to swfo...@googlegroups.com.
> > To unsubscribe from this group, send email to

Bob Woodman

unread,
Dec 6, 2009, 3:40:30 PM12/6/09
to swfo...@googlegroups.com
Hi Sam,
 
I want to thank you for your help. Inserting
swfobject.removeSWF("videoframe");
certainly got both browsers working in the same way and the video halted.

I feel most inadequete since if I had read on within your tutorials I am sure I would have been able to sort it out myself.

However, I am not capable of re-starting the video if you go to www.kophillclimb.org.uk/_index1.html you will see I have inserted into the javascript

function newvideo()
  {
  var h = document.getElementsByTagName("head")[0];
  var s = document.createElement("script");
    s.setAttribute("id", "dynamicSwfobject");
    s.setAttribute("type", "text/javascript");
    s.setAttribute("src", "swfobject.js");
    h.appendChild(s); 
    var t = setInterval(function()
     {var a = typeof swfobject;
      if (typeof swfobject != "undefined")
      {
      var flashvars = {};
     var params = {loop:"false"};
     var attributes = {};
     swfobject.embedSWF("kophillintro2.swf", "videoframe", "599", "479", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
     clearInterval(t);
     t = null;
     }
     }, 50);
  }

and I have called it from the HTML line 85 with - onclick="newvideo()". The javascript seems to have worked but the video does not restart!Any help appreciated.

 

Bob Woodman

---- Original Message ----- 
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.426 / Virus Database: 270.14.87/2536 - Release Date: 11/30/09 07:31:00

Aran Rhee

unread,
Dec 6, 2009, 7:49:44 PM12/6/09
to swfo...@googlegroups.com
Hi Bob.

I am enetering this thread a bit late (without the offline diswcussion knowledge), but from what I can see from your code, you are wanting to dynamically recreate the "videoframe" div once you have removed it, not re-insert the swfobject.js library file.

What happens when you remove the swf is that you now no longer have an element "videoframe" to replace your swf content with. when you run your newvideo function, <div id="videoframe"> does not exist any more!


Have a look at this tut (in the section "Using an 'onclick' event to replace a loaded SWF with another SWF"). It should get you up and happening. The technique is much the same as you are already using to dynamically insert in an element to the DOM.



I hope this helps.


Cheers,
Aran

Bob Woodman

unread,
Dec 7, 2009, 12:30:25 AM12/7/09
to swfo...@googlegroups.com
Hi Aran
 
Thanks very much. It was quite easy after reading your link, but impossible before!
I was able to watch what had happened to my html after each step from the "source" listing.
 
Bob Woodman

Version: 8.5.426 / Virus Database: 270.14.96/2548 - Release Date: 12/06/09 07:30:00

Aran Rhee

unread,
Dec 7, 2009, 12:46:05 AM12/7/09
to swfo...@googlegroups.com
Yes, unfortunately some things are a bit more difficult to implement in SWFObject 2.x due to other overarching desires for the project.

I'm glad it made sense on you were pointed in the right direction. We are hoping to have a centralised list of examples and common use cases available for people soon (helps us on the repetition on the lists too :) 


Cheers,
Aran

jeremy

unread,
Dec 14, 2009, 9:59:50 AM12/14/09
to SWFObject
I'm having the same issue with IE8.

I am using removeSWF but the sound of the movie keeps on playing.

Please let me know if you find something out. I've spent way too many
hours trying to get this functional.

On Nov 30, 2:12 am, "bob.woodman" <bob.wood...@btopenworld.com> wrote:
> Hi,
>
> Onwww.kophillclimb.org.uk/_index.htmlI am using swfobject 2 to

Sam Sherlock

unread,
Dec 14, 2009, 2:10:51 PM12/14/09
to swfo...@googlegroups.com

Hi Jeremy,

Please post a link to your project or some code

- S




2009/12/14 jeremy <jerem...@gmail.com>
Reply all
Reply to author
Forward
0 new messages