not identify video post id and category

Home Forums WpStream Plugin Plugin Feature Requests not identify video post id and category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #80393
    rixemig192
    Participant

    i am a WordPress developer. I am implementing a show Recorded streaming offline video. I want to show  this video by post or Category. i can access this video using “wpstream_get_videos_from_storage_raw_data” function, But i can’t identify this video are which post or which category related, so please Help me to how can i identify video post or its category.

    #80540
    admin
    Keymaster

    Hi,

    wpstream_get_videos_from_storage_raw_data – brings video from our storage -just a big list and i don’t think you can use it

    You need to build a Wp_Query where you search for ‘wpstream_product’ and ‘product’ post types
    and consider that

    a meta _movie_url is holding the video url
    a taxonomy called product_type is holding the type (live_stream or video_on_demand )

    Thank you

    #83273
    webdevelopment8511
    Participant

    thank you for your replay

    i am not use woocommerce or product type. i am using post_type = wpstream_product and wordpress default category type. it is provide by wp_stream plugin

    i customize plugin and use in front. user can live stream as per click or request. so dynamically create post and generate url and stream. i used wp_stream class and function.

    i can get offline streamed video but i get all video and this video by wp_stream user token not post category. i want to retrieve video by post or category. if it not possible. just add video url in any identification to i can identify my side. you can add identification as post id in video url. like

    url => https://s3.amazonaws.com/wpstream-videos/userxxxx1345/Recorded_Video_Friday-24th-July-2020-12-36-PM_GMT.mp4?post_id=6585

    code is there for get offline video by token =>

    public function wpstream_get_videos_from_storage_raw_data( ){

    $token = $this->wpstream_get_token();
    $values_array = array();
    $url = WPSTREAM_CLUBLINKSSL.”://www.”.WPSTREAM_CLUBLINK.”/wp-json/rcapi/v1/videos/get_list_row/?access_token=”.$token;

    $arguments = array(
    ‘method’ => ‘GET’,
    ‘timeout’ => 45,
    ‘redirection’ => 5,
    ‘httpversion’ => ‘1.0’,
    ‘blocking’ => true,
    ‘headers’ => array(),
    ‘body’ => $values_array,
    ‘cookies’ => array()
    );

    $response = wp_remote_post($url,$arguments);

    $received_data = json_decode( wp_remote_retrieve_body($response) ,true);

    if( isset($response[‘response’][‘code’]) && $response[‘response’][‘code’]==’200′){
    return $received_data;
    }else{
    return ‘failed connection’;
    }
    }

    i hope you understand my question. again thank you

    • This reply was modified 3 weeks ago by webdevelopment8511. Reason: spelling curection and chages
    #83898
    admin
    Keymaster

    HI,

    The function wpstream_get_videos_from_storage_raw_data retries only file names from storage – there is no association between file name and any category.

    To get certain videos (per user or per category) you need to do a wp_QUery for custom post type “wpstream_product” and “author” or taxonomy arguments (for categories).

    The for each video you ca get the meta meta _movie_url for the movie filename.

    Thank you

    #84920
    webdevelopment8511
    Participant

    thank you so much for your replay.

    i think you do’n read properly my question, i was told that i am not using woo-commerce so we don’t have “wpstream_product” post type
    and using wp_query builder try to get video by author or taxonomy or category but your plugin don’t have entry or store on database for offline video.

    when i get the video online it return
    ” Array ( [0]=> Array ( [video_name_storage] => Recorded_Video_Friday-24th-July-2020-12-36-PM_GMT.mp4 [video_name_local]=> [local_video_id] => [is_ready] => 0))”

    so you can see your plugin and server return only video storage name. as per my analysis you get video from AWS server as per your client id like i send request for video you check your token and my id and as per my id(your client ID) you will return all my video not for my post cat, taxonomy anything.

    you can see this array have local_video_id array item and it dont have value .can you store post id in this. you can pass when request for stream and when store video at that time add this post id.if you want to help please contact me.

    again thank you for your replay and provide nice service and response

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.