-
-
Save wlerin/89a12362451490b1b18ac086bca59275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name show Showroom streaming url | |
// @namespace https://gist.github.com/wlerin | |
// @description ShowroomのストリーミングURLを表示 | |
// @include https://www.showroom-live.com/* | |
// @require http://code.jquery.com/jquery-3.4.1.min.js | |
// @version 0.6 | |
// ==/UserScript== | |
// Will display a streaming url in a box at the top of the screen | |
// pass that URL off to mpv or another player of your choice to watch the stream there instead of in a browser | |
function getStreamingUrl (room_id) { | |
$.ajax({ | |
url: "/api/live/streaming_url", | |
type: "GET", | |
data: {room_id:room_id} | |
}).done(function(data, status, xhr) { | |
if (room_id == null) { | |
return false; | |
}; | |
$('body').prepend($('<textarea>') | |
.val(data.streaming_url_list[0].url + | |
(data.streaming_url_list[0].stream_name ? '/' + data.streaming_url_list[0].stream_name : '') | |
) | |
.css('width','100%') | |
.focus(function(){ | |
setTimeout(function(){$(this).select();},0); | |
}) | |
.click(function(){ | |
$(this).select(); | |
return false; | |
}) | |
); | |
}); | |
}; | |
var room_id = SRApp.store.get("roomId") | |
if (room_id != null) { | |
getStreamingUrl(room_id) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment