ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.67k stars 815 forks source link

SWF results in white screen #10511

Open ghost opened 1 year ago

ghost commented 1 year ago

Describe the bug

http://can.cbs.com/thunder/player/chrome/canplayer.swf?allowScriptAccess=always&allowFullScreen=true&pid=u4uKImT6OqQR&partner=pp_us_lcp_android&autoPlayVid=false&owner=CBS%20Production%20News

opens in Ruffle, says The Ruffle emulator may not yet fully support all of ActionScript 3. If I click Run anyway its just a white screen.

Expected behavior

play video

Affected platform

Browser's extension

Operating system

Windows 10

Browser

Mozilla Firefox

Additional information

No response

n0samu commented 1 year ago

Can you please link the webpage with the video you were trying to view? Flash video players don't work when accessed directly via the SWF link.

ghost commented 1 year ago

https://www.cbs.com/shows/video/_hq4hssGo_AlNugSeEMh_5zV4HYr1nYE/

n0samu commented 1 year ago

That's an HTML5 video page and the video plays fine in modern browsers. Where did you even find a Flash element there?

Lord-McSweeney commented 1 year ago

Additionally, the video was published very recently.

ghost commented 1 year ago

the SWF link in the original issue post, can be found in the HTML source that I commented. so isn't that enough? I am not sure what you are looking for. the SWF URL is valid and can be downloaded

Lord-McSweeney commented 1 year ago

Most of the time, SWF video players get passed flash vars, which are parameters telling the file what video to play. Just opening the SWF will not give it the flashvars it needs, which the page containing the SWF would normally provide.

n0samu commented 1 year ago

It would definitely be interesting to see if their Flash video player is still working in the modern day, but I would need a page that actually uses the Flash video player to test it. As Lord-McSweeney said, the page source doesn't contain all of the necessary information (flashvars) that would make the video player actually functional.

Lord-McSweeney commented 1 year ago

It seems that even after passing flashvars and config XML files, it errors with the same error. This could indicate a problem with Ruffle's XML parsing.

ghost commented 1 year ago

looking at this page:

https://srv.veoh.com/videos/v39987670hewbtZa9

I see this in the source:

<embed
src='http://can.cbs.com/thunder/player/chrome/canplayer.swf' bgcolor='666666'
name='can' allowscriptaccess='never' allowfullscreen='true'
flashvars='pid=pUjYuZrmnWgT&partner=veoh&autoPlayVid=true&config=http://can.cbs.com/thunder/player/chrome/config/overrides/skin_ad.xml'
type='application/x-shockwave-flash'
pluginspage='http://www.macromedia.com/go/getflashplayer' height='469'
width='540' wmode="transparent"></embed>

so does that answer the question?

Lord-McSweeney commented 1 year ago

By removing the debug code, the SWF can be progressed to Modifying an XMLList object is not supported. Modified SWF with config: cbs-player.zip Run with -PautoPlayVid=true -Plink=/video/show-redirect/?pid=CB8k_SUiQLuVlvCrvR770DZwL8Zs13Ne -Ppid=CB8k_SUiQLuVlvCrvR770DZwL8Zs13Ne -Ppartner=cbs -Puvpc=http://web.archive.org/web/20110210072248/http://www.cbs.com/thunder/chromeless/pause_and_panel_ads.xml.

ghost commented 1 year ago

I can confirm @Lord-McSweeney result. Running the modified SWF with the given command returns the same error he is reporting. Is this a permanent limitation, or is it something that might be fixable?

Lord-McSweeney commented 1 year ago

The error is fixable- it's caused by Ruffle not yet implementing being able to modify XMLLists.

Lord-McSweeney commented 1 year ago

This now has the following error:

Error dispatching event EventObject(EventObject { type: "XMLConfigLoaderEvent.ON_CONFIG_READY", class: com.cbs.can.lib.config.xml.events::XMLConfigLoaderEvent, ptr: 0x562d229c08f0 }) to handler FunctionObject(FunctionObject { ptr: 0x562d22c79560 }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: protocol)
    at com.cbs.can.lib.utils::URLParser$/parse()
    at com.cbs.can.lib.utils::JavaScriptUtil$/getHostViaInjection()
    at com.cbs.can.shell.business::PlayerServiceCall/getHost()
    at com.cbs.can.shell.business::PlayerServiceCall/getPlayerServiceData()
    at com.cbs.can.shell::CANPlayer/makePlayerServiceCall()
    at com.cbs.can.shell::CANPlayer/onConfigReady()
    at com.cbs.can.shell::CANPlayer/handleConfigLoaderEvent()
    at flash.events::EventDispatcher/flash::events::EventDispatcher::dispatchEvent()
    at com.cbs.can.lib.config.xml::XMLConfigLoader/onConfigListLoaded()
    at com.cbs.can.lib.config.xml::XMLConfigLoader/loadNextConfig()
    at com.cbs.can.lib.config.xml::XMLConfigLoader/onLoadComplete()

This is because Ruffle doesn't support ?P< regex syntax.

(run with

ruffle canplayer.swf -PautoPlayVid=true -Plink=/video/show-redirect/?pid=CB8k_SUiQLuVlvCrvR770DZwL8Zs13Ne -Ppid=CB8k_SUiQLuVlvCrvR770DZwL8Zs13Ne -Ppartner=cbs -Puvpc=http://web.archive.org/web/20110210072248/http://www.cbs.com/thunder/chromeless/pause_and_panel_ads.xml --spoof-url http://can.cbs.com/thunder/player/chrome/canplayer.swf?allowScriptAccess=always\&allowFullScreen=true\&pid=u4uKImT6OqQR\&partner=pp_us_lcp_android\&autoPlayVid=false\&owner=CBS%20Production%20News

after extracting the zipped files)