YouTubestream· Nov 8, 2024· 2:41:21

Using Mux with Laravel

Watch on YouTube ↗

transcript

353 moments
  1. e

  2. e e

  3. all right I think I think we are up we're up we are up how's it going Dave good how's it going Josh uh it's going pretty good I was telling Dave everyone beforehand um I usually I try to like set everything up and then like do some tests and stuff like that and it never works the way I I I hope it does um but

  4. yeah Dave Dave reached out and want uh let me help set this up to basically uh long story short I used to use mck in a SAS app that I was building at the time probably the first second SAS app that I built within laravel um and one of the reasons why I like started learning laravel and uh I I needed mck for something specific and maybe we'll dive into like the code and see how terrible

  5. it is in a little bit uh but uh then I was like okay I haven't really actually gotten the chance to play around with M since then and I was doing like a specific thing for me where I needed to grab the video and basically send it to M uh after someone up or basically someone could create a loom video type thing in their browser and it's uploads to S3 but then would upload

  6. to MX and then we would like transfer out that URL and stuff like that um yeah super excited to talk to talk about talk about M uh Dave what is what is M first of all and then like uh well I guess you can introduce yourself too uh like who who is who is Dave um and then I know that some people might know at least of your name and maybe like

  7. Twitter profile too from the uh the uh PHP post you did a couple couple weeks ago yeah well yeah first thanks thanks for uh thanks for taking some time to chat I'm a this is New Territory for me truthfully laravel is um you know I've always kind of known that that's been going on in the background in some way uh so it's not like completely unknown

  8. but I just never really found the excuse to kind of go play around um and so I'm just super excited at to actually dig in and have lately been starting to dig in in a more serious um use cases which has been a lot of fun so uh stoked to be here uh yeah my name is Dave I am a uh the community lead over at mck um where

  9. we do all things video uh and that is kind of truly all encompassing um from a technical perspective it I I've been in video my entire life it it kind of started as like I don't know that like you know Skater Boy uh that always carried the camera around in high school from the production side I was always just like making skate videos and I was I never had the skill set to like you know

  10. be in them so I was the guy that always carried the camera around and uh always just liked the way that you could tell story through video so I started like the editing production side um and eventually made my way into programming after going to school for video production graduating with with a degree in video production but I was putting together like a web to show the videos that I had made in

  11. college off uh on the internet and this was this was days of your um and I realized putting th those websites together that I liked that kind of work better than I liked carrying around the heavy cameras and the heavy lights all day long and being on set for you know 12 or 15 hours a day so I just kind of got all consumed by video but in a different way now it was like how can I show video on the internet um and this

  12. was kind of like you know right around time YouTube came out and and Vimeo was kind of like super you know the place to put all of your online video and things have just changed so much since then of what it means to have a really great online video experience within your application and also what it means to maintain that um I've just been along for the ride for that entire time which has

  13. been ups and downs and everything uh in between but what we do over at M and I joined M three years ago is because I I was also just kind of hacking around on the API and really enjoyed the product uh and and so I thought more about what it meant to kind of be a part of the community to show people that like hey look I've tried a lot of different ways to build with video on the internet and

  14. I felt pretty confident that this that the way that M approaches it was pretty pretty great perspective so it m is basically just you know let's figure out how we can build video into your application without you needing to be the video expert uh at all really yeah okay no that's really cool I uh it's interesting that you have that kind of background in in video because I feel

  15. like that's kind of in a lot of ways my background just on the on the other side of the camera so I was more of like a uh did as many uh Act credits as I could basically like I I I I went to all the auditions I did all the uh I did all the student films that I could and my goal was I wanted to be on SNL that was like that was my uh

  16. great for SNL uh it it would have been it would have been a dream of mine but then you know it's it's too much of a who who you know game kind of thing and uh I don't know how I landed inch there there's still time I could I could maybe do it I still don't know where that fits in with tech just yet in the sense like I know that there's probably some weird Niche

  17. for you know uh like a tech um maybe like uh like Tech scripted videos or something like that but I haven't I haven't or Tech sketch comedy but uh I haven't gotten into that yet yeah U no that's pretty that's pretty crazy that you you kind of came from that that world of uh setting things up in in video shoots and uh do you still

  18. do a lot of like that a lot of that like on the side or no hobby I mean I I do still put video together I I had a um over the over the summer my son was born and I had some parental leave so my tasks were basically you know stay up late uh and and keep a tiny human alive and like find other stuff that I could only do with a baby strap to my chest so I I was um

  19. uh got involved in another hobby of mine is doing video contests so I will find like a video contest and see um if like really read the rule set and see if there's any kind of like holes I could poke in it that might give me an unfair kind of competitive Advantage because I really thoroughly read the rules so I understand what the judges are looking for yeah and so I found one of those over the summer and put a video together uh there's a great blog post actually

  20. that I wrote about it it's it's um how using AI to determine like the odds of me actually winning this blog post or winning the winning the contest oh really so just stuff like that like it's very fun like I I probably won't be publishing any sort of like meaningful video production anymore but uh in terms of like personal hobby projects it's a lot of fun yeah what's your just just so I can like nerd out a little bit like what's what's the what's a camera setup

  21. that you normally like run like what what brand camera setup honestly okay so I I have a Lumix uh what is it gh5 here but I'm not even like I'm not even the camera nerd anymore I used to be I used to be like really into the gear and now we have someone Stacy over on the mck team who's our video producer that she's like she just makes us look good like she she put all of this stuff together and I'm just like I I don't know I don't know what's what anymore yeah back in my

  22. day was like the hvx 200 was like Sony like the Sony what was it Sony V vx2000 or something like that okay yeah way back when but now I don't I don't know I don't know the I don't know what's what anymore that makes sense yeah I like I mean I never was really big in like the ACT I didn't I couldn't afford the really expensive stuff but like so I like I the first camera I ever got which is the one I'm actually using right now

  23. is a Lumix G7 and uh I still I still use it and if I was to upgrade I'd probably get like some some other Lumix maybe like the the S2X or something like that like something something something real fancy but like I just I I I like the uh the Panasonic other than the autofocus but uh yeah that's so yeah you wrote uh

  24. you wrote uh PHP is the new JavaScript uh yes yes two months ago two months ago it's already been two months it's pretty crazy I know it is wild so this is yeah this was kind of just like uh Meandering uh through the field of what PHP looks like as someone who hasn't been there in a while like I I I started in I started my whole career

  25. well I guess like my programming side of career in PHP um just writing as this blog post kind of goes through procedural PHP like write a do PHP file and run it on your local I don't even know what computer I had then but it wasn't it wasn't a Mac it was just whatever and it would just run through the file and output like I could Echo stuff out and whatever and it was like there there were no serious apps that

  26. were going to come out of that sort of approach at least uh maybe during that time it was considered serious but like as we see what we expectations are for you know applications in production today that wouldn't that would never work so I kind of uh kind of left that behind um you know dabbled in some WordPress over the years as well but yeah you know it was never anything for me that stuck and I think it was like

  27. this blog post kind of goes through it like the react uh model for me that really clicked uh for the kind of apps that I was working on at the time it was like 2016 or something and so yeah I just kind of like dove in there like just just kind of planted my flag as let's learn react in and out and kind of buy into that ecosystem and there wasn't like a huge reason to hit frustration uh

  28. or there wasn't like any point that I hit enough frustration or friction in working with react at the time that I had to go look elsewhere so it was just like I kind like blissfully unaware or ignorant I guess of what's going on in PHP land um and it wasn't until this this post came out right when the announcement for is it like a series a or something like like larel end up anouncing series this is

  29. like okay so that that kind of like went everywhere that news went everywhere and kind of blow blew into the JavaScript ecosystem in a way it's just like you know prominent Tech news that's happening and I'm just like at that time I don't know if I had hit a frustration or if I was just looking to write something but I was like what is going on like in PHP what I recall PHP like

  30. over the two decades or whatever that I had been working in it yeah and suddenly we're getting this huge investment in like there's got to be something that I just wasn't aware of and so it was like right at that moment I was like you know what I'm gonna I'm gonna go through this I'm gonna go it's not gonna be a massive app but like let's go through from scratch uh build a laravel app for somebody that knows nothing about laravel yeah that's kind of what this

  31. post ended up kind of detailing yeah I loved it because like one of the things I actually uh made a video kind of reading through it and uh and sharing some thoughts but one of the things that I it always interests me here seeing like People's First thoughts that's kind of like where my passion kind of comes into of like People's First interactions with Lille and and one of the reasons why um you know I think I I love being

  32. on the larabel team itself is because then I have like this I don't know almost uh goal or insight to be able to say Okay I I I I I don't want to forget like what it looks like to come into larl from like the ground up kind of thing of like what what's the first thing you get get into and um because that's one of the things that I experienced and also loved about larl

  33. was like that those first couple of code that first couple of uh those apps that I wrote kind of thing and uh and what it felt like for that so it was it was interesting to read your read your thoughts of like okay what was the first thing you you turned to and you know using AI was one of those that I think you you kind of mentioned here is like okay it was cool to like have have everything still work cuzz it was

  34. there's there's usually like one path forward for that um so that was always interesting to me yeah and I find myself I don't know maybe I'm just getting old and like tired and lazy or something but I find myself more and more using uh AI specifically cursors which just seem to stick for me at least right now but yeah um because like yeah just just kind of like guide it in the way that I I know

  35. what I want to to do and I know my fingers can typee it all out but I've just gotten to the point honestly where I'll like dictate I'll use there's this other um raycast add on called super whisper that I've been using a lot where like hit cord again I maybe I the baby strap to my chest I'm like bouncing like this and I'm just going you know dictating like hey you know I need to I need to scaffold out a whole of VI and a model for this and like let's go you know describe the whole thing and it'll kind of like it'll just it'll just run

  36. its course and and so like I think we're a lot of people confused or like where I see mixup with the AI ecosystem is that people get frustrated like yeah this is like this is slop like this is putting on code that's no good but what I've found at least with dictation is that it it requires me it forces me to kind of like offer a complete thought like I have to speak it out and so it knows the whole scope and I kind of like scope down you know everything that that it's too work on and my results been really

  37. good like I don't know if I'm just if it's just unique or something but but it's been super help ful for like actually moving things forward um you know and it helps to like have I think the the uh framework that you've worked within like kind of committed to memory too so just kind of like talk it out it's been yeah to me that's been a really great approach that's cool yeah I think that's that's been similar to to my Approach in in building a lot of

  38. things out is like I I know exactly what I want it to do it's just more of like okay I'm going to tell you all the things I needed to do so it's nice to have like kind of like you mentioned it's it's nice to know like the the phrases and the words and like um you know even the even the approach you want to take and it's kind of like letting it be the the uh the little

  39. pieces in between to to fill in the gaps of of okay how do we get from A to B kind of thing yeah yeah I mean I I I still think that you know and there's only it's only going to go imp it's only gonna improve from here too so that's yeah just been really interesting and I'm kind of like forcing myself to make that a part of my workflow and I'll be honest like there are still times where I will you know ask it to kind of do something or build

  40. something out like like in this blog post you know was rewrite this blade view which like I I don't even know if I'm saying that right right now but there's like there was nothing I knew about that at all and I was just like build this out to do this thing and it will it will offer a solution that kind of will go through things I didn't even consider and like and even now like outside of the lelt going going through a suggestion and seeing it what it's

  41. offering like oh yeah I would have had to do that and maybe I would have gotten there eventually but like that's been really interesting uh to kind of see yeah sweet um why don't we like uh dive well how about how about this what what what do you think would be if I if I pulled up I probably if I pulled up the code that I used to use M like two years ago maybe we like take a look through that and I can just like we we can like

  42. I don't think it actually I don't think I could get it um like the app actually working or whatever but maybe we'll like pull through the code and then we can create a new app from scratch and go that way yeah yeah I'm pumped to see what you were uhing before yeah let's uh let's see pull open my terminal real quick

  43. okay so I'm going to try to uh not hide as much stuff as possible so I think it was um I don't know if I do I have it actually okay so I do and this is probably up to date so let's pull this open so this was like an app I had built way back

  44. win um yeah so it looks like this is a this is the upto-date version of this um let's see if I can see if see where the actual piece Happened app actions trying to think of video upload control this is probably this is probably one of

  45. it let's see it's does show a bunch of red cuz I don't have anything downloaded but okay process video Let's jump into that yeah there we go so we have a MX token id M secret give that a bump up in font size I got old man eyes over here I'm good how's that there we go so

  46. basically what I did in this application was you you kind of had this uh uh you kind of had this um almost like a like a a screen recorder app and so you could you could record your screen you could record a video um I basically took it from uh uh someone else who was much smarter than my I am and they had like open source a bunch of this stuff so I was

  47. like okay you could use Chrome's Media Browser to basically record your own video audio screen and it was like this neatly thing but when I finished it because I was using laravel Vapor which is the the S3 or basically like AWS serverless version hosting of lville um I needed to publish that to S3 or

  48. upload it directly to S3 I probably could have uploaded it directly to MX somehow I think like it was it was a it was in a weird format but I probably could have uploaded to M but what I ended up doing was like I uploaded it to S3 and then as soon as it was uploaded to S3 I kicked off this conversion process to upload it to M and then replace it on the

  49. site um so I think yeah I got the video URL and then it created this new asset request in mck with the video URL and then after creating the new asset looks like I just got back a

  50. ID and then I had this playback ID of an m3u8 file for those who like me don't know what this means can you tell me what an m3u8 file means yes well yeah first of all going through your code like this might still work I don't know you might be able to run this and have it have it work you you can you can skip I mean you some folks will

  51. upload to it a different file store and then import it into Mar Okay the reason you might do that is is to kind of like maintain your own Integrity of all the files that you have access to however we we MX does store you know your master file that you upload so it's not necessary that you hold on to all of the different uh S3 uh stored files you you can go kind

  52. of skip this step and go directly into mck okay but you know this this is valid I would say you know maybe there's like a B plus uh or B happening there um there you go but yeah so so what you're doing here you you're you're saying hey M I have this video that exists and I think I saw that was like a webm format maybe yeah I can't remember yeah it was a yeah it looks like it was a webm URL

  53. because I think see if I can find where I was doing this probably you're probably right on [Music] um um you're probably right on how I was kind of uh um what's it called how I was I don't know actually where I where I had all

  54. that you're probably right on how I was keeping it in S3 is mostly because I probably didn't want to modify the I had this uh upload directly to S3 there's this this this widget basically within uh laravel Vapor that it'll do all the hard work for me I probably didn't want to figure out the way to way to modify that and I think that's fine like you kind of have duplicates

  55. happening there but uh y one some of the reasons you might just go directly to to m is to cut out the middle you know the middle layer that doesn't really need to exist kind of acting like a proxy right now when you could just go directly um okay which just kind of simplifies things but it also would um depends how much you care about your time to publish um yeah if you go if you skip that that middle layer and go directly into mxs from the

  56. client there you know there are different ways that you can you can handle this but it's possible from media recorder to also stream um up into a direct upload so there's there's possible or a possibility that your assets would be available much quicker if you kind of cut out the the middle ground so it depends if that matters to you you know how quickly the uh the final playback uh rendition is ready to

  57. go okay that makes sense um but anyhow like this this is valid this looks good um and you mentioned about the M38 so this is kind of where like video video in general is kind of like deceivingly tricky when when we when you take a video on your iPhone like you expect that you can just like after you're done you just like click the button and it plays the video back there's no problem

  58. it's just video video is just like a photo like you just watch it like what do you mean so hard about that um and what it gets tricky really is is um delivery over the Internet okay and the the reason why it gets so hard is because video uh video's pretty big file size um there's a lot of data that's included in video so we have to figure out ways to kind of compress that data

  59. effectively um and deliver it effectively without degrading the quality like nobody wants to watch these potato videos that we're used to seeing you know 15 years ago so it's got be good quality um it needs to be consistent so that you're not experiencing all of these different like buffering and loading errors and uh waiting for things to kind of come through and so that's where it really starts to get tricky like when you play back a video that's locally stored on your

  60. laptop or your iPhone there's no issues with any of that but then when it comes to actually delivery over the Internet well I mean get it gets a lot more complicated um and so what a m3u8 does is kind of it transcode or change the way that video is delivered from being like on your local device it would be just playback the file uh and and kind of deliver the btes from the file load up the file and deliver it but

  61. the m3u8 is instead it's a manifest it's an and it what it will do is kind of like chunk your video into it delivers a manifest that shows the chunks that are available for your video so kind of like break up your video into I think about like little micro videos that are main that are all kind of contained within that main video and the reason this helps is that it'll allow your player to kind of

  62. progressively download and play back the Renditions of the video um as the player kind of has goes through the the connection and the bandwidth that's available it also will allow you to kind of switch between different Renditions so instead of having just like that one file uh the webam or the MP4 when you upload it to a service like MX it will create multiple Renditions uh high quality Renditions or lower quality

  63. Renditions and then on the client side when you go to try to play back that video it depending on your you know Network conditions has the your player is smart enough to have the ability to kind of switch between the different Renditions that are available uh so that you can have a really good quality of experience when you're watching the video even if you're like I don't know you're in the car and you drive through a tunnel like what happens then you know do we service well it's potential for you to kind of switch to a lower quality

  64. rendition that will still allow you to kind of you know play back continue to play back the video so there's a lot of complexity that's kind of encapsulated within that u n38 f okay that makes sense yeah I think that was that was basically what I was what I was uh uh loved with using mug like for this

  65. particular for this particular app was like okay I already had I already need the process to uh to like you know have the client upload this but by the time anyone was watching this video I didn't need it like right then and there and so it was like it was nice to be able to say okay now in the in the background CU I I actually was running looks like I was running this as a as a background

  66. job in the background I just can grab that uh or push this into mck and then have it be available or basically like say okay once that is available replace the old video URL so now all these new feeds basically had this this new uh playback MX URL uh so yeah so M can be able

  67. [Music] to kind of host all the video H but then also like stream and play it back too so it's kind of like this twofold yeah you know and this is where it's it's um to me particularly interesting like the the idea of encoding video to um be playable you know with hls in the

  68. browser it's not a new idea uh it's been around for a while and it it's a tricky process but like developers are smart like you can figure that out you know yeah but the part where it starts to actually get tricky like that that is a little tricky to do that but yeah the part where it starts to really get a little overwhelming is everything that follows like the playback experience the integration into applications the um

  69. time to publish like that's that's a really important one for different use cases like for this one maybe it didn't matter as much but like imagine you want to um you know upload a video to Twitter or X and uh it took like a really long time to actually transcode and process that well like that's a frustrating end user experience right like when you are offering a product that other people are also going to be using and that you are

  70. now like committing to um the experience that worked for you but might not actually work for them like might be frustrating for an end user to have to wait for their video to be available and share it like you're now kind of buying into their their time right like their day okay and analytics like that's another part of like understanding how people are watching your videos and what kind of experience are they having have they

  71. run into any sort of issues with a particular asset like there's a whole observ ability layer that that gets really complicated uh thumbnails uh the little preview when you put your mouse over the timeline of a video that you see on on YouTube like there's all these kind of like little mini additions little features that happen when we utilize a a online playback like a session like on YouTube that you don't

  72. really think about that goes into making that experience really like really nice like really full ledge and kind of really encompassing the whole part of it so that's what MX tries to abstract away is okay don't worry about building all of this stuff um building your own transcoding building your own playback engines and and observability will we have the video experts uh on staff we'll

  73. abstract all of that away to easy to use sdks apis and and drop in components that you could just build into your application and then go back to working on the thing that makes your app or your business like actually unique you know maybe it's not the video experience itself maybe it's I don't know something something else that your your business does and you don't want to be the video expert that's a big that's a big value

  74. add okay sweet that's awesome I love that um Webster Crowley on Twitch I'm dealing with video and a new LMS I'm building in Lille and filament right now so this is the perfect timing sweet my client is using EDG for a video maybe I should look into Ms maybe you should maybe you should maybe you should um sweet so about the LMS too if

  75. you drop drop some more information in the in the chat about that one yeah yeah do that do that that'd be that'd be that'd be interesting um especially just knowing like how how much video to would be would be interesting to know like if it's if it's largely video or or if video is just a small part of the LMS too um yeah thanks for thanks for chatting Webster um sweet why don't we why don't

  76. we build something one thing I'm I'm curious about is the actually like getting videos into Muk so like I know that you probably can do it I if if I'm recalling correctly there's ways to do it of course like with the with the API or like with a SDK or something like that but is there also ways to do it like if you're like hey I I don't necessarily have a bunch of videos that change and I'm just going to like just

  77. drag and drop a bunch of videos into into your into the service yeah yeah exactly there uh there's different you call that layers of what your integration might look like right there's um the very Basics is you log in you create your account there's a dashboard available and you can upload your asset right within the dashboard and we do is kind of you know Implement mugs under the

  78. hood to accept that upload and send it over to to M and then give you the the playback information from there so you can uh integrate it using just the dashboard but really the way the dashboard is set up right now is to try to educate you into what is happening under the hood um so that you have a good understanding of like all right well this this is yes we uploaded your video but this is ideally how you would upload that video within your

  79. application um so it's less of a you know UI intended UI experience and more of an approach to education for working with the apis okay that makes sense that makes sense um and then just for like my question I know this might be a a tough question or maybe it's not a tough question but like what's the difference then if like so let's say I

  80. was um let's say uh you know I automatically CU like me me personally so I have a bunch of videos that I I push to YouTube anyways is there a benefit then of basically saying okay any video I push to YouTube quality-wise I I know there probably is um but what would be like the benefit of me saying okay hey let me

  81. also like take those or maybe like there's a web hook on YouTube that also like then pushes it into uh mck like what's the benefit of playing them from Ms on my site versus like YouTube or something yeah I'll just even reduce that further like why would I use Ms yeah when you fre and out there and ubiquitous right like um the truth is there two different use cases like we

  82. use YouTube at MOX um we use it for discoverability we use it for advertising we use it for uh our social presence tutorials we want people to find us and so and and YouTube is what like the second biggest search engine for now anyway in the world something like you you if you are using video on the internet it it is uh if you want people to find your stuff it would be silly to not use YouTube right yeah

  83. there there's uh that is a fact like that that's the truth the other part of that is that not every video is meant to be uh advertised on by random advertisers not every video is meant to make uh to have suggested videos or recommended vi videos of other creators appear at the bottom of that video yeah which can distract like YouTube's whole objective is to get you to watch more

  84. YouTube get that end viewer to watch more YouTube and uh so yes it's great for discoverability but it's not great for like brand retention it's not great for Focus um learning like at times it can be but like if you want to um have educational videos on your website and you are using a a YouTube ined uh you're opening yourself up for for the viewer

  85. to to become distracted yeah um it's also possible that your video isn't actually meant to be seen by the public like you want it maybe it's behind a pay wall maybe you want to uh have members only watch that video uh so that is not a great use case for YouTube type experience so what what we do at MX is offer kind of like the next level of that like okay like yes have YouTube um presence right like be there show up in

  86. those search results and then when you capture that viewer when they are interested in learning more and going to the next level with your content your brand and you want them in your ecosystem like you should probably have a a cleaner video experience you should probably have you know no ads or only the ads that you approve to show on on your videos yeah and uh have a customized brandable experience like you can you know customize the player to to have your company logo in there or match

  87. your colors instead of the YouTube logo so it's all about kind of like to me it's like protecting your focus and understanding where the viewer is in their Journey with your brand if they're at the super top of the funnel uh yes like capture them on YouTube um if they're getting closer to becoming you know a core member of your brand and your site then you might want to consider you know kind of scoping down

  88. what that video experience looks like no I like that yeah it's something I've uh you know personally thought about I know that um I think I could be wrong in in saying this but I know um um Aaron francis's latest course I think they just switched over to MX I could be wrong um or maybe they were already using M and they just switch over to mck's play or something like

  89. that I saw I saw a picture that they switched so they switched the player branding or something like that yeah there's I I think what Aaron uses is the media Chrome which is an open source uh player that you can use to playback video from wherever so kind of like I kind of think of it like a player tool kit in a way where if you want to build your own player and not look like every video player that's out there or just want like you know

  90. some custom customizability customization uh out of the player and you can use a toolkit like media Chrome um Aaron I I believe that they're on cloud flare R2 which is you know also like I think this is like having a moment right now um a valid approach to delivering your video but the way that I think about it is like it's kind of like um driving a

  91. manual vehicle versus a stick like a a stick shift versus automatic where like if you if you take on the responsibility of building out your all of your video infrastructure it's not that I don't think you can do it or like one can do it it I think it's possible yeah but now you are you are the one that's in charge of that like you have to understand how that that all works and if your manual transmission breaks down like there's less and less people out there that can help you you know what I mean so like yeah there's a reason why people started

  92. switching to you know automatic maybe this is the Perfect Analogy but like an automatic car you just don't think about it like it just kind of runs and if it's got an issue you know you take it into service and people have worked on these cars for forever and uh that service I guess being my I don't know the analogies of but it's in there that like you could roll your own solution but now like prepare for that to become a core responsibility for you

  93. for the maintenance in the EP kind of how I think about it yeah no that makes sense makes perfect sense yeah um yeah because I I've been thinking through of uh What uh I'm I'm thinking through of like what a kind of more private course looks like on on my end of of of me kind of building that out um and I think one of the things that you're talking about is like okay like I'm not going to host that on

  94. YouTube if it's going to be paid it's going to be something like that um but then also like if so it's behind a pay wall but then also like I I I would want it to be you know accessible to people who are like watching okay I'm on my TV watching in 4k but I also need to be able to be on the phone for people who are just you know scrolling uh or wanting to like watch the course from there while they have time and their work work there

  95. something like that so like I I the the playback piece is always probably more interesting to me than even like the the the storage piece in a lot of ways too yeah um Webster Crowley said about the LMS I'm rebuilding an old learning platform that's on a 15 plus year old custom PHP LMS pick laral for the new platform it's for medical education1 90

  96. video chapters using DRM for IP protection but that is a huge problem for the client IP theft also has quizzes exams Etc we plan to add more Community features to help combat piracy oh my goodness you got yourself involved in a project that's I was just going to say that is a that is a monster right there I uh I wouldn't I wouldn't know where to start uh yeah that that one I'd probably

  97. break down into small um even from like a like where where to begin type of conversation but one thing that you mentioned just now was uh a core like what kind of course are you talking about that you were working on oh yeah I I I have I've I've had these plans for a while but like um I am I'm wanting to do a uh kind of like the first paid course

  98. that I've ever that I've ever put out nice um and it would be it'd be private it be uh you know uh paid of course and so it's one of those things I'm not going to I'm not going to publish at least all of it on YouTube kind of thing um and so yeah I think the the playback piece is a lot more interesting to me in a lot of ways than even the hosting in in some ways yeah one thing that we actually just announced this week um

  99. actually go to go to the m m.com blog uh is for specifically for people maybe like you I didn't ask what kind of kind of content this is but it's that top post right there yesterday I post that yesterday man time time goes slow at the same time uh get credits so so we have a this new Initiative for folks that are doing developer education um okay where if uh

  100. basically you know what we want to do is enable folks like you if I'm assuming it's developer education that you're talking about yep y to build out these types of Integrations and not worry so much about the video delivery and Playback costs um and this kind of what I was just talking about too like you could have a a YouTube player but it might end up looking like something like that yeah so anyway this program the intention of it is hey let's do

  101. tradesies like we'll put you put a mck badge somewhere on your page uh near the player maybe on your footer something like that anywhere that there's a playback um happening with mck under the hood and in return we will cover your bill um and that is good for basically all technical education whether that's um videos that appear on Doc's websites or if it's a video course um that's teaching developers how something works

  102. or maybe a technical blog uh we want to be there we want to not only support the process of of your video integration and kind of alleviate the the bills or you know the especially for like smaller creators like you don't really want to get you know too caught up in in worrying about a video bill so we want to be there to support that but we also want you are sharing your knowledge with the exact people that we also want to

  103. make sure they're aware of M like hey uh this Creator is using MX as a solution check it out um so in return it's basically like hey put a badge on your site you go through this application process put a badge on your on your site if you're approved and we will cover your bill uh I think it's up to, doll a month uh which is a lot a lot ofx usage so that seems like a lot yeah yeah I I I can't remember how much usage I was

  104. getting when the when the when the app I built it on was uh was a lot but it was not close to that so I I can't imagine what $1,000 a month yeah I would be very impressed if uh your course blew up that your bill and that be but like that that would be great news yeah be good news for me that's for sure and and and for everyone I guess in that that sense I would uh I'd be I'd be making the big bucks if that was if that was the case

  105. that's right don't forget where you started you know don't guys this is really cool yeah I just uh I just say that um yeah if anyone else is uh in the chat and want to check this out m.com blog uh powered by mck that's really cool I like that I like that initiative too because I think there's a lot of uh a lot of times when when it's one of those things we're like especially in

  106. the in the content creation world where those those first couple steps you don't really know where to turn so either doing it all custom and you might be work working too hard in a lot of ways if you're doing it if you're doing all custom or you ended up you end up maybe you know in in a lot of ways kind of footing the bill and all of a sudden maybe it doesn't do as well as you hoped it would

  107. and then you kind of between a rock and a hard place yeah it's a tough it's it's a tough spot to be as a as a Creator or even just like as a startup you know that like doesn't really know if video isn't like your core offering you don't really know what the value at is yet like maybe you're trying to figure out how to align it with your business model whatever um it's a tough spot to be in but we're always trying to think of different ways to kind of be compatible with that scenario so that you know you don't end up again this

  108. kind of goes back to like rolling your own infrastructure like you don't end up being the person responsible or finding yourself in a hairy situation because you thought you know I'll roll it my own and and save some costs and now suddenly like you've created A Rat's Nest and it's be tough to get out of that so yeah yeah that's crazy uh Webster K my client pays 50k a year on video hosting so that's a good deal for Dev content that that's that's a lot of money for video

  109. hosting uh but it makes sense makes sense I mean that's the other part is like video is just inherently expensive like it y the way that uh the amount of data that gets transferred um especially as like a live stream like fan out type of live stream there's so much information that's that's crossing the interwebs that really at its scale you know it starts to get expensive and it really only makes sense um true scale

  110. for like these big players that have different like a like a type of YouTube that have different um you know ways to kind of monetize it so if you can figure out how the video Val there is a value ad for sure like retention is is proven that like your retention across the product is is better with video added to um so if you have those ways that you can kind of align your objectives with having video at scale in your

  111. application and that's super helpful to yeah kind of like offset that cost yeah yeah I think I still use uh Muk actually for uh this this is one of my SAS apps I I think I think this this video itself is still host on M because I I one of the things I was really cool about um that that I love about monks is like yeah it's it's it's great for a bunch of those videos but it's also great for

  112. like those the ones that get a ton of views on the homepage that you don't that you don't want to consistently use all that data that you're pushing forth or like you you're you know I would not want to host this video on my website and consistently streaming cuz then you have to kind of like what your we're talking about before like the the m3u8 is like okay yeah you're hosting

  113. that but now you have to worry about cashing it now you have to worry about delivering it in the right formats and to the right people and all that kind of thing yeah I mean I mention this too but like and it just becomes a priority when it probably shouldn't be a priority like it seems like for this app right there what was that your priority is automated Security reviews it's not like video pipelines you know what I mean and figuring it on your own like again we're

  114. all smart people like I don't think that it's impossible but I do think it's like it's kind of like saying yes to something like when you're making plans and then you realize the plans are coming up and you're like man why did I say yes to that like I'm overcommitted um and I wish I could be what whatever working on something else um it's just it's a kind of a precarious situation so yep there it is M player there we

  115. go at least at least M player I'm pretty sure I'm pretty sure I just grabbed the ID yeah playback ID yeah yeah looks right um sweet why don't we uh why don't we get a new lville app up and running and then I want to see maybe like we can build uh an uploader maybe like pushing it pushing it to mucks and then like

  116. play back almost like a a very barebones like a version of a private course like that'd be interesting yeah let's see Sweet let's start from uh start from scratch so I have this kind of like starter kit that I I use

  117. um so we'll do we'll call this uh call this Muk stream there we go what her name m stream install everything this is the first time I've gotten to use my uh my starter kit on a on a stream before what is this what's

  118. all included in this this is I'll uh we'll run run through run through I'll I'll uh I'll uh advertise a little bit this is a a starter kit I I basically was doing so many demos on so many like videos or just stuff like that where it was like hey I needed something that was like in the format I wanted so that I could just run something and have authentication and all the things I

  119. normally would have with the larl app but also designed the way I wanted so there's this new um laravel Live Wire which is my personal flavor of Lille that I like um called uh flux which is basically like a UI paid UI dev kit for Live Wire um looks super nice it's basically like

  120. um performance and like uh also like welld designed a lot of ways um and so I basically put together this starter kit to have all of like my opinions all in one file and when I uh when I started I I created this like install script that basically like installs everything so I

  121. only have to run two commands cloning it and then a Bash install script to do all of the installation and then I can just run composer run Dev and get everything kind of up and running so that way I have um everything ready to go so now I have

  122. like authentication ready and the actual code is exactly how I well we'll do an En cursor since you were using you were using cursor before we'll do it in cursor as well yeah cursor stand the only thing I I dislike about cursor right now is all my uh custom stuff broke so it still looks okay but

  123. like it's not it's not the same as uh as my vs code setup yeah that's fair I I get I mean I'm not the gear guy anymore I'm probably not the ID guy anymore either uh just very basic show up get the work done go home the the thing I love about cursor is whenever I'm in in like chat or composer mode I can do docks that is my favorite

  124. part about cursor so being able to like add a new dock for mck is perfect I'm going to do that right now actually that way I know Ducks docks to see how this goes I haven't tried uh I haven't tried the MX docks with en cursor yet name MX is

  125. already taken interesting did I already have mck interesting I might have used it for before awesome so let's first maybe get started with uh like any kind of sdks yeah uh definitely a good place to start

  126. for for the API interactions um so we do have a PHP uh SDK available um I think if you just search like uh MX PHP SDK um that should take you to the GitHub repository sweet now this is I mentioned this at the beginning of the stream but like I don't I haven't written a ton of PHP in a while yeah um but I I've played with

  127. this a little bit over the past couple days and seems um pretty intuitive here I what I'm trying to say is like things like composer aren't native language for me uh but I believe that's like similar to like an mpm uh situation mpm install uh just like a package manager in general so the package name for this is MX Inc yeah the top we should be able to do composer require then there too so if I do

  128. this should just automatically pull it in excuse me okay and then looks like we're good to go we read them from M token ID and MX token secret

  129. okay yeah so like high high level I'm also curious if uh anyone since Lille M package I'm curious if anyone is uh here's this one I don't know what this is M's rapper interesting what were you saying uh what was I saying oh just like high level about the approach for what we're thinking of here what the way that I

  130. generally think about I don't know maybe this is like kind of like Snowball Effect when you're paying down a loan or something like I I want to see a win as quickly as possible and like not get too caught up in the complexities of API integration and stuff so one of one of the maybe a good place to start um would be to just kind of get playback working okay and just like understand what it looks like to have a route where we can successfully like load up the video and

  131. play back the video um sweet so I would say let's let's do that in our in our index pages and this is where also I my little asterisk is like Josh is Del larable guy I I I'm still learning the ropes here um so I'm gonna I'm gonna hopefully learn along here a little bit okay this is jumping in a little bit too

  132. far so like when when you're doing it you doing yeah index. blade. PHP for example the my starter kit and my kind of like personal flavor of Lille that I like at least right now is something called called folio and volt which is basically just saying it's a single file component so I can write PHP logic up here and it's okay and all of this is basically just like the view file but

  133. then also if we were to go into our routes so a quick little tangent for everyone watching this is there's it's empty because it's basically just in this views Pages folder so it's it's page based right outing in a lot of ways where now uh if I was to you know create a new file then called this you know

  134. about. blade. PHP and I'm just going to copy this here um but now if I was to say we are on the about page now if I was to go back and we have to sign up for an account first

  135. but I to go to slash about oops slab now we have this about page ready to go for us so all I have to say th this is this is jumping into the deep end but this is a little bit different from like that first thing that you you're playing around with in some ways and also the in the same so this just kind of gives us um file based routing

  136. or page based routing I should say um and then also the ability to write PHP logic up here if we need to let's say you know do our upload component we would just do this all in one without having to do a new controller got it it just be one file is more aligned with the you know the next model in a way y yeah so this is this does make a little bit more feels more intuitive from what

  137. I'm used to yeah it's one of those things that like I even though I know JavaScript better there are there are ways of course to write JavaScript like react and view or felt for example within larl and that's kind of like your your view layer um but this makes more sense for me personally because I have I have uh my you know templating and then I have my logic and

  138. I don't have to leave this file kind of thing yep that makes sense these these names by the way there's like there's so many of these different like Vault and folio and like that's I I need like the cheat sheet does this exist I need the cheat sheet for like maybe it's the mega menu on the Lille I need like the whole like awesome LEL repo or whatever that just is like here's what you is this what you're looking forie here's you know

  139. what I mean because I like I don't when you told me like you were tell me what is this invoy enyer like yeah was that yeah then you're like oh pennant yeah and uh Scout and uh know sale yeah there there is there is a bunch of stuff I know that's something that like we're we're hoping to simplify because it's one of those things where like there there's so many things that if if I was to say if I was to say oh

  140. yeah like I need to use algolia for text search well now instead of having like larel algolia you have larel Scout which is technically the text search which includes a so like there there's a bunch of little things that like sometimes you don't even know that larl has that until you actually need it yeah but it's part of this little packages thing yeah same thing with like feature Flags is called pennant you know yeah

  141. yeah yeah there's a lot to keep track but I I get you the other the other side of that is like oh oh my God I'm glad it exists like once you understand that oh this is what this thing does yes it's exactly what I was looking to do and yes in a prev framework I might have had to have a third party integration to achieve it when you realize you can kind of circumvent all of that like I'll forgive I'll forgive the ambiguous yeah where where it's pretty

  142. crazy how like everything that I've done just for that starter kit other than um you know this component Livewire kit which is which is paid is a first party kind of integration so like it all all of like authentication everything like that like that that was one of the biggest reasons what got me into into larel it's so it's so nice like and I truly mean this is somebody this is something coming from

  143. somebody like relatively new again to the laral ecosystem is that when I one of these example apps that I'll share in the next couple weeks um that I'm working on has some complex requirements and just knowing how I would have approached that and tackled that in uh another framework versus how I'm approaching it in lville um I'm learning a lot along the way about like the packages names and how to use them and whatnot but the fact that

  144. again they're like first party sported is like so huge and such such a like weight off of uh my brain and my shoulders oh yeah yep that's that's me literally every day I'm like okay I I know exactly how I would do that because there's there's a package for it probably that's why I was curious of like the the whole mck slay I was like someone's probably done a little rapper probably not even necessary um

  145. that one but uh so yeah the playback piece should we use like a like mpm install because I know I noticed within the uh the mck player like there's the ability to like have this uh HTML element that's this MX

  146. Player is that the the best way to go for it yeah I mean again again just kind of like not knowing the approach in the front end in l land but that's what my intuition would say is like go with that route um you can also do the hosted version if that's like just an easier drop in but yeah I'm interested to see what happens here just with the way laral works with um JavaScript packages

  147. but PHP back end whatnot yeah so um within this specific star and and I think every Lille starter kit now um recently like in the last couple of releases um it has vit installed for every starter kit so we should be good

  148. to go there we just now use this this m player now we don't even have to use this host we just we should just be able to grab this that's right yeah um so I don't do you need import probably have to import that somewhere maybe it's automatically required in somewhere somewhere might be I'm curious of

  149. like okay let's try it and we'll see if uh we'll see if it's if it works playground no okay I probably do have to my guess is like whatever your root you know app.js or what whatever that would be named in laral land um just do an import of the mxm player package and

  150. then once that's included in your bundle uh we should be in good shape MX Player element be good to go there there we go sweet cool I mean easy enough right like

  151. nice you want to there's hey there Ed H miss you buddy um I love that he's the example that you copy examp at his uh uh one of my first oh that's awesome um but yeah so like okay embedding a video YouTube you would copy an embed

  152. code and paste it like okay Vimeo same thing so it's not super impressive but like what we're doing here is like really under the hood is is pretty uh that's happening that's not your concerned which is great that's what we want here um because we just grab this playback ID that's really the only thing that we're telling M player to to focus on yeah yeah there's that there's also like you

  153. see these little metadata tags as well there on that player so these are like custom these These are associated with uh the M data product so when this page loads up and this video loads up that data will be associated with this individual viewing session right so like when okay what you might actually do with that metadata is provide the logged

  154. in user ID or provide the video title uh maybe you pull that eventually from a database and it's not in right I could I could go in like you know like off user ID and just pass that in okay cool yeah so that that looks right to me uh somebody with minimal experience but

  155. what would happen here then on that view is this view will be logged in M data and you will be able to um basically see in granular detail what happened with this this playback session um okay that could be anything from like did this viewer make it all the way through the video uh did they pause anywhere did they uh did they run into any playback issues like is there anything in my

  156. application that I should be concerned about with uh with how playback is working and if so U maybe you like I don't know maybe you received their support ticket from this particular user like you could go through your M data and look up you know this view session based off of the ID so there's a lot that you can do to kind of capture information about how people are interacting with your videos just with these metadata properties on the on the player that's interesting so like I

  157. wouldn't have to build out if I was to building a course for example I wouldn't really have to build out a you know I mean I probably would have to build out something like U you know H if they've completed a video but I could maybe hook into this data uh yes see if they completed it and I know that moving forward our MD's kind of built more of like originally when it

  158. was introduced as um kind of like quality of experience like helpful for uh let's you know like I'm thinking like a big company like a Paramount um that has their own video infrastructure has their own video team but needs insights into is it working like is it doing well are we having trouble with it uh and so it's more about like the actual quality of experience um and less

  159. uh of the engagement approach and I think engagement at least to me like as somebody that's not a Paramount um is is more interesting like it's more insightful for me to be able to make some um decisions based off of how people are interacting with my video okay and the good news is for for mck and M data moving forward is um there are a lot of plans to make that as simple as possible um yeah as part of

  160. like native core features of of of Ms you can calculate some of that stuff like you can you could hook up a stream export to M data and then do some calculations on it um I think I wrote a blog post on that and after I wrote that blog post I was I took a long nap because it's a hefty one uh so it's possible but it's also uh something that I think we're looking to to make a little um make the developer experience a little more

  161. enjoyable okay that makes sense so theoretically I could grab this um video ID that I was using on on this page and then be able to playback ID and then just be able to like pop it into this code here with video title of what would you use the the video title

  162. for if would you change this out with the with the user as well or that that more of like this would be own purpose this is like the title of the content so like for this particular episode what are you featur what do you focus on or where does it uh you could also ask add custom metadata properties like uh truly like I don't know that that doesn't help for me to just say whatever you want but like you could add

  163. if if the member is on a specific plan uh track that kind of stuff here as well um but the title itself it would just be like the the title of the video yeah okay and then this would just be like a you could name this whatever you want I want to say it's custom custom one or something yeah there there might be an actual name that you have to follow there but then you just provide

  164. your but anyway this should load up yeah your yeah okayed and then technically trying to see if uh I lo I logged into uh what I think this is hosted on because I'm curious if I I I

  165. can see the metrics I can like pull over onto the screen see if you can check down might be the wrong one so I mean the other other thing to call out while you're while you're looking for that is um

  166. maybe it's okay for you like your homepage you know the playback ID so maybe it's okay to hard code it right there in the file and you know that that's the video that's always going to play um but maybe not like maybe maybe what you're looking to do is load up a variable playback page um like a YouTube you know how YouTube When you visit it has those video IDs in in the uh in the uh address bar um so you'd be able to basically hit

  167. your larel database and kind of get the information required about that video uh okay okay to be able to kind of propagate that mplayer uh on or dynamically rather than just hardcoded in there okay that makes sense yeah looks like my my internet's uh slowing down a

  168. little bit you're getting a little choppy um okay so for the [Music] uh for the uh for the player itself then you could cuz what I was doing looks like what I was doing in my in that previous app was grabbing the playback

  169. [Music] ID or storing that playback ID in the in my database is that like the best way to do it then or like what what would be the way of like okay I I I upload something do I just get that playback ID back and store in the database and go from there or like what's the best what's the proper way to do it I guess the mck proper way to do

  170. it yeah exactly when you upload a video uh you're going to get some information about that video in in order to to load it back up on on your side um and that includes the playback ID so that's a a main component component that you're going to want to store in your database is um associated with that particular you know maybe your particular user or that particular video uh to be able to load up that that video and then play it

  171. back you could also just for like Simplicity you could just like you know P if you know the playback ID throw it into the URL um and then attempt to load that video that of the playback ID that's given in the URL and if it doesn't work you know 404 or whatever um kind of like gracefully handle that but in a in a production application you

  172. would upload the video Once you receive a web hook um kind of like an async event that happen that happens to hit your server in the background you would take the information included in that web hook and then update your database entry for that particular video that says hey this video is ready and here's the uh here's the playback ID associated with it okay that makes sense

  173. how am I doing on internet land is it me or is it you um okay I'm trying to think I'm trying to think it looks like it might be looks like it might be me because I'm trying to I'm trying to visit different websites and it's just uh it's just crapping out on me for some reason like I'm trying to go to uh go yeah I can I can still hear you which me should

  174. mean it's really weird like refresh this I don't know if it's my internet or not it's weird it's weird because um

  175. my OBS is showing that it's still looks like it's still like live and up but like I I have I'm trying to like access literally anything else on my uh computer just started freezing

  176. hey Webster cowy seem fine on Twitch hasn't even buffered once for you that's that's good news that's good news yeah um

  177. we'll see if we can get uh Dave back real quick

  178. it's good to have you here Webster Crowley it's it's interesting that uh yeah my my internet seems like it's completely shut down except for you you're the one access I have to the outside world world right now

  179. okay wait hello I think we might be back check check check check check

  180. I don't know if I'm going out to the world or not on Josh's on Josh's stream World hello world okay I think we're back hello hello hello I can hear you now can you hear

  181. me okay can you hear me hey hello there we go I think we're back I I just did like a hard reset of my uh of my internet just really quick and I think it reset things're so whatever was happening it works now I don't see your video but I do see a screen okay sweet we are good then I think we're good I think we're good

  182. yeah okay sweet okay after that little hiccup thank you everyone for uh still being being here Dave is back I can hear you thank you wster Cary you are the the one Saving Grace of like everything seemed to be working twitch wasn't didn't tell me it was down like I dropped frames now just because I reset the internet real

  183. quick uh um so crazy uh okay where were we oh I was I was asking U the playback ID of like is should I save that to the database then of like okay like let's say I'm I'm uploading a whole course to M I have like the whole uploader built up am I getting the playback ID back saving that to the database and then

  184. just passing this in here as you know what what I would probably do would be like cool course or like courses ID kind of thing uh yeah you essentially are on it like you can uh when you complete an upload you will get some information about that video back including playback ID for that

  185. video and some other stuff like the duration of the video the width the height like things that might help your layout that kind of thing um uh so that once you receive uh what happens under the hood I don't know exactly what got cut off but like there there's a async web hooks that are sent to from MX to your server that will notify your server of the status of your video upload and if that video upload is ready to go it'll give you the

  186. information that you need to save it to your database um probably as an API endpoint like you would have that set up um to handle that request and then uh then you're good to go so when you would visit a URL that would know which video that you're trying to load up based off of maybe it's like a a episode in a course or a lesson within a course or whatever okay you would associate the video with that um then you could pull

  187. it uh pull it that way from the database okay no that makes sense yeah so grabbing the grabbing the ID where possible it's probably like the the the better sense of the sense grabbing that playback ID yeah yeah so what the way that I kind of think about it is like you you'd probably have an assets model or or videos model in your in your database to

  188. interact with and that might belong to a course um so a course has a title and a description uh or maybe a lesson rather sorry like the lesson has a title and a description and tags or whatever and then it also has a video associated with it so you basically load up that video that's associated with the lesson and then grab the playback ID um for that video perfect that's cool that you

  189. can tag all that then within mck like if I'm understanding it correctly like like some of that might be done best like keeping it in I would assume like kind of like folders with tags within mck well the actual like organization and kind of like CMS management is kind of left up to you like it it depends on what your use case

  190. is if we were to assume that um you know you have a certain approach it wouldn't really be a good fit for every user because we have all different kinds of use cases so what we do instead is just expose the data that we have that's available for that particular asset and give it to you via a web hook so that you can kind of do what you want with it you can add that additional layer of kind of like CMS metadata in a way for

  191. that video okay the title or description or whatever and we just kind of give you that video data associated with it there won't be like the organization and all of that is kind of up to you to implement in the way that makes the most sense for your use case yeah okay that makes sense yeah so if we were to do like let's say instead of this just being a hard code

  192. maybe we'll have a new video model in our database where then we can upload it and upload it to MX save that video ID and then like Loop through it here yeah exactly may we maybe we'll we'll do that are we building your your new course

  193. right now we could we could we could do that enable your uh what's what's the topic of the course that you want to make it's going to be called uh from JavaScript to Lille JS to lville uh so if we did like uh PHP artisan make model we'll call this video create a new migration for it and just

  194. for Simplicity sake what we could do is is grab or have a string of video ID or M ID would that' be a good good way of calling it I just I like to be really explicit about what because there are a lot of different IDs over on MX too there's IDs for okay um all kinds of different things but what I would so I would just say playback ID for sure Al playback ID

  195. perfect okay so even before like let's just let's just then migrate this we'll go into the video model I like to do this protected guarded this is basically just telling laravel that we can put anything in there besides like the actual ID of the

  196. model um and then maybe we'll also create a new yeah we'll do it we'll do we'll do it this way so then in our app. blade. PHP layout let's add a new page for um we'll add this as the

  197. videos and then create a new videos. blade. PHP and here why don't we create like a a new form to create a new

  198. video so now if we go back we should be able to see yeah this new video page so here maybe we'll just do just for just for Simplicity sake we'll say public function with which basically just says says hey we want to uh put all new videos onto this

  199. page oops and then we'll create a new form this is the one part I like about like cursor autopilot is one one of my favorite things is because uh it just it works pretty well yeah um

  200. public string of title public string of mugs playback ID okay oops I don't want this in the mount

  201. am I doing wrong there we go okay look oh yeah we can't have a [Music] form okay so if we add a new

  202. video and we have the playback ID let's just grab this one for now so before we even do any kind of like uploading to mck we grab this and create it wire model title new video

  203. okay and now we can Loop through for each videos's videos but we're just going to grab this MX Player and pipe that out okay one HTML element per comp oh okay I know what we're doing

  204. okay sweet so the idea would then be if we if we create this form as an upload component we could essentially remove the M playback ID grab the playback ID push it into the model and being able to have that so if this was like

  205. um this was uh spelt to larel and I have that playback idea but it's essentially the same one but now we have be able to have two videos on the page um but now if we could pipe this up to an upload button to MX that'd be sweet

  206. too yeah um I guess I maybe I missed did you you added it seems like you added a title to that model as well um so that's stored in the database but the way way that I think about this from the upload perspective is like clearly you don't know the playback ID in advance unless you've already uploaded it right um yeah so we kind of have to rewind uh a little bit at some at some point to understand like how do we get a playback ID like

  207. where does that come from um so what you described earlier on uh in your other app that you you'd built you were ingesting from a video that was already hosted somewhere was already on S3 or somewhere out on the internet publicly accessible and when you added that video to M you immediately got a playback ID um as a result of of that that um API call there's a there's a web hook that

  208. would be sent to say hey a new video asset was created and here's the here's the ID associated with it yeah but even for that um that happens kind of immediately and what what happens when we're doing a direct upload to M if that we were just like skip that middle layer that we were describing and instead of putting on us3 we just send it directly to MX we need to create a direct upload

  209. first which kind of acts like a container it's just like a it's like a box it's like an empty box that just says all right I'll take a video as soon as you have it for me and that box is um gonna give you what's called the upload ID um okay so it's it it doesn't have there's no playback ID yet for that box because it there's no video it doesn't exist on M yet yep and so event essentially what we need to do create

  210. that direct upload which gives us that container then uh it'll also give us like the URL that we should upload our video to at the endpoint and then when that upload completes we will be able to then we'll get a playback ID at that point y y so there's there's a little bit of like kind of a taking a step back thinking about the use case here yeah grab the upload ID or create create the

  211. direct upload first to have an upload ID which we probably also would associate and throw in the the model as well is the MX upload ID um so that when the playback ID is ready to go we can kind of look up the video uh based off of the upload ID and you know associate the playback ID with with that video does that yep no that makes sense so I probably would like just to kind of like

  212. think through that a little more like add to the model the MX upload ID as well and then when this page loads we can like kind of like optimistically create the direct upload we don't need to like they're kind of cheap like we don't it's okay for us to create it even if an upload doesn't happen we can just create a direct upload as soon as the page loads and be optimistic that uh you know we'll have a we'll have a playback

  213. ID at the end of the whole process the other one might want to do in your videos model is uh is um a status so a different you know we have a I would have to look at the U different values there but you could do something as as simple as like a pending and a ready um so maybe that's an eum maybe it's just a string like you could just keep it as a string for for easier um yeah but that

  214. just helps essentially I kind of get propagated down to the end user or allow you to understand where this video currently is in in the process has it been uploaded at all is it is it working on the Muk side or is it ready to play back um this will help you kind of optimistically update your user interface to say you know if we don't have the uh playback ID yet and the video is not ready we could show something other than a blank player that errors out because it can't find the

  215. playback ID so okay with this information here this should be a good spot to to kind of move forth um does that make sense any questions there yeah no that makes sense um yeah being able to yeah being able to I guess like a good question like with this is does does Ms have I would imagine like

  216. probably within like the the react space you probably have like an upload widget does muks have like the ability to or like especially with large files I would imagine that it takes a while to upload so what is like the best use case or best uh way to to do that I guess in a lot of ways

  217. I'm just I'm watching you discover the answer on your own but there's um the upload for web upload for web yeah it this is again is like very situational some yeah companies or if you have like a custom app you might want to build your custom uploader entirely yeah or you might be okay with just a drop in solution like a like what we have here which is similar to the player um playing back videos there's also an

  218. uploader so you could use that's nice M uploader to handle all the front-end UI but also give you enough customization options to kind of like tweak it to you know make it look how you want it to look um but this ideally alleviates a lot of the the you know friction of having to build your own upload process which you can do um instead you could just drop this thing in and uh get there a lot faster yeah I like

  219. that let's see what that looks like so if we go mpm install MX uploader and we'll bring in this MX uploader component

  220. yeah that's another thing I think worth calling out to which I think is pretty sweet there's just kind of like polarizing I think in in web development how important web components are um but here all these all these are just built on Native web apis using web components which makes it so that you can use m m uploader in something like a laravel blade template without worrying about compatibility or do they have the react package available or is this like a

  221. spelt or Astro codebase whatever doesn't matter like you just use a web component and it just works everywhere so yeah I think that this is like one really solid use case for web components is when you have um these sort of public components that you're Distributing for um consumption on the client no I really like that yeah and then this MX uploader should be we're

  222. looking for yeah I'm a yeah there we go and so I would imagine the nice part about this is you you just like you said it's a web component which is nice but then you just get all of like it probably does like the chunking and everything for you I would imagine yeah exactly so you don't even you don't even

  223. think about any of that stuff um which again is like our goal I think M stuff is complicated uh can we just make it easy yeah so yeah the only thing you provide that you have to provide MX uploader is the endpoint which is where are where are you uploading where's the video going yeah just kind of what I was describing so on this page load this is where we could

  224. probably use the PHP SDK okay to create the direct upload so this would when the page loads um optimistically suggest like hey hey M we got a video that's about to be uploaded we need a container for it so we'll make that API request immediately on page load and then we'll use that upload um ID to first like store it with a new video um in the in the database but also

  225. give it to the client so that MOX uploader can use it to send the video data up to MX okay I see and that SD probably has the ability to then does that is that endpoint uh G to be dynamically set or is that going to be a static property yeah it's a it's like a signed GCS URL okay so it's all

  226. it's all Dynamic but it'll it'll give you the value that you need to plop in there sweet let me I'm going to hide my stuff well I guess like let's see if I hide things from the stream real quick just I get make sure I get all the the API Keys set up see if I can do

  227. this for now just bring my whole video large real quick okay so I log

  228. in think you're the only one that's going to be able to see any I might actually be able to grab these from uh from that previous setup real

  229. quick M token M secret grab those just so we have them in the environment

  230. file okay bring this back should be good to go now I would imagine within here then so we we could say like when this page loads and uh Live Wire has this public function Mount we're saying hey when

  231. this is actually like created this is when we can instantiate that uploaded file what you're were saying yeah exactly so you'd use the probably have to like import the uh PHP SDK there and then can make a call which probably could just copy you straight from the docs um for you the GitHub repo there of creating a direct upload so I think um

  232. I could also send you an example from a yeah but if you go to uploads there and what we're looking to do is create a direct upload direct upload here here yeah so oops this probably direct upload yeah that looks that looks like what we're looking for yeah okay

  233. I'm curious now of how I did this uh in the other code real quick I'm going to hide it just to make sure I didn't save it on the environment files okay let's see how did I how did I do this upload

  234. I did MX MX PHP yeah okay I must have just done the assets API so what's the difference between the assets API or or are we or did I copy that can't remember yeah

  235. assets API is what you were doing before you can create an asset from a a video that's hosted somewhere already so you probably like I don't know where you did this but like uploaded the webm maybe with a post or a put uh to some kind of signed S3 bucket or something and then when that was completed then you created the asset on MX using that public URL or signed URL um okay that's probably what I did yep

  236. so you skip direct uploads entirely which is again it it's it's that's a perfectly fine use case um but the direct uploads will just kind of skip that step uh okay so assets is basically do you have a URL video uh video uh yeah an asset URL that you're already hosting somewhere else could be cloudfare S3 whatever yep and

  237. then it's creating an a MX Video from that whereas the upload is is we we don't have a video file host posted anywhere yet it's just chunky okay that makes sense that is the reason why okay so we're creating some subtitles uh input create asset request upload

  238. request upload yes so I mean just to kind of break that down a little bit like that's not all required but a nice thing to have you know if is um you want them as part of your video is to autogenerate subtitles based off of your video contents so that's something that MX offers um for free as part of as part of your upload so that's what that's included here in the example it does make it look a little more verbose but it's uh just

  239. kind of a nice add-on there okay that makes sense and uh yeah so what we're doing is basically building out the the payload like the requests that we're going to make here so we're using this like create asset model or I don't know like the PHP term is is a yeah just a little different for my brain here but like we're we're building the request we're we're setting the expectations for what this end video is going to have uh

  240. it's going to have autogenerated subtitles it's going to have a public playback policy um which will allow anybody to access it if they have the playback ID and we're also creating the direct upload which is again that container for uh accepting that video so so okay that makes sense uh what we'll see here as a result of creating that direct upload you can kind of just like I don't know maybe dump that upload or

  241. however that works uh so can just kind of take a peek at it okay yeah so if we pull back up our thing here we should be able to okay undefined variable uploads API I might not have pulled that in from the

  242. actual probably got to do the config yeah there we go actually set this up I kind of Wonder it you don't have to do this where that would normally exist in a laravel app for like a client that you want to reuse on in different areas of your app yep I and and I'm I'm a

  243. terrible person to say like the answer for that but I would imagine that's what this m Lille thing is it's not actually doing anything different it's just basically like being like the rapper for it most of the time uh what you have it is in this service provider so that it's it's instantiated basically whenever like the app is booted um yep which is looks like what what they're doing here and then you just usually would be able to call this

  244. what what's called a facade in lville and I I would be able to call something like you know like mck colon colon and uh then you know create upload requests and it would automatically be all of this would kind of like already be generated for me in that sense got yeah that makes sense nothing wrong with doing it like this too but

  245. yeah think technically the laral way would be like okay create your own service provider that MX has so we should be good to go now okay refresh yeah we're good and if I should see in my terminal okay so this is the the data let

  246. me let me pull open a different log real quick actually let's just let's just die and dump this die and

  247. dump okay so we have a container with the data bump this up with an ID so this is this is not the stream ID this is the upload ID that's right yep so you're kind of like tracking the video as it goes through this process of of the upload stages okay and this is what I would imagine is like the signed URL that we

  248. kind of have because I've already initiated my API and token this is for my account uh yes so this is basically ready to that's where you would send the video to the one thing you want to look out for here is is that cores origin yeah I value um probably should update the docs on that actually but this is basically

  249. you can put a a Splat there um asterisk and what that will do is allow um your upload to come from anywhere but if you need a lock to like a only allow uploads from a specific domain then you get through okay there interesting okay I see um okay so we have we have the uh upload these are two things that we're going to need here there's the upload ID

  250. and there's that signed URL right there's um and that upload ID we can immediately create that video in the database um that doesn't have anything other than just the upload ID uh assigned to it right so at a later stage of this upload process we'll be able to look the video up by the upload ID and then kind of tag on the playback ID when it's ready to go okay I see um and then

  251. you have the signed URL and get uh I think it's just get URL um MX get data get URL sorry MX get data get Euro yep just follow the same pattern as the line above uh but just get URL oh get URL sorry that's that's what you're saying

  252. there you go okay okay yeah and should that should be ready to go as long as you can pass that down to the uh to the view okay so then we should just um kind of echo it out right here we'll just say that refresh did I break something

  253. okay yeah so we have the signed URL and we have the ID perfect yeah so that the approach here um generally that that that URL can just be thrown right into the MX uploader so we don't have look at that or doing anything too too special with it there's just a attribute for MOX uploader called endpoint so you would just edit your uploader yeah there you go endpoint and

  254. you just pass that right in there uh and that's the only only thing you need to pass to M uploader okay and the upload ID is again we're going to use that depending on how much time we have here um there's two routes we can go but we'll we definitely want to save that to the model um After we receive it so that's probably part of the like after

  255. the API request um to create that to create that video okay and so essentially what I would imagine would would be the the best case is like okay you start off this this process by uploading a video file once it uploads the mck then we can get or then we can create some a new

  256. model in our database with that information yeah but I for me and you could do this a couple different ways but the way that I think about it is like let's let's optimistically create that record in the database okay yeah yeah to say like hey we do have a new video incoming and we'll be able to update it later but this is the video container and then this is the the status is like pending or whatever and here's the upload ID and once the upload completes then we can update that record

  257. with the playback ID and update the stat it's ready to go okay um so that's probably how I think about a production app but again it just kind of depends on like how far we're gonna get into it uh this is probably not I should I should probably not have done that that's a that was a larger file than I thought it was uh yeah that was a that was a four that was a four gigabyte file like that

  258. the amount of like 5sec videos I uploaded of of me just saying hi to myself uh man it's embarrassing what my actual M account probably well we'll do one right now hey everyone this is on the mck stream okay there we go it's nice to have the web component

  259. that is super nice especially for us people who uh uh like you know obviously my preferred Tech stack is not in react so it's nice to be able to just have stuff ready to go without having to do anything else yeah you know I honestly I was probably one of the com like I it it wasn't intuitive for me at first um but I warmed up to it like understanding the way that we use them

  260. with our distributed components uh makes so much sense and I do like that they're just so like versatile that you could style these with basic CSS that you already know and you can kind of compose your uploader as like this does have a lot of flexibility as well you don't have to get into it here but like you could drop it like plop it and go just like we just did here or you can customize this really well too like you can change the text change the colors

  261. change the layout um a lot of that's with CSS and HTML so that's that's really nice to have that is really cool I love that okay so I'm assuming like what it did behind the scenes um might have let's

  262. see like do we get an any any sort of uh response back which then we could kind of like watch and and hook into or is it going to be or is it am I am I doing things the hard way in some sense no no this is um this is all set up correctly okay and the what what you won't expect to

  263. receiver response here okay um this is where you know this this particular conversation can kind of go one of two ways uh yeah in a production application um you would listen for updates from mugs you you would receive web hooks of events that are occurring uh within your application to your server to your endpoint and those web hooks contain information regarding the upload so it would contain the upload ID it would

  264. contain maybe there's an event that says like the video asset has been created and this was the upload ID that it came from you would handle that web hook and update your database record now with the you know the uh asset ID and the playback ID rather than just the upload ID you can look it up by the upload ID yeah um so that gets that's like the production use case right where you if you were to do this here you would have

  265. to you know tunnel Expos have a public URL so that it could contact your applic and it it quickly just like what gets a little tough is that quickly escapes like an hour you know hourong demos um yeah there's plenty of example code that we can you know offer and kind of walk through there but um what I end up doing generally for for these kinds of demos is

  266. to um when we load up the playback page we make a request so this is kind of hacky but you make a request to the um upload ID to get the corresponding asset ID okay then you can receive the playback ID as a result of that so again it's like it depends on how production ready you want to go with your with your implementation yeah

  267. um I it yeah it it can go either way but the the actual approach would be like handle the handle the web hook events okay no that makes sense that makes sense and I I assume like I and I guess like that would be like a good a good question for like is is most people who are using Ms in this particular way like you don't

  268. need to upload and be and automatically stream it like right then and there from I would assume for most use cases most of the time you're probably uploading and now it's like live on your site it's not like something that you you you need like a uh you know like a a socket and you're you're as soon as that happens like the the web socket or the web hook approach seems like fine for most use cases because you're you're okay with

  269. having that little bit of delay between once it's uploaded now I can receive it back yeah I mean again I don't want to make too many assumptions here like I think both are completely valid use cases and I don't know I don't also know a ton about oh gosh Live Wire uh but it seems like this would be a really interesting use case for Live Wire where you would am I getting that right live like where you could listen to a change in your database and it would it would know

  270. like to update or how does that how would that work yeah there's kind of there would kind of be like a couple different ways of doing it within larvo like so larvo basically has two ways of doing it Livewire has a like server polling that would probably be like decent enough for this use case where you could say um you know maybe we have a job running in the background that as soon as it hits as soon as the web hook hits we could

  271. uh basically be pulling the server here to update the information um and that's as simple as like doing something like this wire pull and we could say every you know 5 Seconds we check the server uh laravel also has what's called laravel Reverb which is more of like the websocket approach where you can say um

  272. you know once a specific event actually happens in this case on MX uploader complete then we can we can actually run the uh run the process of like grabbing that information from the server there's probably like multiple ways to do it from there but that that makes sense within the web hook sense of like once this upload has been so we initiate instantiate if I'm

  273. understanding it correctly we instantiate it on Mount um we're getting all like the actual uh upload ID and the signed URL and then we're when uh this actual uploader piece finishes what we would then do is have a web hook um to grab that information and push it to the database yeah yeah

  274. exactly that's what would happen without you you know needing to pull basically like you I think you could also kind of poll and have some kind of endo that set up whether it's like our custom API endpoint or you know however way you would handle kind of broadcasting events within lville okay you know you could kind of like handle it that way with just like

  275. hitting hitting the API to check if the asset is ready to go um the M API and it would kind of be proxied through our own API or uh when you visit like the playback page you could again I said this before but like look up the um upload based off of that upload ID that we received on the client okay and then uh you know exchange that basically for the playback

  276. ID eventually so we would kind of correlate those two down the line so got it this is actually really great view uh for this kind of thing so we're seeing every time we create a direct upload we receiving an upload um web hook as well yeah and uh this is just showing that the progression of all of that so uh where we I think we reloaded that page a couple times but you can see like

  277. the video asset ready uh web Hook is a basically one of the main ones that we that you want to listen to if you click on that and this will give you an idea of what your web hook receiver would get and in that payload see that upload ID right there yeah yep so you can now you know like in your laravel app oh I I I know which video I need to update it's based on that upload ID so grab ID the

  278. ID yep and then add all the information that you need from that so there's a playback ID there's you know things like the the status might be important update the ratio aspect ratio for CSS purposes um asset ID is probably a good idea to store that as well so you can reference this asset in the future say if the N user or you in this case might want to delete this asset like you would want to

  279. delete it based off the asset ID um yeah so there's just a lot like there's a lot of autonomy here there's flexibility in the implementation and I think that that is really why we try to like not make a ton of decisions for you because every case is a little different that makes sense yeah cuz then I could see having and you know cuz we already added the playback ID and upload ID so all we could do is this could be

  280. playback ID would be nullable yep and then and we could say okay now when we're creating the video we're creating it with you know we're creating it with the upload ID and then once we actually receive that Playbook then we're just we have we have the upload ID already so we can save it save that playback ID once that

  281. web hook hits back into this back into this model yeah exactly and I don't get me wrong like I think there's still if you ask me I think there's still room for improvement here like from the perspective where like I think that there's probably just like we're creating optimistic um direct uploads right here I think we could also create optimistic playback IDs where like even if does not create or does not upload a video we can kind of whatever we can

  282. clean that out on our end if there's like no video associated with the playback ID but if you were to then make that API request like we're doing right now um would it be nice to like I don't know just receive the playback ID uh as a result of that request or like know you'll know in some way where you expect this to live um so I think that there's ways to to optimize this but the the way that this like was originally built was

  283. architected such that you can make some of those decisions of your work go on your end yeah yeah I like that yeah or even if there was a way I don't know um I don't know the the the the best way to do this Within web components specifically um but like if if there was some way to

  284. know uh let's say you know when this actually has been complete of them being of then saying um well then I on on my page could hit mck API and grab the playback ID even before I move forward so maybe it's like okay I have to wait for these videos to upload before I even press submit on the form

  285. right but the very least then I know that those are able to that the very least I know that I can grab those playback IDs yeah and I think that's probably something I glossed over here in talking about the web hook approach whereas if we if we are gonna poll we're gonna like make an API request when this completes yeah that's possible too you have to use a events on the client side right so there's MX uploader we only added that one endpoint attribute um but there are event

  286. attributes that you can add as well that's just like on success uh what do we do on success and it'll call a function on your client side to oh okay interesting handle that accordingly that that is really interesting like so there's an OD sus yeah you would do a uh camel case so Dash and just c s and then you just pass a pass your call

  287. back that is interesting because that would be like a benefit of of live wire for example where I could I could have this run um even though this is this is Java Script I could technically have it run a PHP function okay success that's dope if you I didn't know that that's possible if you can make maybe we should just like

  288. try to experiment with that yeah I'm curious of this uh just a just a play around let's see if um I think that's what I would do because this there's this wire dot is basically saying that even from JavaScript as long as like this what I assume would be a

  289. function um I should be able to call uh this wire Dot and then anything after that is basically being run on the server um but we're calling it from JavaScript from a client side um Webster Crowley uh I I missed a bunch of your comments uh I have tried PHP storm I like it a little bit but like it's just feels slow for me I know vs code sometimes feels slow for

  290. people too but like I don't know it's just one of those things that I'm I'm used to now um Zed is one of the ones I'm actually curious about I haven't fully dove into yet um spelt dudes will love fully own volt I think fully own volt is an underrated stack within lville um and then Le I'm wounded that react isn't in your ID ideal teex stack uh yeah wounded

  291. uh I like I I use react but it's not the one I'm I'm going to 90% of the time if it's not live wire it's probably spelt and if it's not spelt then I'll use react um yeah I'm okay I'm I'm curious now see if this works let me let me actually pull open uh the Live Wire docs make sure I'm using this properly yeah I'm I'm literally doing the same for the MX uploader docs

  292. too and I we might be an assumption we made here that I went into react brain so whoever was oh might be like a there's just a different way to react yeah to like wire it in HTML like as a just as a general event listener on the HTML element instead of just like adding on success as an attribute react we kind of like we handled that with on success

  293. on the component but there might be another way to to wire that up here yeah so I'm curious if um maybe even just like in a script tag that could be interesting yeah

  294. definitely so if you actually um I'll let you run this real quick so then we could say something to the effect of like I would imagine we could see when this is successful from here so you you want to get a reference to the MX uploader

  295. element so you you know something like um query selector M uploader within your script maybe you'll get a suggestion for that uh yep just save that to a save that to a variable of some kind or that yeah that looks good right there that second one so this is grabbing the the element and adding an event listener for success and then showing the event so that should log out as expected um okay let's

  296. see using this no what did I do what did I do

  297. wrong oh that's why no let's see maybe here I change it's still got the on success

  298. showing up in theage it's kind of strange let's see maybe I just refresh that there okay clear this out real quick

  299. oops now we add this script back in okay so now I should be able to pop in this video I should

  300. [Music] loading sweet custom event Target type success okay so now that it's success then I should be able to hit the M API and just grab it there that's pretty cool yeah exactly it be interested to see if you can I don't know anything about the the wire approach there but if

  301. you were able to then you know handle this event on the server in some way so you can use the MX the PHP SDK which has you know your sensitive credentials in it which you don't want to expose to the client if we make an API request um maybe there's some way to wire that up otherwise you know if you don't want if you want to kind of like handwave that that's doable here too but you would have you would just make a request using

  302. that uh upload ID that we currently already know right we to uploader and you would make a request to the MX API to get the corresponding uh asset ID information yeah so we should be able to do that because then I'll I'll just upload it again and

  303. then any script tag has the ability to use that dollar wire sign so upload complete we should have have in our terminal this yeah this has been successfully uploaded okay so yeah now we can use so now if I go back to this uh I go back to that M PHP we grab an

  304. example to grab the um grab it so maybe data would be data or video video uploads it's still direct upload that we're getting okay so list direct load get direct [Music] okay this is kind of Uncharted Territory

  305. and PHP land for me so we'll see how this goes that's okay and so we'll get the direct upload so we get direct load upload get data get [Music] ID so make sure that you yeah we'll want to pass our upload ID there okay yeah so this is where we'll pass in the upload ID and then can you log out the response

  306. or okay yeah then then we then we should just say let's just get um and we we just I don't know if D and D will actually work because running this afterwards but let's

  307. see refresh drop this in again I also want to come up with some way to make this like I think it's cool to see the first time but uh to actually test your implementation to have to require a video upload every time it's a little it's just a little tedious so curious to see if there's some ways that we can kind of improve this build out flow um in the future as

  308. well oh yeah I need to initialize it again there we go refresh that oops [Music]

  309. okay data container then we have the asset ID yep so the asset ID is basically our our new reference that when you're doing this polling approach you can use the asset ID to then get all the details that you would normally receive in the web hook event um automatically got it will be fetched through the asset ID so basically Exchange we're exchanging the

  310. upload ID for the asset ID and then making a request to get the asset which will give you all that uh aspect ratio on the playback IDs and whatnot so you can make one more API request for the asset so that would be under video and then exercise assets probably exercise assets okay so then I could get create the asset listed assets

  311. get asset okay so then within the assets API am I already calling the assets API or calling the uploads API so I do need to instantiate this assets

  312. API okay so then we can call here curious of what what it'll do for me no I don't want to create an asset okay then I can I think it's just that that line right there asset this one

  313. yep then I could say asset equals create acid response this yeah there's something here that like again don't use this SDK often ever like maybe very minimally um feels like maybe that we're doing something wrong that you shouldn't have

  314. to instantiate for each API endp point but I don't know I mean maybe maybe that's how it's designed right now I don't know um oh for the the difference between assets API it feels like we should be able just use the same for all of these but I don't know yeah that's where my PHP knowledge uh does not come in handy cuz uh I I don't actually know what it's doing there I I know that like technically we're we are instantial in

  315. two guzzle clients which is like the HTP client but I don't know if there's a way to I wonder if it's let's see can I put this into one request yeah I don't know I me this will work for sure this will work but like I just wonder if there's a way

  316. to I'd have to do some more research on my end to see if there's a way to just kind of clean that up um so in that examples I think there was one other maybe one other call that we needed to make I'm not sure should be see asset yeah there we go cool so then yeah you can see in there there's like there's the playback IDs you can see the status right now I mean it it was when you made that at the

  317. time of that request it was still preparing preparing okay interesting so you know that information is important for you to know that if you know for whatever this 5-c video that you uploaded it will not be in a preparing state for long in fact I think like most assets already in like under five five seconds or something um but if you're uploading like a you know half hour tutorial well that might be a a little bit longer and so you want to

  318. know when it's ready to go by tracking that status got it and I assume that once it's uh that that's like the web hook approach it's like once it's ready it's ready that's right yep that's that asset. ready event that we are listening for yep so here you have you have the ability to upload the or kind of save the playback ID with with the in the model um even though it's it's still

  319. preparing so you could you know make make a call to update your database here U with that that information and it would be where you know the where the video asset has an upload ID of whatever that we currently have okay I see yeah because then we can say

  320. yeah we could just call that for now but yeah M playback ID get playback IDs interesting but I might actually just

  321. for Simplicity sake I'll make this nullable too I'll remove this myr it again okay so if we did everything correctly we should create a new video and do the title ID of that

  322. but we'll pass that into uh but we should be able to get that playback ID now running this create video from the script of saying okay once we have this event listener of success we'll create the video yeah I mean the one hole here potentially is I don't remember if that's how we set it up but when you make the initial request to this page if we created the container of that video

  323. with the with the upload ID associated with it in the database instead of creating a brand new video record as a result of this success um event we would update the existing record that we've already saved that has that upload ID associated with it uh yeah so that yeah yeah because currently a new one I think okay get asset ID yeah there's just

  324. some some accessor these are so interesting this like get get everything I'm just just say the title for now is just my first video just to make sure I did everything right let's see okay refresh so right then yeah what you were saying was like okay we we

  325. technically um technically we got uh when we refreshed this comment or this uh the upload ID it's instantiated we weren't pushing that to the model just yet but what you probably would was create a new model when you click submit or maybe even like on success like create a new

  326. model even before you grab the ID while you're waiting for it to finish yeah I me again this all depends on like the production Readiness of your application but it's possible that when this page is loaded you would create a new record in the database that has a video with only an upload ID associated with it nothing else then once this video has been successfully uploaded we can do the dance that we're currently doing which is exchanging that upload ID for the

  327. asset ID and getting information about that asset and then making a up uh update request to the database that just updates and propagates the the existing record in the database with the information that we now have since that video is ready to go oh okay and that makes ton of sense um but yeah I mean like again like in a production application you would want to know the stage of every every part of the video pipeline

  328. right um so that's the way that you could approach it and something like this you could just create the video asset as soon as the video's done uploading like we like you currently have built up yeah okay uh project gopher Len good to good you have you here on the uh on the chat and yeah I forgot to look at YouTube chat for a little bit uh but we we missed a bunch uh so thanks sorry YouTube Sorry YouTube uh thanks Tilly uh for the donation I

  329. really appreciate that um good to have you here uh and hi everyone uh on YouTube looks like it's started popping off the the 20 minutes I didn't look at YouTube chat uh WTF is MX we kind of already pass it but basically MX is a way to uh have video data streamed uploaded and processed for anything

  330. basically that's a gross oversimplification of what we just talked about but I feel I should buy a domain name WTF is mo.com WTF is MOX uh Len good to have you here uh Alex I know yeah I think it's your first time uh First Time In The Stream but I I know who you are so uh good to have you here um yeah so

  331. okay now if we press or if we upload this everything should work properly nope we get a yeah I think an incorrect accessor is happening here so like that that function that we're calling or method or whatever you call it a get playback ID yeah one of those or maybe it's a get data get asset ID oh gosh there's so many of these where are your

  332. line numbers uh I remove them let's let's D do the asset again yeah I remove them that's like a question for the chat does anybody else in life remove and the code I really just need the data container playback IDs and then null

  333. index for container this is what I'll do in in cursor since I'm not a great developer I'll just say hold on I'm just going to look up this actual okay see where you're setting the asset variable up there this one right here yeah that one I think there's an error going on there so like when we get upload get data get asset

  334. ID are we actually getting the asset I uh the upload we need to pass the correct uh value there I don't think we're getting it correctly yeah there that looks a little better at least for that line yeah I think I think this was the one I was it was airing out on okay let's see so let's see see what we do now

  335. refresh upload yeah there we go okay so yeah it's not available yet I'll assume because it's still within that 5 seconds is still processing but if I was to refresh there we go there's me nice yeah and that's kind of like the ASN nature of all this right like the the a video processing job although is actually pretty quick with this kind of stuff yeah that's that's insanely quick

  336. for processing even for a 1se second video whatever that is but it's like uh it's an asnc job so you want you basically are telling you know telling it to go do the work of process the video and then you should expect to receive a call back basically um yep okay that's a good way to to handle it all and just for we'll do a flux input

  337. wire model. live of title we'll do that here so that going refresh we can call call something different let's record something new for the for the stream hi YouTube We Webster Crowley says uh can you ask him my questions from early regarding processing okay um looks like Len has some questions regarding okay I'm seeing a

  338. lot of data here that looks like it came right out of FF probe can you ask what kind of processing happens upon initial upload are we automatically making an m3u8 hls playlist yeah your second question uh correct that's part of what M does we'll take your input and create the Renditions available so that you can play them back um in your player with a with a hls playlist and through it the

  339. first question looks like it came right FF prob uh it can get a I mean possibly I don't I that that's there's a lot of i' ask you more questions about what what you mean by that but um a lot of what we try to provide to you when an asset is ready to go is the asset that's per or the information that's pertinent to playing that asset back in your environment um for somebody like a just

  340. embedding a video in your web app maybe the only thing you care about is the playback ID honestly uh but if you're a big broadcast or you're like a a a bigger company that's doing GC content you might need more information about like all right somebody's watching this on a phone is this aspect ratio for this video uh you know 16 by9 or is it one one or like what what what are what am I expecting what metadata do I need to

  341. know about this information to be able to show it uh and use it within my application sometimes that's visual sometimes it's not sometimes it's um like uh another example here might be if you are enabling ugc for uh other people to upload videos as well maybe your your service locks down 4K like you say hey if you want to be a member of our um application sign up over here

  342. you'll get access to you know basic video quality um unless you're a paying member and then you get you can unlock the you know 4K quality and when you receive a web hook back that contains information about your muk's asset it will enable you to understand what this video is all about is it a 4K video is it a 720 um do they have downloads enabled or not that kind of stuff so they definitely like I would say like

  343. data that you can pull from using a a program like FF probe um but it's not that's not just like a out you know a straight dump output of of some a tool like that we do a lot of work to just kind of curate and only give you what's pertinent to the to your application awesome I only have a couple minutes left so we're just going to we we'll uh we'll run through the last little bit of making sure everything's

  344. good to go on this but it's pretty cool how far we got and being able to have it uploaded and like process and stream and looking into that event as well even without doing any kind of like web hook I'm going to record a quick video for it we'll say we'll say hey everyone from the muk's stream let's see uh let's see how this works

  345. okay and upload that here bam oops I'll refresh this so we'll say this is like so we should be able to have uh the final video for mocks um upload

  346. that one's a little longer not having to handle the uh the upload component itself is so nice for me uh yeah yeah truly like uh I said this at the very beginning of the Stream like there's parts of your app that like you just don't really care about or you shouldn't

  347. care about like you just want the upload to work you know and and that's just functionality that feels like it should be just native to the to the application rather than like you needing to be the not even the expert but like the person in charge or responsible for writing the code to facilitate all of that um so that's what that's really what MOX is trying to do is like let's have a really a great great developer experience that reduces the amount of code that not only

  348. you have to write but that you have to maintain and understand and keep updated with the latest codecs and approaches and services and whatever like just try to take care of all that sweet um yeah looks like we have captions we got the video 9sec video uploaded and uh yeah this was a lot of fun uh thanks so much uh Dave for uh jumping on and doing this I'll put

  349. Dave's uh uh you do you do a shout out for you Dave where where can people find you if they have like any more questions uh I know Len has a couple more questions in the in the comments I gotta go Len so I apologize but Len hit me up yeah I'm I'm Dave atm.com or uh Twitter Twix uh um I actually haven't heard Twix yet that's that's interesting yeah there you go I just say Twitter SLX like on all my

  350. videos I do I just say Twitter SLX uh who knows what it is anymore um but yeah Len happy to answer your questions um there there's a lot to video there and this stream probably do like a 24-hour stream next time it's infinitely deep um but it to me anyway this is a really great place to start so yeah and it was it was cool to see

  351. how much uh we're able to get done with uh with even like only half half of it maybe dedicated to actually building it out but uh yeah thanks so much Dave for uh for walking me through it and uh answering my questions and everyone else's yeah of course thanks for having me and I also stoked to learn about some of the laral stuff here like that wire thing is like I gotta dig into that immediately it's pretty sweet oh yeah that's that that was that was really cool I'm I'm I'm

  352. interested to do a little bit more with like the event success and then being able to maybe like uh start the process until like maybe there's a way of uh of continuing to P the API until we hit the until it's ready that'd be interesting yep um but I'll call it here everyone uh this is good to get to chat with everyone and be back on the on the streams for a little bit thanks for

  353. hanging around um yeah Webster Crowley says I'm gonna look into to game my client to switch to mck there we go there we go win win win-win for everyone hit me up you got any questions happy to help all right see you folks later

just you here