Reputation: 41
I'm writing a dashing widget to stream a video. I have a widget that works, however getting it to change the URL remotely with batman.js is eluding me. As far as I can tell, all I'm needing to do is modify the end of a URL inside an object, but I'm not sure if I'm even going about this the correct way.
I would like to use a command like dashing uses in its example:
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "channel": "12345" }'\http://url:3030/widgets/twitch
the dashboard: twitch.erb
<li data-row="1" data-col="1" data-sizex="3" data-sizey="2">
<div data-id="twitch" data-view="twitch"></div>
</li>
the widget: twitch.html
<object type="application/x-shockwave-flash" height="700" width="990" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=CHANNEL"></object>
twitch.coffee
class Dashing.Twitch extends Dashing.Widget
ANSWERED
And of course, after playing with it for another 10 minutes I figured it out. But for anyone else, here is what I changed:
twitch.html
<object type="application/x-shockwave-flash" height="700" width="990" id="live_embed_player_flash" data-bind-data="channel | prepend 'http://www.twitch.tv/widgets/live_embed_player.swf?channel='"></object>
Upvotes: 2
Views: 772
Reputation: 41
And of course, after playing with it for another 10 minutes I figured it out. But for anyone else, here is what I changed:
twitch.html
<object type="application/x-shockwave-flash" height="700" width="990" id="live_embed_player_flash" data-bind-data="channel | prepend 'http://www.twitch.tv/widgets/live_embed_player.swf?channel='"></object>
Upvotes: 2