tikservices / html5-video-everywhere

Higher performance and stable video watching experience on the web
https://h5vew.tik.tn/
Mozilla Public License 2.0
118 stars 51 forks source link

Add support for Brightcove Experience #45

Open wildstray opened 9 years ago

wildstray commented 9 years ago

Brightcove Experience is a video platform used by some news websites (eg. http://tv.ilfattoquotidiano.it/)

The plaform itself seems to support html5, unfortunately the video producers choose to use flash only to stream videos :\

In html of pages containing Brightcove videos there are some "meta", eg.:

<meta property="og:type" content="video" />
<meta property="og:video:width" content="380" />
<meta property="og:video:height" content="280" />
<meta property="og:video" content="http://c.brightcove.com/services/viewer/federated_f9/?isVid=1&isUI=1&playerID=2274739660001&autoStart=true&videoId=4194558956001" />
<meta property="og:video:secure_url" content="https://secure.brightcove.com/services/viewer/federated_f9/?isVid=1&isUI=1&playerID=2274739660001&autoStart=true&videoId=4194558956001&secureConnections=true" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

The property "og:video" might be interesting:

http://c.brightcove.com/services/viewer/federated_f9/?isVid=1&isUI=1&playerID=2274739660001&autoStart=true&videoId=4194558956001

That is redirected to (maybe a load balancer?):

http://admin.brightcove.com/viewer/us20150326.1403/BrightcoveBootloader.swf?playerID=2274739660001&autoStart=true&isUI=1&isVid=1&videoId=4194558956001

Wich is redirected to:

http://admin.brightcove.com/viewer/us20150326.1403/federated/BrightcovePlayer.swf?playerID=2274739660001&autoStart=true&isUI=1&isVid=1&videoId=4194558956001

From there, some network sniffing and/or reverse engineering is needed to understand how the URL of the stream is obtained...

wildstray commented 9 years ago

Some useful documentation about Brightcove APIs: http://docs.brightcove.com/en/video-cloud/smart-player-api/references/symbols/brightcove.api.BrightcoveExperience.html http://support.brightcove.com/en/video-cloud/docs/dynamically-loading-player-using-javascript

wildstray commented 9 years ago

It seems that is sufficient to add < param name="forceHTML" value="true" / > to the < object > block (always inside a < div class="BrightcoveExperience" > block ) to force the HTML5 version of the player. But Brightcove player is embedded in webpages of other websites... so, how to detect it without using match on URL?

wildstray commented 9 years ago

It might be sufficient to add a plugin for Brightcove with this code: var node = document.createElement("param"); node.setAttribute("name", "forceHTML"); node.setAttribute("value", "true"); var container = document.getElementsByClassName("BrightcoveExperience"); if (container.length > 0) { container[0].appendChild(node); } ...I tried, it doesn't work anymore... too complicated (eg. sha256, harness-options.json and main.js and other files to be updated... honestly I refer to the author... or I simply will write a greasemonkey script for me...)