Post Reply 
Youtube flash detection
Apr. 01, 2009, 09:55 AM
Post: #1
Youtube flash detection
Youtube is doing some sort of flash detection using canPlayV9Swf() but I can't find for the life of me where that method is defined. Any one know what this method does. After doing its checks it seems to do the the fallback message if it can't detect Flash or you have javascript turned off;

<div id="watch-player-div" class="flash-player">

<div id="watch-noplayer-div">
<noscript>Hello, you either have JavaScript turned off or an old version of Adobe's Flash Player. <a href="http://www.adobe.com/go/getflashplayer/" onmousedown="urchinTracker('/Events/VideoWatch/GetFlash');">Get the latest Flash player</a>.</noscript>
<script type="text/javascript">
document.write('Hello, you either have JavaScript turned off or an old version of Adobe\'s Flash Player. <a href=\"http://www.adobe.com/go/getflashplayer/\" onmousedown=\"urchinTracker(\'/Events/VideoWatch/GetFlash\');\">Get the latest Flash player</a>.');
</script>
</div>
</div> <script type="text/javascript">
var fo = writeMoviePlayer("watch-player-div");
</script>

Help Appreciated. Thanks.
Add Thank You Quote this message in a reply
Apr. 01, 2009, 11:46 AM (This post was last modified: Apr. 01, 2009 11:54 AM by sidki3003.)
Post: #2
RE: Youtube flash detection
"canPlayV9Swf" is defined in base_all_with_bidi-vfl87002.js, but it's scrambled. The browser knows the pretty-print version:

Code:
canPlayV9Swf = function () {
    var a = j.deconcept, b = a.SWFObjectUtil.getPlayerVersion();
    if (b.major < 9) {
        return g;
    }
    if (navigator.userAgent[v]("Sony/COM2") > -1) {
        var c = new (a.PlayerVersion)([9, 1, 58]);
        if (!b.versionIsValid(c)) {
            return g;
        }
    }
    return i;
};


I didn't see the assignments for "i" and "g", but former is "success" and latter "fail". "Success" if Flash is installed *and* v9 or better.
Add Thank You Quote this message in a reply
Apr. 03, 2009, 08:40 AM
Post: #3
RE: Youtube flash detection
shezam;

I used to to get that error too, all the time with the stupid and incorrect messages - ARGH! Wink


So I did my usual dissection thing, and figured out how to bypass all of Google's crap. Here's what I came up with:

Code:
Name = "force youtube to play nice!"
Active = TRUE
Limit = 1024
Match = "<div id="watch-noplayer-div">*<noscript>*</div>"
Replace = "<embed src=embedURL>"


Discussion:

The Match string shown appears on the page whether your Flash proggie passes or fails the version test. It is displayed depending on the test results, but fortunately for us, we don't care about that - we have something reliable to match on. The Replace string inserts the source into the page, seemingly right over the top of the wording. At least for me, the video is displayed and it auto-starts as expected. That's probably all we can ask for, eh? Big Teeth

The Replace string comes from a variable named in a script in the Head section of the page. Properly speaking, the <embed> statement should be terminated with a closing tag, but IE is very forgiving. Append one if you wish, or if your browser chokes. Also, some browsers may not handle the <embed> element - just use <object> instead of <embed>, you'll get the same results.

Note that all my usual filtering is active - Proxo is preventing my eyeballs from going insane with the ads and junk. Sinister

Lastly, I do have to allow Google/YouTube to deposit a cookie on my machine, but that's almost not worth worrying about, there are so many ways to deal with cookies in general, and Google one's in particular.

HTH



sumgai

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Apr. 03, 2009, 10:01 AM (This post was last modified: Apr. 03, 2009 10:06 AM by lnminente.)
Post: #4
RE: Youtube flash detection
I wrote a vintage filter to take the url of the video, maybe it is still working. If not you will have an idea to take the url of the video.
Code:
[Patterns]
Name = "[02.b] Youtube: Take link to video [Youtubevideourl] {ln}081008"
Active = FALSE
URL = "$TYPE(htm)[^/]++.youtube.com/"
Limit = 150
Match = "'(http://s.ytimg.com/yt/swf/watch-v*)\1'"
        ""
        "$SET(YoutubeVideoURL=\1)"
        "$TST(zone=*.Html.*)"
Replace = "'\1'$STOP()"

I don't use these web filters anymore because i intercept the request http header to change it to fmt 18, being able to listen in HQ also the embedded videos from youtube in other websites (filter posted in his right thread).
The video ads are killed also with header filters.

edit: maybe nowadays i would use watch-v\w)\1 instead of watch-v*)\1'
Add Thank You Quote this message in a reply
Jun. 06, 2009, 12:00 AM
Post: #5
RE: Youtube flash detection
Any else constantly bothered by youtube flash detection.....?

A day ago I start getting

"Hello, you either have JavaScript turned off or an old version of Adobe's Flash Player. Get the latest Flash player."

So i did the usual debug of bypass proxo and the message goes away!
Add Thank You Quote this message in a reply
Jun. 06, 2009, 05:52 AM
Post: #6
RE: Youtube flash detection
(Jun. 06, 2009 12:00 AM)bugger Wrote:  Any else constantly bothered by youtube flash detection.....?

A day ago I start getting

"Hello, you either have JavaScript turned off or an old version of Adobe's Flash Player. Get the latest Flash player."

So i did the usual debug of bypass proxo and the message goes away!
Yes, youtube changed some things, sidki is aware of the problem !
Wink
Add Thank You Quote this message in a reply
Jun. 06, 2009, 06:01 AM
Post: #7
RE: Youtube flash detection
I had a problem with Flash not appearing on Youtube, and it was the filter that blocks the Javascript detection for the browser ID that was causing that. I excluded ytimg.com from being filtered with that and it fixed the problem.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: