sp.nicovideo.jp - video doesn't play
URL: http://sp.nicovideo.jp Browser / Version: Firefox 37.0.2 Operating System: Android Problem type: Video doesn't play
Steps to Reproduce
- Navigate to: http://sp.nicovideo.jp
- …
Expected Behavior: Video plays.
Actual Behavior: http://sp.nicovideo.jp/watch/sm26188376 for example, Firefox cannot play the video but chrome can play it inside the browser.
country: jp
We need to find out why the video is not playing inside the browser.
On the contact side, Mozilla Japan seems to have contact. So after analysis, we can switch this bug to contactready.
When going to http://sp.nicovideo.jp/watch/sm26188376 we get a play button, when we tap on it, we are redirected to a login page on Firefox for Android.

on iOS the menu is slightly more complex, but we get the same redirect for a login.

After login, on Firefox Android, we get back to the page, then tapping play again, the wheel starts and stop. The player is at #jsPlayerGuideLayoutContainer. There is a defined tap area covering the video.
<div class="tap-area" id="jsTapArea"></div>
with an attach event touchend
function() {
b.controller_view_model.toggleController()
}
once tapped we get a #jsPlayerLoadingContainer.
The video is already here in the DOM with a 1px by 1px size.
<div style="top: 0px;" class="player-video" id="jsPlayerVideo">
<video style="height: 1px; width: 1px;"
src="http://smile-cln39.nicovideo.jp/smile?m=26188376.74686low" id="video">
</video>
</div>
from the console when I force the video with window.location= 'http://smile-cln39.nicovideo.jp/smile?m=26188376.74686low' it plays. So there's something which is not working in the sequence of events. I haven't found yet what is blocking.
@hallvors Any ideas?
I see code in "ScreenLayoutFactory" that appears to rely on window.orientation. I'll dig some more to see if this is the root cause.
Mozilla Japan has contact, will contact them.
I see code in "ScreenLayoutFactory" that appears to rely on window.orientation
If that turns out to be the case, I have some screen.orientation (actual web standard) code that we can share with them to use as a fallback for lack of window.orientation (non-standard).
When requesting a page like http://sp.nicovideo.jp/watch/sm26143171?cp_in=wt_tp_recomuser_sherlock&rec_pos=4
<div id="jsDataContainer"
data-watch_api_url="http://www.nicovideo.jp/watch/sm26143171?mode=sp_web_html5&playlist_token=sm26143171_1431552568_77407a919760db308ee0b2e3451e5c8c57d4d8a4"
data-flapi_url="http://flapi.nicovideo.jp/"
data-spweb_url="http://sp.nicovideo.jp/"
data-watch_id="sm26143171"
data-video_id="sm26143171"
data-thread_id="1430365146"
data-default_thread_id="1430365146"
data-is_channel="false"
data-video_author_id="22957480"
data-has_owner_thread="false"
data-csrf_token="48291828_1431552568_3f21a0e77936a17d7d72187bb731382be301722"
data-inline_playable="false">
When that last property meets this method:
a.prototype.setLayout = function(a) {
var b = a.video_layout;
this.context.inline_playable || (b.height = 1, b.width = 1), this.video_view.setLayout(b)
you end up with videos being 1x1 because they are not considered 'inline playable'.
The property in the HTML seems set by backend browser sniffing, it is fixed by adding an Android version number.
(Issues are not entirely solved, however - the video doesn't start until you've tapped a few times)
Seems Firefox doesn't fire the loadedmetadata event when the page expects. This is why it doesn't start auto-playing and needs a couple of extra taps.
Spec: https://html.spec.whatwg.org/multipage/embedded-content.html#event-media-loadedmetadata
Demo: go to http://www.w3.org/2010/05/video/mediaevents.html and click/tap the "load()" button. In other browsers, note how the counter for loadedmetadata goes up to 1 and the square turns green after a few seconds of loading. In Firefox this counter doesn't move until you click the play() button.
This causes the problem when nicovideo's watch/html5.min.js script does
this.video_element.addEventListener("loadedmetadata", function() {
a.videoLoadeddata()
})
and
a.prototype.videoLoadeddata = function() {
this.video_loaded = !0, this.checkLoadFinish()
}
which is supposed to start the video.
Moving bug to contactready - we need to ask them to fix the backend browser detection that sets data-inline_playable="false"
FYI - here's a follow-up bug for the fix we need on our side: https://bugzilla.mozilla.org/show_bug.cgi?id=1165203
I have sent a request to the person I know to introduce appropriate person to share this issue and its solutions.
I have started to communicate with its developers.
The fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1165203 is on inbound, so will likely land in Gecko very soon (unless it's backed out, of course).
With nightly, I am now start the video without problem. However user comments that scroll on the video are not displayed.
@kudodo I think we need a separate bug about that.
Bug 1165203 - Video doesn't start on nicovideo.jp because we don't send a loadedmetadata event in response to video.load() is fixed
Next one to tackle is #1410
I'm closing this one. Fixed through fixing the gecko bug.