Is it possibleto Start a Flash video with jquery?

I'm using html5 as a video player but as it doesn't work in ie8 and we have to support ie8 im using a fallback to flash. I need the videos to swap from one to another on click which i have got to work for both the html5 video player using .load and the flash player by replacing the html in a div but I need the video to start to play.

In html5 it works as follows:

                    $(".featureLogoText").on("click", function (event) {

                        $oVideo[0].pause();
                        $oPause.hide();
                        $oPlay.hide();
                        $oPlay.css('display', 'block');

                        var media = $(this).attr('media');
                        var mediamp4 = media + "mp4";
                        var mediawebm = media + "webm";
                        var mediaogv = media + "ogv";
                        var newPoster = $(this).attr('data-poster');
                        $('.scrPoster').attr('poster', newPoster);
                        $('.scrVideomp4').attr('src', mediamp4);
                        $('.scrVideowebm').attr('src', mediawebm);
                        $('.scrVideogg').attr('src', mediaogv);
                        $(".scrPoster").load();

                        var html = ' <param name=\"movie\" value=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\" type=\"application/x-shockwave-flash\"allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"352\" height=\"198\" flashvars=\"src=' + mediamp4 + '&poster=' + newPoster + '\"></embed>';

                        $("#objFlash").html("");
                        $("#objFlash").append(html);

                        var number = $(this).attr('data-number');
                        alert(number);

                        $oVideo[0].play();
                        $oPlay.hide();
                        $oPlayBig.hide();
                        $oPause.css('display', 'block');
                    });

How can i do the same thing with flash? is it possible? Or is there a better way to show video across browser incl ie8 - i've looked at videojs but it says that doesn t support ie8.

Thanks

Answers


This is strictly dependent on the type of flash player you choose to use.

some have an API that allow to programatically play the video.

In example. the common player FlowPlayer has such a command:

// get a handle to the first player on the page and start the clip
$f(0).play();

// get a handle to the first player and stop it
$f().stop();

Short answer: Yes.


Need Your Help

Variable Framerate into Constant Avconv

video avconv

I want to change a video with variable framerate into constant. I don't wanna mess up with any other part of the video except making constant the framerate.

Doing self join to hide duplicates - getting error message

sql-server tsql sql-server-2005

Ok, I'm doing a self query to suppress duplicates for a view. The code I'm using is:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.