Ubuntu 16.04下Firefox无法播放Facebook视频及Twitch黑屏问题求助
Hey there, let's work through this Firefox video problem you're facing on Ubuntu 16.04. Since Chromium works perfectly, we can narrow this down to Firefox-specific media configurations or missing dependencies—let's jump into actionable fixes:
1. Install Required Multimedia Codecs
Ubuntu 16.04's default Firefox setup might lack the necessary codecs for H.264 (the format most Facebook/Twitch videos rely on). Open your terminal and run these commands to install the full set of restricted extras and GStreamer plugins:
sudo apt-get update sudo apt-get install ubuntu-restricted-extras gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly
Once installed, restart Firefox and test the videos again. This is the most common fix for missing video playback on older Ubuntu/Firefox combinations.
2. Reset Firefox's Configuration Profile
Corrupted user settings can cause weird playback glitches even after reinstalling Firefox. Here's how to start fresh:
- Close Firefox completely (check the system tray to make sure it's not running in the background)
- Run this command in terminal to rename your old profile:
mv ~/.mozilla/firefox ~/.mozilla/firefox_old - Open Firefox again—it'll create a brand new, clean profile. Test Facebook and Twitch now. If this works, you can gradually migrate your bookmarks/settings from the old profile if needed.
3. Verify Flash Player Installation (and Enable It)
Since you mentioned reinstalling Flash, let's make sure you have the correct version for Firefox (NPAPI, not the Chrome/Chromium PPAPI version):
- Run this command to install the official Flash plugin:
sudo apt-get install flashplugin-installer - Restart Firefox, then type
about:pluginsin the address bar. Look for "Shockwave Flash" and ensure it's set to "Always Activate".
4. Tweak Firefox MediaSource Settings (for Twitch Black Screen)
Twitch relies on MediaSource Extensions to stream video, and sometimes this gets disabled accidentally:
- Type
about:configin Firefox's address bar, accept the warning when prompted - Search for
media.mediasource.enabledand double-click it to set it totrue - Next, search for
media.mediasource.mp4.enabledand also set that totrue - Restart Firefox and check Twitch again—this should fix the black screen while audio plays issue.
5. Disable Hardware Acceleration (as a Last Resort)
Sometimes hardware acceleration conflicts with older graphics drivers on Ubuntu 16.04:
- Go to Firefox's settings (
about:preferences#general) - Scroll down to the "Performance" section
- Uncheck the box that says "Use hardware acceleration when available"
- Restart Firefox and test playback.
Start with step 1 first—it's the most likely fix for your issue. If that doesn't work, move through the other steps one by one.
内容的提问来源于stack exchange,提问作者zakaria hilali

